|
@@ -1,35 +1,51 @@
|
|
|
<template>
|
|
|
<view :style="{ minHeight: sys.windowHeight + 'px' }"
|
|
|
:class="[$tm.vx.state().tmVuetify.black ? 'black' : ' ']">
|
|
|
- <tm-menubars title="搭配" :shadow="0" :showback="true"></tm-menubars>
|
|
|
+ <tm-menubars title="搭配" :shadow="0" :showback="false"></tm-menubars>
|
|
|
<view class="C1b1b1b pb-20">
|
|
|
<tm-tabs align="left" class="qiehuan1" v-model="activeIndex" :list="list" range-key="title"></tm-tabs>
|
|
|
</view>
|
|
|
<!-- 天气 -->
|
|
|
<scroll-view class="scroll-view_H" scroll-x="true">
|
|
|
- <view class="scroll-view-item_H">
|
|
|
- <image class="chuanda" src="/static/img/107.png"></image>
|
|
|
+ <view class="scroll-view-item_H" v-if="alltouList.length !=0">
|
|
|
+ <image v-if="alltouList.length>0" class="chuanda" :src="alltouList[0].image"></image>
|
|
|
+ <view v-else class="chuanda">
|
|
|
+ <view class="text-white text-size-lg">{{tianqiList.city}}市</view>
|
|
|
+ <view class="text-size-lg mt-15 text-weight-b" style="color: #FFCC00;">{{tianqiList.temp}}°C</view>
|
|
|
+ <view class="text-white text-size-lg mt-15">{{tianqiList.weather}}</view>
|
|
|
+ <view class="text-gray text-size-lg mt-10">最低{{tianqiList.templow}}°c 最高{{tianqiList.temphigh}}°c</view>
|
|
|
+ </view>
|
|
|
<view class="mt-20 text-align-center">
|
|
|
<image class="taiyang" src="/static/img/106.png" mode="widthFix"></image>
|
|
|
- <text class="text-size-s ml-15">16°c~20°c</text>
|
|
|
- <text class="text-size-s ml-15">星期一</text>
|
|
|
+ <text class="text-size-s ml-15">{{tianqiList.templow}}°c~{{tianqiList.temphigh}}°c</text>
|
|
|
+ <text class="text-size-s ml-15">{{tianqiList.week}}</text>
|
|
|
</view>
|
|
|
- <view class="bianji" @click="bianji()">更换穿搭</view>
|
|
|
+ <view class="bianji" @click="bianji(1)">{{alltouList[0].image?'更换穿搭':'添加穿搭'}}</view>
|
|
|
</view>
|
|
|
- <view class="scroll-view-item_H">
|
|
|
- <view class="chuanda">
|
|
|
- <view class="text-white text-size-lg">南京市</view>
|
|
|
- <view class="text-size-lg mt-15 text-weight-b" style="color: #FFCC00;">8°C</view>
|
|
|
- <view class="text-white text-size-lg mt-15">局部地区降雨</view>
|
|
|
- <view class="text-gray text-size-lg mt-10">最低0°c 最高9°c</view>
|
|
|
+ <view class="scroll-view-item_H" v-if="alltouList.length !=0">
|
|
|
+ <image v-if="alltouList.length>1" class="chuanda" :src="alltouList[0].image"></image>
|
|
|
+ <view v-else class="chuanda">
|
|
|
+ <view class="text-white text-size-lg">{{tianqiList.city}}市</view>
|
|
|
+ <view class="text-size-lg mt-15 text-weight-b" style="color: #FFCC00;">{{tianqiList.daily[1].day.temphigh}}°C</view>
|
|
|
+ <view class="text-white text-size-lg mt-15">{{tianqiList.daily[1].day.weather}}</view>
|
|
|
+ <view class="text-gray text-size-lg mt-10">{{tianqiList.daily[1].day.winddirect}} {{tianqiList.daily[1].day.windpower}}°c</view>
|
|
|
+ </view>
|
|
|
+ <view class="mt-20 text-align-center">
|
|
|
+ <image class="taiyang" src="/static/img/106.png" mode="widthFix"></image>
|
|
|
+ <text class="text-size-s ml-15">最高温度{{tianqiList.daily[1].day.temphigh}}°C</text>
|
|
|
+ <text class="text-size-s ml-15">{{tianqiList.daily[1].week}}</text>
|
|
|
</view>
|
|
|
+ <view class="bianji" @click="bianji(2)">{{alltouList[1].image?'更换穿搭':'添加穿搭'}}</view>
|
|
|
+ </view>
|
|
|
+ <!-- <view class="scroll-view-item_H">
|
|
|
+
|
|
|
<view class="mt-20 text-align-center">
|
|
|
<image class="taiyang" src="/static/img/106.png" mode="widthFix"></image>
|
|
|
<text class="text-size-s ml-15">16°c~20°c</text>
|
|
|
<text class="text-size-s ml-15">星期一</text>
|
|
|
</view>
|
|
|
- <view class="bianji" @click="bianji()">添加穿搭</view>
|
|
|
- </view>
|
|
|
+ <view class="bianji" @click="bianji(2)">添加穿搭</view>
|
|
|
+ </view> -->
|
|
|
<!-- <view class="scroll-view-item_H">
|
|
|
<image class="chuanda" src="/static/img/107.png" mode="widthFix"></image>
|
|
|
<view class="mt-20 text-align-center">
|
|
@@ -44,7 +60,7 @@
|
|
|
<!-- 衣橱 -->
|
|
|
<tm-sheet class="yichu" style="margin-bottom: 40px !important;">
|
|
|
<tm-tabs @change="fenlei" class="C1b1b1b qiehuan" color="white" align="left" v-model="activeIndex1" :list="listfl" range-key="title"></tm-tabs>
|
|
|
- <view class="yiguicla black pa-6 ma-4 fl" v-for="(item,index) in quanbuList" @click="zidingyibianji()">
|
|
|
+ <view class="yiguicla black pa-6 ma-4 fl" v-for="(item,index) in quanbuList" @click="zidingyibianji(item)">
|
|
|
<image :src="item.image" mode="widthFix"></image>
|
|
|
<view class="text-size-m mt-20 mb-20 ml-10">{{item.title}}</view>
|
|
|
</view>
|
|
@@ -72,23 +88,71 @@ export default {
|
|
|
quanbuList:[],
|
|
|
chooseindex:-1,
|
|
|
listfl:[],
|
|
|
- listflall:[]
|
|
|
-
|
|
|
+ listflall:[],
|
|
|
+ alltouList:[],
|
|
|
+ tianqiList:[]
|
|
|
};
|
|
|
},
|
|
|
- onLoad() {
|
|
|
+ onLoad(e) {
|
|
|
|
|
|
},
|
|
|
created() {
|
|
|
this.sys = uni.getSystemInfoSync();
|
|
|
this.gettianqi();
|
|
|
this.getFl();
|
|
|
+ this.touFun();
|
|
|
},
|
|
|
methods: {
|
|
|
+ shuaxin(){
|
|
|
+ this.getFl();
|
|
|
+ this.touFun();
|
|
|
+ },
|
|
|
fenlei(e){
|
|
|
var id=this.listflall[e].id;
|
|
|
this.getKxuan(id)
|
|
|
},
|
|
|
+ touFun(){
|
|
|
+ var that=this;
|
|
|
+ myRequest({
|
|
|
+ url: "/api/Collocation/selectStyle",
|
|
|
+ method:'post',
|
|
|
+ data:{}
|
|
|
+ }).then(res => {
|
|
|
+ if (res.data.code == 200) {
|
|
|
+ var dataList=res.data.data;
|
|
|
+ console.log(dataList.length)
|
|
|
+ if(dataList.length==0){
|
|
|
+ that.alltouList[0]={data:[]}
|
|
|
+ that.alltouList[1]={data:[]}
|
|
|
+ }else if(dataList.length==1){
|
|
|
+ for(let i=0;i<dataList.length;i++){
|
|
|
+ if(dataList[i].type==1){
|
|
|
+ that.alltouList[0]=dataList[i].makeAppointmentCollocation
|
|
|
+ }else{
|
|
|
+ that.alltouList[0]={data:[]}
|
|
|
+ }
|
|
|
+ if(dataList[i].type==2){
|
|
|
+ that.alltouList[1]=dataList[i].makeAppointmentCollocation
|
|
|
+ }else{
|
|
|
+ that.alltouList[1]={data:[]}
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ for(let i=0;i<dataList.length;i++){
|
|
|
+ if(dataList[i].type==1){
|
|
|
+ that.alltouList[0]=dataList[i].makeAppointmentCollocation
|
|
|
+ }
|
|
|
+ if(dataList[i].type==2){
|
|
|
+ that.alltouList[1]=dataList[i].makeAppointmentCollocation
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ console.log(that.alltouList)
|
|
|
+ }else{
|
|
|
+ that.listtoubu=[];
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
getFl(){
|
|
|
var that=this;
|
|
|
myRequest({
|
|
@@ -147,7 +211,7 @@ export default {
|
|
|
// }
|
|
|
// });
|
|
|
uni.request({
|
|
|
- url: "https://jisutqybmf.market.alicloudapi.com/weather/query",
|
|
|
+ url: "https://jisuqgtq.market.alicloudapi.com/weather/query",
|
|
|
method: "get",
|
|
|
header: {
|
|
|
'Authorization':'APPCODE e4b9accfb1f246cb8c0766a54efe8730'
|
|
@@ -157,22 +221,36 @@ export default {
|
|
|
},
|
|
|
dataType:'json',
|
|
|
success : function(data) {
|
|
|
-
|
|
|
+ console.log(data.data.result)
|
|
|
+ that.tianqiList=data.data.result;
|
|
|
},
|
|
|
error : function(e) {
|
|
|
alert("网络异常,请重试");
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
- bianji(){
|
|
|
+ bianji(type){
|
|
|
+ console.log(type)
|
|
|
uni.navigateTo({
|
|
|
- url: "/pages/bianjigh/index",
|
|
|
+ url: "/pages/bianjigh/index?type="+type,
|
|
|
})
|
|
|
},
|
|
|
- zidingyibianji(){
|
|
|
- uni.navigateTo({
|
|
|
- url: "/pages/zidingyi/index?type=1",
|
|
|
- })
|
|
|
+ zidingyibianji(item){
|
|
|
+ console.log(item)
|
|
|
+ if(item.type==2){
|
|
|
+ // 衣橱
|
|
|
+ uni.navigateTo({
|
|
|
+ url: "/pages/baocun/index?id="+item.id+"&type=2",
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ // 大数据推荐1
|
|
|
+ uni.navigateTo({
|
|
|
+ url: "/pages/zidingyikan/index?id="+item.id+"&type=2",
|
|
|
+ })
|
|
|
+ }
|
|
|
+ // uni.navigateTo({
|
|
|
+ // url: "/pages/zidingyi/index?type=1",
|
|
|
+ // })
|
|
|
},
|
|
|
dapei(){
|
|
|
uni.navigateTo({
|