正在显示
14 个修改的文件
包含
811 行增加
和
427 行删除
@@ -6,7 +6,7 @@ | @@ -6,7 +6,7 @@ | ||
6 | <view class="addimg"> | 6 | <view class="addimg"> |
7 | <image src="../../static/weizhi.png" mode=""></image> | 7 | <image src="../../static/weizhi.png" mode=""></image> |
8 | </view> | 8 | </view> |
9 | - <view class="addname">天津</view> | 9 | + <view class="addname">{{provincename}}</view> |
10 | </view> | 10 | </view> |
11 | <view class="navmiddle flexone" @click="search"> | 11 | <view class="navmiddle flexone" @click="search"> |
12 | <view class="middleleft"> | 12 | <view class="middleleft"> |
@@ -202,7 +202,8 @@ | @@ -202,7 +202,8 @@ | ||
202 | order: '', | 202 | order: '', |
203 | page: 1, | 203 | page: 1, |
204 | shoplist: [], | 204 | shoplist: [], |
205 | - carttotal:'' | 205 | + carttotal:'', |
206 | + provincename:'' | ||
206 | } | 207 | } |
207 | }, | 208 | }, |
208 | onLoad() { | 209 | onLoad() { |
@@ -214,6 +215,54 @@ | @@ -214,6 +215,54 @@ | ||
214 | }, | 215 | }, |
215 | methods: { | 216 | methods: { |
216 | 217 | ||
218 | + getlocation() { | ||
219 | + let that=this; | ||
220 | + uni.getLocation({ | ||
221 | + type: 'wgs84', | ||
222 | + success: function(res) { | ||
223 | + console.log('当前位置的经度:' + res.longitude); | ||
224 | + console.log('当前位置的纬度:' + res.latitude); | ||
225 | + uni.setStorageSync("longitude",res.longitude); | ||
226 | + uni.setStorageSync("latitude",res.longitude) | ||
227 | + var point = new plus.maps.Point(res.longitude, res.latitude); | ||
228 | + plus.maps.Map.reverseGeocode( | ||
229 | + point, {}, | ||
230 | + function(event) { | ||
231 | + console.log(event) | ||
232 | + var address = event.address; // 转换后的地理位置 | ||
233 | + var point = event.coord; // 转换后的坐标信息 | ||
234 | + var coordType = event.coordType; // 转换后的坐标系类型 | ||
235 | + console.log(address, 'address'); | ||
236 | + var reg = /.+?(省|市|自治区|自治州|县|区)/g; | ||
237 | + console.log(address.match(reg)); | ||
238 | + var addressname=address.match(reg); | ||
239 | + console.log(addressname); | ||
240 | + | ||
241 | + if(uni.getStorageSync("provincename")==''){ | ||
242 | + that.provincename=addressname[0]; | ||
243 | + uni.setStorageSync("provincename",that.provincename) | ||
244 | + }else{ | ||
245 | + that.provincename=uni.getStorageSync("provincename") | ||
246 | + } | ||
247 | + | ||
248 | + console.log(that.provincename) | ||
249 | + // that.getprovinceid() | ||
250 | + | ||
251 | + // _this.addressList = address.match(reg).toString().split(","); | ||
252 | + // _this.address = _this.addressList[1]; | ||
253 | + // console.log(_this.addressList[0]); | ||
254 | + // console.log(_this.addressList[1]); | ||
255 | + // console.log(_this.addressList[2]); | ||
256 | + | ||
257 | + }, | ||
258 | + function(e) {} | ||
259 | + ); | ||
260 | + } | ||
261 | + }); | ||
262 | + }, | ||
263 | + | ||
264 | + | ||
265 | + | ||
217 | // 获取购物车气泡 | 266 | // 获取购物车气泡 |
218 | getcartnum(){ | 267 | getcartnum(){ |
219 | let that = this; | 268 | let that = this; |
@@ -334,6 +383,9 @@ | @@ -334,6 +383,9 @@ | ||
334 | }) | 383 | }) |
335 | } | 384 | } |
336 | }, | 385 | }, |
386 | + }, | ||
387 | + onShow(){ | ||
388 | + this.getlocation() | ||
337 | } | 389 | } |
338 | 390 | ||
339 | } | 391 | } |
@@ -3,82 +3,81 @@ | @@ -3,82 +3,81 @@ | ||
3 | <view class="texttitle"> | 3 | <view class="texttitle"> |
4 | {{present_data.question_name}}({{present_data.type==1?'单选':'多选'}}) | 4 | {{present_data.question_name}}({{present_data.type==1?'单选':'多选'}}) |
5 | </view> | 5 | </view> |
6 | - <view class="textlist"> | ||
7 | - <view class='textitem flex' :class="item.answer==1&&item.chose==true?'selright':item.answer==2&&item.chose==true?'selwrong flextwo':''" v-for="(item,index) in present_data.option" :key="index" @click="present_data.canchose==present_data.correct_number?selchose(index):''"> | 6 | + <view class="textlist" v-if="issure"> |
7 | + <view class='textitem flex' :class="item.chose==true?'selright':''" v-for="(item,index) in present_data.option" :key="index" @click="selchose(index)"> | ||
8 | <view class="flex"> | 8 | <view class="flex"> |
9 | <view class="textitemleft" > | 9 | <view class="textitemleft" > |
10 | - <image src="../../static/meisel.png" mode=""></image> | 10 | + <image src="../../static/selright.png" mode="" v-if="item.chose==true"></image> |
11 | + <image src="../../static/meisel.png" mode="" v-else></image> | ||
11 | </view> | 12 | </view> |
12 | <view class="textitemright"> | 13 | <view class="textitemright"> |
13 | {{item.sel}}、{{item.option_name}} | 14 | {{item.sel}}、{{item.option_name}} |
14 | </view> | 15 | </view> |
15 | </view> | 16 | </view> |
16 | - | ||
17 | - <view class="wrongimg" v-if="item.answer==2&&item.chose==true"> | 17 | + <!-- <view class="wrongimg" v-if="item.answer==2&&item.chose==true"> |
18 | <image src="../../static/wrong.png" mode=""></image> | 18 | <image src="../../static/wrong.png" mode=""></image> |
19 | - </view> | 19 | + </view> --> |
20 | </view> | 20 | </view> |
21 | - <!-- <view class='textitem flex selright'> | ||
22 | - <view class="textitemleft"> | ||
23 | - <image src="../../static/selright.png" mode=""></image> | ||
24 | - </view> | ||
25 | - <view class="textitemright"> | ||
26 | - A、6 | ||
27 | - </view> | ||
28 | - </view> | ||
29 | - <view class='textitem flextwo selwrong'> | 21 | + </view> |
22 | + <view class="textlist" v-else> | ||
23 | + <view class='textitem flex' :class="item.answer==1&&item.chose==true?'selright':item.answer==2&&item.chose==true?'selwrong flextwo':''" v-for="(item,index) in present_data.option" :key="index" > | ||
30 | <view class="flex"> | 24 | <view class="flex"> |
31 | - <view class="textitemleft"> | ||
32 | - <image src="../../static/slewrong.png" mode=""></image> | 25 | + <view class="textitemleft" > |
26 | + <image src="../../static/selright.png" mode="" v-if="item.answer==1&&item.chose==true"></image> | ||
27 | + <image src="../../static/wrong.png" mode="" v-else-if="item.answer==2&&item.chose==true"></image> | ||
28 | + <image src="../../static/meisel.png" mode="" v-else></image> | ||
33 | </view> | 29 | </view> |
34 | <view class="textitemright"> | 30 | <view class="textitemright"> |
35 | - A、6 | 31 | + {{item.sel}}、{{item.option_name}} |
36 | </view> | 32 | </view> |
37 | </view> | 33 | </view> |
38 | - | ||
39 | - <view class="wrongimg"> | 34 | + <view class="wrongimg" v-if="item.answer==2&&item.chose==true"> |
40 | <image src="../../static/wrong.png" mode=""></image> | 35 | <image src="../../static/wrong.png" mode=""></image> |
41 | </view> | 36 | </view> |
42 | </view> | 37 | </view> |
43 | - <view class='textitem flexone'> | ||
44 | - <view class="textitemleft"> | ||
45 | - <image src="../../static/meisel.png" mode=""></image> | ||
46 | - </view> | ||
47 | - <view class="textitemright"> | ||
48 | - A、6 | ||
49 | - </view> | ||
50 | - </view> --> | ||
51 | </view> | 38 | </view> |
52 | - | ||
53 | - | ||
54 | <view class="huiyuanbot boxsizing"> | 39 | <view class="huiyuanbot boxsizing"> |
40 | + <!-- v-if="next_data!=''&&last_data==''" --> | ||
41 | + <!-- <view class="behuiyuanbtn" v-if="issure" @click="next_data==''?sureti:sure">确认{{next_data==''?'1':'2'}}</view> --> | ||
42 | + <view v-if="issure"> | ||
43 | + <view class="behuiyuanbtn" @click="sureti">确认</view> | ||
44 | + <!-- <view class="behuiyuanbtn" @click="sure" v-else>确认</view> --> | ||
45 | + </view> | ||
46 | + <view v-else> | ||
47 | + <view class="behuiyuanbtn" @click="nextquestion" v-if="next_data!=''">下一题</view> | ||
48 | + <view class="behuiyuanbtn" @click="sure" v-else>完成</view> | ||
49 | + </view> | ||
50 | + | ||
51 | + <!-- <view v-else> | ||
52 | + <view class="behuiyuanbtn" @click="nextquestion" v-if="next_data!=''">下一题</view> | ||
53 | + | ||
54 | + </view> --> | ||
55 | 55 | ||
56 | - <view class="behuiyuanbtn" v-if="next_data!=''&&last_data==''" @click="nextquestion">下一题</view> | ||
57 | - <view class="flextwo" v-else-if="last_data!=''"> | 56 | + <!-- <view class="flextwo" v-else-if="last_data!=''&&next_data!==''"> |
58 | <view class="behuiyuanbtn btnitem" @click="prequestion">上一题</view> | 57 | <view class="behuiyuanbtn btnitem" @click="prequestion">上一题</view> |
59 | <view class="behuiyuanbtn btnitem" @click="nextquestion">下一题</view> | 58 | <view class="behuiyuanbtn btnitem" @click="nextquestion">下一题</view> |
60 | - </view> | ||
61 | - | ||
62 | - <view class="behuiyuanbtn" v-else @click="sure">确认</view> | 59 | + </view> --> |
60 | + <!-- v-else --> | ||
63 | </view> | 61 | </view> |
64 | </view> | 62 | </view> |
65 | </template> | 63 | </template> |
66 | - | ||
67 | <script> | 64 | <script> |
68 | import app from "../../App.vue"; | 65 | import app from "../../App.vue"; |
69 | export default { | 66 | export default { |
70 | data() { | 67 | data() { |
71 | return { | 68 | return { |
72 | questionnaire_id: '', | 69 | questionnaire_id: '', |
73 | - present_data: [], | ||
74 | - last_data: [], | ||
75 | - next_data: [], | 70 | + present_data: '', |
71 | + last_data: '', | ||
72 | + next_data: '', | ||
76 | question_id:'', | 73 | question_id:'', |
77 | score:0, | 74 | score:0, |
78 | selitem:0, | 75 | selitem:0, |
79 | //是否在上一题返回的下一题 | 76 | //是否在上一题返回的下一题 |
80 | islast:0, | 77 | islast:0, |
81 | - | 78 | + present_datakarr:[], |
79 | + issure:true | ||
80 | + | ||
82 | } | 81 | } |
83 | }, | 82 | }, |
84 | onLoad(options) { | 83 | onLoad(options) { |
@@ -90,18 +89,16 @@ | @@ -90,18 +89,16 @@ | ||
90 | methods: { | 89 | methods: { |
91 | getqusetion() { | 90 | getqusetion() { |
92 | let that = this; | 91 | let that = this; |
93 | - | ||
94 | var url = 'question/get_question'; | 92 | var url = 'question/get_question'; |
95 | var params = { | 93 | var params = { |
96 | questionnaire_id: that.questionnaire_id, | 94 | questionnaire_id: that.questionnaire_id, |
97 | question_id:that.question_id | 95 | question_id:that.question_id |
98 | } | 96 | } |
99 | - | ||
100 | console.log(params) | 97 | console.log(params) |
101 | app.post(url, params, "post").then((res) => { | 98 | app.post(url, params, "post").then((res) => { |
102 | console.log(res); | 99 | console.log(res); |
103 | that.present_data = res.data.data.present_data; | 100 | that.present_data = res.data.data.present_data; |
104 | - that.present_data.canchose=that.present_data.correct_number; | 101 | + that.present_data.canchose=0; |
105 | that.present_data.option.forEach(function(value, index, array) { | 102 | that.present_data.option.forEach(function(value, index, array) { |
106 | value.chose=false; | 103 | value.chose=false; |
107 | switch (index) { | 104 | switch (index) { |
@@ -116,74 +113,137 @@ | @@ -116,74 +113,137 @@ | ||
116 | break; | 113 | break; |
117 | case 3: | 114 | case 3: |
118 | value.sel = 'D'; | 115 | value.sel = 'D'; |
119 | - break; | 116 | + break; |
120 | } | 117 | } |
121 | - | ||
122 | }) | 118 | }) |
123 | that.present_data = that.present_data; | 119 | that.present_data = that.present_data; |
124 | that.last_data = res.data.data.last_data; | 120 | that.last_data = res.data.data.last_data; |
125 | that.next_data = res.data.data.next_data; | 121 | that.next_data = res.data.data.next_data; |
122 | + // 查看题目答案是否正确 | ||
123 | + let newpresent_datakarr=uni.getStorageSync("present_datakarr"); | ||
124 | + console.log(newpresent_datakarr) | ||
125 | + newpresent_datakarr.forEach(function(value,index,array){ | ||
126 | + // console.log(348934,value) | ||
127 | + // console.log('1111',that.present_data) | ||
128 | + if(value.id==that.present_data.id){ | ||
129 | + that.present_data=value; | ||
130 | + // console.log(that.present_data) | ||
131 | + } | ||
132 | + }) | ||
126 | }).catch((err) => { | 133 | }).catch((err) => { |
127 | console.log(err) | 134 | console.log(err) |
128 | 135 | ||
129 | }) | 136 | }) |
130 | }, | 137 | }, |
131 | // 选择题目 | 138 | // 选择题目 |
132 | - | ||
133 | selchose(index){ | 139 | selchose(index){ |
134 | let that=this; | 140 | let that=this; |
135 | that.selitem++; | 141 | that.selitem++; |
136 | that.present_data.canchose++; | 142 | that.present_data.canchose++; |
143 | + console.log('选中的题数',that.present_data.canchose) | ||
137 | that.present_data.option.forEach(function(value,indexk,array){ | 144 | that.present_data.option.forEach(function(value,indexk,array){ |
138 | - if(index==indexk){ | ||
139 | - value.chose=true; | ||
140 | - // value.canchose++; | ||
141 | - that.$forceUpdate() | 145 | + if(that.present_data.correct_number==1){ |
146 | + if(index==indexk){ | ||
147 | + value.chose=true; | ||
148 | + // value.canchose++; | ||
149 | + that.$forceUpdate(); | ||
150 | + }else{ | ||
151 | + value.chose=false; | ||
152 | + that.$forceUpdate(); | ||
153 | + } | ||
154 | + }else{ | ||
155 | + if(index==indexk){ | ||
156 | + value.chose=true; | ||
157 | + that.$forceUpdate(); | ||
158 | + } | ||
159 | + | ||
142 | } | 160 | } |
161 | + | ||
143 | }) | 162 | }) |
144 | - | ||
145 | that.present_data=that.present_data; | 163 | that.present_data=that.present_data; |
146 | - that.score=that.score+that.present_data.score; | 164 | + if(that.present_data.correct_number==1){ |
165 | + that.present_data.option.forEach(function(value,index,array){ | ||
166 | + if(value.chose==true&&value.answer==1){ | ||
167 | + that.score=that.score+that.present_data.score; | ||
168 | + } | ||
169 | + }) | ||
170 | + }else{ | ||
171 | + let arr=[] | ||
172 | + that.present_data.option.forEach(function(value,index,array){ | ||
173 | + if(value.chose==true&&value.answer==1){ | ||
174 | + arr.push(1) | ||
175 | + } | ||
176 | + if(arr.length==that.present_data.correct_number){ | ||
177 | + that.score=that.score+that.present_data.score; | ||
178 | + } | ||
179 | + }) | ||
180 | + } | ||
181 | + | ||
182 | + console.log(that.present_data) | ||
183 | + console.log('考试得分',that.score) | ||
147 | uni.setStorageSync("present_datak",that.present_data); | 184 | uni.setStorageSync("present_datak",that.present_data); |
148 | uni.setStorageSync("last_datak",that.last_data); | 185 | uni.setStorageSync("last_datak",that.last_data); |
149 | uni.setStorageSync("next_datak",that.next_data); | 186 | uni.setStorageSync("next_datak",that.next_data); |
187 | + this.present_datakarr.push(this.present_data); | ||
188 | + | ||
189 | + // console.log(this.present_datakarr) | ||
190 | + uni.setStorageSync("present_datakarr",this.present_datakarr); | ||
191 | + console.log('xiaadsk',that.next_data) | ||
150 | }, | 192 | }, |
151 | //下一题 | 193 | //下一题 |
152 | nextquestion(){ | 194 | nextquestion(){ |
153 | let that=this; | 195 | let that=this; |
154 | - // this.question_id=this.present_data.id; | ||
155 | - this.question_id=2; | 196 | + this.question_id=this.next_data.id; |
197 | + console.log('判断是否答题',that.selitem); | ||
198 | + // 判断是否答题 | ||
156 | if(that.selitem==0){ | 199 | if(that.selitem==0){ |
157 | uni.showToast({ | 200 | uni.showToast({ |
158 | title:"请答题", | 201 | title:"请答题", |
159 | icon:"none" | 202 | icon:"none" |
160 | }) | 203 | }) |
161 | }else{ | 204 | }else{ |
162 | - uni.setStorageSync("present_data",that.present_data); | ||
163 | - uni.setStorageSync("last_data",that.last_data); | ||
164 | - uni.setStorageSync("next_data",that.next_data); | ||
165 | - that.selitem==0; | ||
166 | - if(that.islast==1){ | ||
167 | - that.islast=0 | ||
168 | - this.present_data=uni.getStorageSync("present_datak"); | ||
169 | - this.last_data=uni.getStorageSync("last_datak"); | ||
170 | - this.next_data=uni.getStorageSync("next_datak"); | ||
171 | - }else{ | ||
172 | - this.getqusetion(); | ||
173 | - } | 205 | + that.selitem=0; |
206 | + that.getqusetion(); | ||
207 | + that.issure=true | ||
208 | + // uni.setStorageSync("present_data",that.present_data); | ||
209 | + // uni.setStorageSync("last_data",that.last_data); | ||
210 | + // uni.setStorageSync("next_data",that.next_data); | ||
211 | + | ||
212 | + // // 判断是否是在上一题过来的 | ||
213 | + // if(that.islast==1){ | ||
214 | + | ||
215 | + // that.islast=0 | ||
216 | + // this.present_data=uni.getStorageSync("present_datak"); | ||
217 | + // that.present_data.canchose=that.present_data.correct_number; | ||
218 | + // console.log('dangqian',this.present_data.canchose) | ||
219 | + // this.last_data=uni.getStorageSync("last_datak"); | ||
220 | + // this.next_data=uni.getStorageSync("next_datak"); | ||
221 | + // }else{ | ||
222 | + // that.selitem=0; | ||
223 | + // this.getqusetion(); | ||
224 | + // } | ||
174 | 225 | ||
175 | } | 226 | } |
176 | 227 | ||
177 | }, | 228 | }, |
178 | // 上一题 | 229 | // 上一题 |
179 | prequestion(){ | 230 | prequestion(){ |
180 | - this.present_data=uni.getStorageSync("present_data"); | ||
181 | - this.last_data=uni.getStorageSync("last_data"); | ||
182 | - this.next_data=uni.getStorageSync("next_data"); | 231 | + // this.present_data=uni.getStorageSync("present_data"); |
232 | + // this.last_data=uni.getStorageSync("last_data"); | ||
233 | + // this.next_data=uni.getStorageSync("next_data"); | ||
183 | 234 | ||
184 | - this.islast=1 | 235 | + this.question_id=this.last_data.id; |
236 | + this.islast=1; | ||
237 | + this.getqusetion(); | ||
185 | 238 | ||
186 | }, | 239 | }, |
240 | + | ||
241 | + sureti(){ | ||
242 | + console.log(343348989) | ||
243 | + this.issure=false | ||
244 | + this.question_id=this.present_data.id; | ||
245 | + this.getqusetion() | ||
246 | + }, | ||
187 | sure(){ | 247 | sure(){ |
188 | let that = this; | 248 | let that = this; |
189 | var url = 'question/submit_answer'; | 249 | var url = 'question/submit_answer'; |
@@ -211,6 +271,9 @@ | @@ -211,6 +271,9 @@ | ||
211 | } | 271 | } |
212 | 272 | ||
213 | 273 | ||
274 | + }, | ||
275 | + onShow(){ | ||
276 | + uni.setStorageSync("present_datakarr","") | ||
214 | } | 277 | } |
215 | 278 | ||
216 | } | 279 | } |
@@ -13,14 +13,14 @@ | @@ -13,14 +13,14 @@ | ||
13 | 北京 | 13 | 北京 |
14 | <image src="../../static/huixia.png" /> | 14 | <image src="../../static/huixia.png" /> |
15 | </view> --> | 15 | </view> --> |
16 | - <view class="proselect flexthree" @click="selprovince"> | ||
17 | - <text class="proname">{{provincename}}</text> | ||
18 | - <image class="down-ico" src="../../static/huixia.png" /> | ||
19 | - </view> | ||
20 | - <!-- picker @change="bindproChange" :value="index" :range="provincelist" range-key="name"> | ||
21 | - | ||
22 | 16 | ||
23 | - </picker> --> | 17 | + <picker @change="bindproChange" :value="index" :range="provincelist" range-key="name"> |
18 | + <!-- <view class="uni-input">{{array[index]}}</view> --> | ||
19 | + <view class="proselect flexthree"> | ||
20 | + <text class="proname">{{provincename}}</text> | ||
21 | + <image class="down-ico" src="../../static/huixia.png" /> | ||
22 | + </view> | ||
23 | + </picker> | ||
24 | </view> | 24 | </view> |
25 | <!-- nav --> | 25 | <!-- nav --> |
26 | <view class="nav-menus"> | 26 | <view class="nav-menus"> |
@@ -72,8 +72,8 @@ | @@ -72,8 +72,8 @@ | ||
72 | <!-- 点赞, 人数 --> | 72 | <!-- 点赞, 人数 --> |
73 | <view class="thumbs-number" @click.stop="praisedian(item,index)"> | 73 | <view class="thumbs-number" @click.stop="praisedian(item,index)"> |
74 | <view class="thumbs"> | 74 | <view class="thumbs"> |
75 | - <image src="../../static/tienozan.png" v-if="item.is_praise==2"></image> | ||
76 | - <image src="../../static/tiezan.png" v-else></image> | 75 | + <image src="../../static/tienozan.png" v-if="item.is_praise==2"></image> |
76 | + <image src="../../static/tiezan.png" v-else></image> | ||
77 | {{item.praise}} | 77 | {{item.praise}} |
78 | </view> | 78 | </view> |
79 | <view class="number"> | 79 | <view class="number"> |
@@ -100,7 +100,7 @@ | @@ -100,7 +100,7 @@ | ||
100 | showbanben: false, | 100 | showbanben: false, |
101 | kindtype: '', | 101 | kindtype: '', |
102 | provincelist: [], | 102 | provincelist: [], |
103 | - province_id: '', | 103 | + province_id:'', |
104 | provincename: '', | 104 | provincename: '', |
105 | index: 0, | 105 | index: 0, |
106 | keyword: '', | 106 | keyword: '', |
@@ -109,8 +109,7 @@ | @@ -109,8 +109,7 @@ | ||
109 | }, | 109 | }, |
110 | onLoad(options) { | 110 | onLoad(options) { |
111 | this.kindtype = options.id; | 111 | this.kindtype = options.id; |
112 | - this.getprovincelist(); | ||
113 | - uni.setStorageSync("provincename", "") | 112 | + this.getprovincelist() |
114 | }, | 113 | }, |
115 | methods: { | 114 | methods: { |
116 | kindchange(e) { | 115 | kindchange(e) { |
@@ -119,70 +118,6 @@ | @@ -119,70 +118,6 @@ | ||
119 | this.luntanlist = []; | 118 | this.luntanlist = []; |
120 | this.getluntanlist() | 119 | this.getluntanlist() |
121 | }, | 120 | }, |
122 | - selprovince() { | ||
123 | - uni.navigateTo({ | ||
124 | - url: '/pages/nearshop/allprovince' | ||
125 | - }) | ||
126 | - }, | ||
127 | - getlocation() { | ||
128 | - let that = this; | ||
129 | - uni.getLocation({ | ||
130 | - type: 'wgs84', | ||
131 | - success: function(res) { | ||
132 | - console.log('当前位置的经度:' + res.longitude); | ||
133 | - console.log('当前位置的纬度:' + res.latitude); | ||
134 | - var point = new plus.maps.Point(res.longitude, res.latitude); | ||
135 | - plus.maps.Map.reverseGeocode( | ||
136 | - point, {}, | ||
137 | - function(event) { | ||
138 | - console.log(event) | ||
139 | - var address = event.address; // 转换后的地理位置 | ||
140 | - var point = event.coord; // 转换后的坐标信息 | ||
141 | - var coordType = event.coordType; // 转换后的坐标系类型 | ||
142 | - console.log(address, 'address'); | ||
143 | - var reg = /.+?(省|市|自治区|自治州|县|区)/g; | ||
144 | - console.log(address.match(reg)); | ||
145 | - var addressname = address.match(reg); | ||
146 | - console.log(addressname); | ||
147 | - | ||
148 | - if (uni.getStorageSync("provincename") == '') { | ||
149 | - that.provincename = addressname[0]; | ||
150 | - uni.setStorageSync("provincename", that.provincename) | ||
151 | - } else { | ||
152 | - that.provincename = uni.getStorageSync("provincename") | ||
153 | - } | ||
154 | - | ||
155 | - console.log(that.provincename) | ||
156 | - // that.getprovinceid() | ||
157 | - | ||
158 | - // _this.addressList = address.match(reg).toString().split(","); | ||
159 | - // _this.address = _this.addressList[1]; | ||
160 | - // console.log(_this.addressList[0]); | ||
161 | - // console.log(_this.addressList[1]); | ||
162 | - // console.log(_this.addressList[2]); | ||
163 | - | ||
164 | - }, | ||
165 | - function(e) {} | ||
166 | - ); | ||
167 | - } | ||
168 | - }); | ||
169 | - }, | ||
170 | - // 根据城市名字获取id | ||
171 | - getprovinceid() { | ||
172 | - let that = this; | ||
173 | - var url = 'question/get_area'; | ||
174 | - var params = { | ||
175 | - province_name: that.provincename | ||
176 | - } | ||
177 | - console.log('7766554', params) | ||
178 | - app.post(url, params).then((res) => { | ||
179 | - console.log(res); | ||
180 | - | ||
181 | - }).catch((err) => { | ||
182 | - console.log(err) | ||
183 | - | ||
184 | - }) | ||
185 | - }, | ||
186 | 121 | ||
187 | // 输入完成 | 122 | // 输入完成 |
188 | finish() { | 123 | finish() { |
@@ -195,7 +130,6 @@ | @@ -195,7 +130,6 @@ | ||
195 | enterword(e) { | 130 | enterword(e) { |
196 | this.keyword = e.detail.value | 131 | this.keyword = e.detail.value |
197 | }, | 132 | }, |
198 | - | ||
199 | // 获取省份列表 | 133 | // 获取省份列表 |
200 | getprovincelist() { | 134 | getprovincelist() { |
201 | let that = this; | 135 | let that = this; |
@@ -211,7 +145,6 @@ | @@ -211,7 +145,6 @@ | ||
211 | that.province_id = res.data.data[0].id; | 145 | that.province_id = res.data.data[0].id; |
212 | // 获取论坛列表 | 146 | // 获取论坛列表 |
213 | this.getluntanlist() | 147 | this.getluntanlist() |
214 | - | ||
215 | }).catch((err) => { | 148 | }).catch((err) => { |
216 | 149 | ||
217 | }) | 150 | }) |
@@ -223,7 +156,7 @@ | @@ -223,7 +156,7 @@ | ||
223 | this.page = 1; | 156 | this.page = 1; |
224 | this.luntanlist = []; | 157 | this.luntanlist = []; |
225 | // 获取论坛列表 | 158 | // 获取论坛列表 |
226 | - this.getluntanlist(); | 159 | + this.getluntanlist(); |
227 | }, | 160 | }, |
228 | 161 | ||
229 | // 获取论坛列表 | 162 | // 获取论坛列表 |
@@ -249,49 +182,46 @@ | @@ -249,49 +182,46 @@ | ||
249 | 182 | ||
250 | }) | 183 | }) |
251 | }, | 184 | }, |
252 | - praisedian(item, index) { | 185 | + praisedian(item,index){ |
253 | let that = this; | 186 | let that = this; |
254 | - if (that.luntanlist[index].is_praise == 2) { | 187 | + if(that.luntanlist[index].is_praise==2){ |
255 | uni.showToast({ | 188 | uni.showToast({ |
256 | - title: '点赞成功', | ||
257 | - icon: 'none' | 189 | + title:'点赞成功', |
190 | + icon:'none' | ||
258 | }) | 191 | }) |
259 | - that.luntanlist[index].is_praise = 1; | ||
260 | - that.luntanlist[index].praise = that.luntanlist[index].praise + 1 | ||
261 | - } else { | 192 | + that.luntanlist[index].is_praise=1; |
193 | + that.luntanlist[index].praise=that.luntanlist[index].praise+1 | ||
194 | + }else{ | ||
262 | uni.showToast({ | 195 | uni.showToast({ |
263 | - title: '取消点赞成功', | ||
264 | - icon: 'none' | 196 | + title:'取消点赞成功', |
197 | + icon:'none' | ||
265 | }) | 198 | }) |
266 | - that.luntanlist[index].is_praise = 2; | ||
267 | - that.luntanlist[index].praise = that.luntanlist[index].praise - 1 | 199 | + that.luntanlist[index].is_praise=2; |
200 | + that.luntanlist[index].praise=that.luntanlist[index].praise-1 | ||
268 | } | 201 | } |
269 | - | ||
270 | - that.luntanlist = that.luntanlist; | ||
271 | - | 202 | + |
203 | + that.luntanlist=that.luntanlist; | ||
204 | + | ||
272 | var url = 'forum/praise'; | 205 | var url = 'forum/praise'; |
273 | var params = { | 206 | var params = { |
274 | - forum_id: item.id | 207 | + forum_id:item.id |
275 | } | 208 | } |
276 | - console.log('参数', params) | 209 | + console.log('参数',params) |
277 | app.post(url, params).then((res) => { | 210 | app.post(url, params).then((res) => { |
278 | console.log(res); | 211 | console.log(res); |
279 | - | ||
280 | - | ||
281 | - | 212 | + |
213 | + | ||
214 | + | ||
282 | }).catch((err) => { | 215 | }).catch((err) => { |
283 | console.log(err) | 216 | console.log(err) |
284 | - | 217 | + |
285 | }) | 218 | }) |
286 | }, | 219 | }, |
287 | luntandetail(item) { | 220 | luntandetail(item) { |
288 | uni.navigateTo({ | 221 | uni.navigateTo({ |
289 | - url: '/pages/luntan/luntandetail?id=' + item.id | 222 | + url:'/pages/luntan/luntandetail?id='+item.id |
290 | }) | 223 | }) |
291 | } | 224 | } |
292 | - }, | ||
293 | - onShow() { | ||
294 | - this.getlocation() | ||
295 | } | 225 | } |
296 | 226 | ||
297 | } | 227 | } |
@@ -3,19 +3,23 @@ | @@ -3,19 +3,23 @@ | ||
3 | <view class="header"> | 3 | <view class="header"> |
4 | <view class="userinfo"> | 4 | <view class="userinfo"> |
5 | <view class="avator" @click="personziliao"> | 5 | <view class="avator" @click="personziliao"> |
6 | - <image src="../../static/userpic.png" mode="widthFix" /> | 6 | + <image :src="avatar==''?'../../static/headtou.png':avatar" /> |
7 | + <!-- <image src="../../static/userpic.png" mode="widthFix" /> --> | ||
7 | </view> | 8 | </view> |
8 | <view class="infoBox"> | 9 | <view class="infoBox"> |
9 | <view class="identity"> | 10 | <view class="identity"> |
10 | - <view class="name">我是用户昵称</view> | ||
11 | - <text class="vip flexone"> | ||
12 | - <image src="../../static/huiyuan.png" mode="widthFix" /> | ||
13 | - <text class="vipname">VIP5</text> | 11 | + <view class="name" v-if="nickname==''">暂无昵称</view> |
12 | + <view class="name" v-else>{{nickname}}</view> | ||
13 | + <text class="vip flexone" v-if="userinfo.is_card==1||userinfo.is_vip==1||userinfo.is_company_vip==1"> | ||
14 | + <image src="../../static/huiyuan.png" mode="widthFix" v-if="is_card==1"/> | ||
15 | + <text class="vipname" v-if="userinfo.is_vip==1">{{userinfo.level.name1}}</text> | ||
16 | + <text class="vipname" v-if="userinfo.is_company_vip==1">{{userinfo.level.name2}}</text> | ||
14 | </text> | 17 | </text> |
15 | </view> | 18 | </view> |
16 | - <!-- <view class="userType">身份认证 >></view> --> | ||
17 | - <view class="userActive"> | ||
18 | - <image src="../../static/active.png" mode="widthFix" />已认证 | 19 | + <view class="userType" v-if="userinfo.is_card==2">身份认证 >></view> |
20 | + <view class="userActive" v-else> | ||
21 | + <image src="../../static/active.png" mode="widthFix" /> | ||
22 | + 已认证 | ||
19 | </view> | 23 | </view> |
20 | </view> | 24 | </view> |
21 | <view class="setup" @click="set"> | 25 | <view class="setup" @click="set"> |
@@ -23,23 +27,23 @@ | @@ -23,23 +27,23 @@ | ||
23 | </view> | 27 | </view> |
24 | </view> | 28 | </view> |
25 | <view class="orderBox"> | 29 | <view class="orderBox"> |
26 | - <view class="orderItem" @click="fahuo"> | 30 | + <view class="orderItem" @click="fahuo" :data-id="1"> |
27 | <image src="../../static/order_a.png" mode="widthFix"></image> | 31 | <image src="../../static/order_a.png" mode="widthFix"></image> |
28 | <view>待付款</view> | 32 | <view>待付款</view> |
29 | </view> | 33 | </view> |
30 | - <view class="orderItem"> | 34 | + <view class="orderItem" @click="fahuo" :data-id="2"> |
31 | <image src="../../static/order_b.png" mode="widthFix"></image> | 35 | <image src="../../static/order_b.png" mode="widthFix"></image> |
32 | <view>待发货</view> | 36 | <view>待发货</view> |
33 | </view> | 37 | </view> |
34 | - <view class="orderItem"> | 38 | + <view class="orderItem" @click="fahuo" :data-id="3"> |
35 | <image src="../../static/order_c.png" mode="widthFix"></image> | 39 | <image src="../../static/order_c.png" mode="widthFix"></image> |
36 | - <view>配送中</view> | 40 | + <view>待收货</view> |
37 | </view> | 41 | </view> |
38 | - <view class="orderItem"> | 42 | + <view class="orderItem" @click="fahuo" :data-id="4"> |
39 | <image src="../../static/order_d.png" mode="widthFix"></image> | 43 | <image src="../../static/order_d.png" mode="widthFix"></image> |
40 | <view>待评价</view> | 44 | <view>待评价</view> |
41 | </view> | 45 | </view> |
42 | - <view class="orderItem"> | 46 | + <view class="orderItem" @click="fahuo" :data-id="0"> |
43 | <image src="../../static/order_e.png" mode="widthFix"></image> | 47 | <image src="../../static/order_e.png" mode="widthFix"></image> |
44 | <view>全部订单</view> | 48 | <view>全部订单</view> |
45 | </view> | 49 | </view> |
@@ -137,18 +141,23 @@ | @@ -137,18 +141,23 @@ | ||
137 | export default { | 141 | export default { |
138 | data() { | 142 | data() { |
139 | return { | 143 | return { |
140 | - footersel: 4 | 144 | + footersel: 4, |
145 | + userinfo:'', | ||
146 | + nickname:'', | ||
147 | + avatar:'', | ||
148 | + label:'', | ||
149 | + | ||
150 | + | ||
141 | } | 151 | } |
142 | }, | 152 | }, |
143 | onLoad() { | 153 | onLoad() { |
144 | - //获取个人信息 | ||
145 | - this.getuserinfo() | 154 | + |
146 | }, | 155 | }, |
147 | methods: { | 156 | methods: { |
148 | // 设置 | 157 | // 设置 |
149 | set() { | 158 | set() { |
150 | uni.navigateTo({ | 159 | uni.navigateTo({ |
151 | - url: '/pages/usercenter/setUp' | 160 | + url:'/pages/usercenter/setUp?avatar='+this.avatar+'&nickname='+this.nickname |
152 | }) | 161 | }) |
153 | }, | 162 | }, |
154 | // 获取用户信息 | 163 | // 获取用户信息 |
@@ -162,7 +171,9 @@ | @@ -162,7 +171,9 @@ | ||
162 | app.post(url, params).then((res) => { | 171 | app.post(url, params).then((res) => { |
163 | console.log(res); | 172 | console.log(res); |
164 | that.userinfo = res.data.data; | 173 | that.userinfo = res.data.data; |
165 | - that.label = res.data.data.label | 174 | + that.label = res.data.data.label; |
175 | + that.nickname=res.data.data.nickname; | ||
176 | + that.avatar=res.data.data.avatar; | ||
166 | 177 | ||
167 | 178 | ||
168 | }).catch((err) => { | 179 | }).catch((err) => { |
@@ -204,9 +215,13 @@ | @@ -204,9 +215,13 @@ | ||
204 | }, | 215 | }, |
205 | 216 | ||
206 | // 代发货 | 217 | // 代发货 |
207 | - fahuo() { | 218 | + fahuo(e) { |
219 | + let id=e.currentTarget.dataset.id; | ||
220 | + // if(id==0){ | ||
221 | + // id=='' | ||
222 | + // } | ||
208 | uni.navigateTo({ | 223 | uni.navigateTo({ |
209 | - url: '/pages/usercenter/myOrder' | 224 | + url: '/pages/usercenter/myOrder?id='+id |
210 | }) | 225 | }) |
211 | }, | 226 | }, |
212 | // 底部导航跳转 | 227 | // 底部导航跳转 |
@@ -234,10 +249,10 @@ | @@ -234,10 +249,10 @@ | ||
234 | } | 249 | } |
235 | }, | 250 | }, |
236 | 251 | ||
237 | - | ||
238 | - | ||
239 | - | ||
240 | - | 252 | + }, |
253 | + onShow() { | ||
254 | + //获取个人信息 | ||
255 | + this.getuserinfo() | ||
241 | } | 256 | } |
242 | } | 257 | } |
243 | </script> | 258 | </script> |
@@ -265,11 +280,14 @@ | @@ -265,11 +280,14 @@ | ||
265 | .avator { | 280 | .avator { |
266 | width: 128rpx; | 281 | width: 128rpx; |
267 | height: 128rpx; | 282 | height: 128rpx; |
283 | + font-size: 0; | ||
284 | + border-radius: 50%; | ||
268 | border-radius: 64rpx; | 285 | border-radius: 64rpx; |
269 | } | 286 | } |
270 | 287 | ||
271 | .avator image { | 288 | .avator image { |
272 | width: 100%; | 289 | width: 100%; |
290 | + border-radius: 50%; | ||
273 | } | 291 | } |
274 | 292 | ||
275 | .infoBox { | 293 | .infoBox { |
1 | <template> | 1 | <template> |
2 | <view class="page"> | 2 | <view class="page"> |
3 | <view class="navbox"> | 3 | <view class="navbox"> |
4 | - <view class="navItem navactive"> | 4 | + <view class="navItem" :class="selindx==0?'navactive':''" @click="changeopt" :data-id="0"> |
5 | 全部订单 | 5 | 全部订单 |
6 | </view> | 6 | </view> |
7 | - <view class="navItem"> | 7 | + <view class="navItem" :class="selindx==1?'navactive':''" @click="changeopt" :data-id="1"> |
8 | 待付款 | 8 | 待付款 |
9 | </view> | 9 | </view> |
10 | - <view class="navItem"> | 10 | + <view class="navItem" :class="selindx==2?'navactive':''" @click="changeopt" :data-id="2"> |
11 | 待发货 | 11 | 待发货 |
12 | </view> | 12 | </view> |
13 | - <view class="navItem"> | 13 | + <view class="navItem" :class="selindx==3?'navactive':''" @click="changeopt" :data-id="3"> |
14 | 待收货 | 14 | 待收货 |
15 | </view> | 15 | </view> |
16 | - <view class="navItem"> | 16 | + <view class="navItem" :class="selindx==4?'navactive':''" @click="changeopt" :data-id="4"> |
17 | 待评价 | 17 | 待评价 |
18 | + | ||
18 | </view> | 19 | </view> |
19 | </view> | 20 | </view> |
20 | <view class="list"> | 21 | <view class="list"> |
21 | - <view class="item"> | 22 | + <view class="item" v-for="(item,index) in orderlist" :key="index"> |
22 | <view class="titlebox"> | 23 | <view class="titlebox"> |
23 | <view class="leftT"> | 24 | <view class="leftT"> |
24 | - <image src="../../static/shop_o.png" mode="widthFix" class="icon"></image>红大地面品厂 | 25 | + <image src="../../static/shop_o.png" mode="widthFix" class="icon"></image> |
26 | + <text v-if="item.type==1">面坊商品</text> | ||
27 | + <text v-if="item.type==2">积分商品</text> | ||
28 | + <text v-if="item.type==3">{{item.store.name}}</text> | ||
29 | + | ||
25 | </view> | 30 | </view> |
26 | - <view class="rightT">待付款</view> | 31 | + <view class="rightT" v-if="item.status==1">待付款</view> |
32 | + <view class="rightT" v-if="item.status==2">待发货</view> | ||
33 | + <view class="rightT" v-if="item.status==3">待收货</view> | ||
34 | + <view class="rightT" v-if="item.status==4">待评价</view> | ||
35 | + <view class="rightT" v-if="item.status==6">已完成</view> | ||
36 | + <view class="rightT" v-if="item.status==-1">已取消</view> | ||
27 | </view> | 37 | </view> |
28 | - <view class="infobox"> | 38 | + <view class="infobox" v-for="(item,index) in item.order_info" :key="index"> |
29 | <image src="../../static/cai.png" mode="widthFix" class="shop"></image> | 39 | <image src="../../static/cai.png" mode="widthFix" class="shop"></image> |
30 | <view class="info"> | 40 | <view class="info"> |
31 | - <view class="word">商品名称名称名称商品名称名称名称商品名称名称名称名称</view> | ||
32 | - <view class="price">¥288</view> | 41 | + <view class="word">{{item.goods_name}}</view> |
42 | + <view v-if="item.spec.length!=0"> | ||
43 | + <view class="spec" v-for="(item,index) in item.spec" :key="index">{{item.spec_name}}:{{item.spec_value}}</view> | ||
44 | + </view> | ||
45 | + <view class="price">¥{{item.price}}</view> | ||
33 | </view> | 46 | </view> |
34 | </view> | 47 | </view> |
35 | <view class="btnbox"> | 48 | <view class="btnbox"> |
@@ -37,7 +50,7 @@ | @@ -37,7 +50,7 @@ | ||
37 | <view class="btn bactive">立即支付</view> | 50 | <view class="btn bactive">立即支付</view> |
38 | </view> | 51 | </view> |
39 | </view> | 52 | </view> |
40 | - <view class="item"> | 53 | + <!-- <view class="item"> |
41 | <view class="titlebox"> | 54 | <view class="titlebox"> |
42 | <view class="leftT"> | 55 | <view class="leftT"> |
43 | <image src="../../static/shop_o.png" mode="widthFix" class="icon"></image>红大地面品厂 | 56 | <image src="../../static/shop_o.png" mode="widthFix" class="icon"></image>红大地面品厂 |
@@ -88,8 +101,8 @@ | @@ -88,8 +101,8 @@ | ||
88 | <view class="btn bactive">立即评论</view> | 101 | <view class="btn bactive">立即评论</view> |
89 | </view> | 102 | </view> |
90 | </view> | 103 | </view> |
91 | - <view class="item"> | ||
92 | - <view class="titlebox"> | 104 | + <view class="item"> --> |
105 | + <!-- <view class="titlebox"> | ||
93 | <view class="leftT"> | 106 | <view class="leftT"> |
94 | <image src="../../static/shop_o.png" mode="widthFix" class="icon"></image>红大地面品厂 | 107 | <image src="../../static/shop_o.png" mode="widthFix" class="icon"></image>红大地面品厂 |
95 | </view> | 108 | </view> |
@@ -102,33 +115,75 @@ | @@ -102,33 +115,75 @@ | ||
102 | <view class="price">¥288</view> | 115 | <view class="price">¥288</view> |
103 | </view> | 116 | </view> |
104 | </view> | 117 | </view> |
105 | - </view> | 118 | + </view> --> |
106 | </view> | 119 | </view> |
107 | </view> | 120 | </view> |
108 | </template> | 121 | </template> |
109 | 122 | ||
110 | <script> | 123 | <script> |
124 | + import app from "../../App.vue"; | ||
111 | export default { | 125 | export default { |
112 | data() { | 126 | data() { |
113 | return { | 127 | return { |
114 | - | 128 | + selindx: '', |
129 | + page: 1, | ||
130 | + orderlist: [] | ||
115 | } | 131 | } |
116 | }, | 132 | }, |
133 | + onLoad(options) { | ||
134 | + this.selindx = options.id; | ||
135 | + console.log(this.selindx); | ||
136 | + this.getorder() | ||
137 | + }, | ||
117 | methods: { | 138 | methods: { |
118 | - comment(){ | 139 | + comment() { |
119 | uni.navigateTo({ | 140 | uni.navigateTo({ |
120 | - url:'/pages/usercenter/shopEvaluate' | 141 | + url: '/pages/usercenter/shopEvaluate' |
121 | }) | 142 | }) |
122 | - } | 143 | + }, |
144 | + //切换选项 | ||
145 | + changeopt(e) { | ||
146 | + this.selindx = e.currentTarget.dataset.id; | ||
147 | + this.page=1; | ||
148 | + this.orderlist=[]; | ||
149 | + this.getorder() | ||
150 | + | ||
151 | + }, | ||
152 | + // 获取订单列表 | ||
153 | + getorder() { | ||
154 | + let that = this; | ||
155 | + var url = 'order/get_order_list'; | ||
156 | + var params = { | ||
157 | + status: that.selindx, | ||
158 | + page: that.page, | ||
159 | + pageNum: 10 | ||
160 | + } | ||
161 | + console.log('7766554', params) | ||
162 | + app.post(url, params).then((res) => { | ||
163 | + console.log(res); | ||
164 | + that.orderlist = that.orderlist.concat(res.data.data); | ||
165 | + console.log(that.orderlist) | ||
166 | + }).catch((err) => { | ||
167 | + console.log(err) | ||
168 | + | ||
169 | + }) | ||
170 | + }, | ||
171 | + }, | ||
172 | + onReachBottom() { | ||
173 | + let newpage = this.page; | ||
174 | + newpage++; | ||
175 | + this.page = newpage; | ||
176 | + this.getorder() | ||
123 | } | 177 | } |
124 | } | 178 | } |
125 | </script> | 179 | </script> |
126 | 180 | ||
127 | <style> | 181 | <style> |
128 | - page{ | 182 | + page { |
129 | background: #F7F7F7; | 183 | background: #F7F7F7; |
130 | } | 184 | } |
131 | - .navbox{ | 185 | + |
186 | + .navbox { | ||
132 | height: 88rpx; | 187 | height: 88rpx; |
133 | background: #fff; | 188 | background: #fff; |
134 | display: flex; | 189 | display: flex; |
@@ -137,19 +192,22 @@ | @@ -137,19 +192,22 @@ | ||
137 | padding: 0 32rpx; | 192 | padding: 0 32rpx; |
138 | box-sizing: border-box; | 193 | box-sizing: border-box; |
139 | } | 194 | } |
140 | - .navItem{ | ||
141 | - font-size:32rpx; | ||
142 | - font-family:PingFangSC-Regular,PingFang SC; | ||
143 | - font-weight:400; | ||
144 | - color:rgba(35,35,35,1); | 195 | + |
196 | + .navItem { | ||
197 | + font-size: 32rpx; | ||
198 | + font-family: PingFangSC-Regular, PingFang SC; | ||
199 | + font-weight: 400; | ||
200 | + color: rgba(35, 35, 35, 1); | ||
145 | padding: 20rpx 0; | 201 | padding: 20rpx 0; |
146 | border-bottom: 1px solid transparent; | 202 | border-bottom: 1px solid transparent; |
147 | - } | ||
148 | - .navactive{ | 203 | + } |
204 | + | ||
205 | + .navactive { | ||
149 | color: #FF9417; | 206 | color: #FF9417; |
150 | border-color: #FF9417; | 207 | border-color: #FF9417; |
151 | - } | ||
152 | - .item{ | 208 | + } |
209 | + | ||
210 | + .item { | ||
153 | width: 100%; | 211 | width: 100%; |
154 | background: #fff; | 212 | background: #fff; |
155 | padding: 0 32rpx; | 213 | padding: 0 32rpx; |
@@ -157,82 +215,100 @@ | @@ -157,82 +215,100 @@ | ||
157 | margin-top: 16rpx; | 215 | margin-top: 16rpx; |
158 | overflow: hidden; | 216 | overflow: hidden; |
159 | } | 217 | } |
160 | - .titlebox{ | 218 | + |
219 | + .titlebox { | ||
161 | height: 84rpx; | 220 | height: 84rpx; |
162 | display: flex; | 221 | display: flex; |
163 | align-items: center; | 222 | align-items: center; |
164 | justify-content: space-between; | 223 | justify-content: space-between; |
165 | border-bottom: 1px solid #EEEEEE; | 224 | border-bottom: 1px solid #EEEEEE; |
166 | } | 225 | } |
167 | - .leftT{ | 226 | + |
227 | + .leftT { | ||
168 | display: flex; | 228 | display: flex; |
169 | align-items: center; | 229 | align-items: center; |
170 | - font-size:28rpx; | ||
171 | - font-family:PingFangSC-Medium,PingFang SC; | ||
172 | - font-weight:500; | ||
173 | - color:rgba(61,68,76,1); | 230 | + font-size: 28rpx; |
231 | + font-family: PingFangSC-Medium, PingFang SC; | ||
232 | + font-weight: 500; | ||
233 | + color: rgba(61, 68, 76, 1); | ||
174 | } | 234 | } |
175 | - .icon{ | 235 | + |
236 | + .icon { | ||
176 | width: 32rpx; | 237 | width: 32rpx; |
177 | margin-right: 12rpx; | 238 | margin-right: 12rpx; |
178 | } | 239 | } |
179 | - .rightT{ | ||
180 | - font-size:28rpx; | ||
181 | - font-family:PingFangSC-Regular,PingFang SC; | ||
182 | - font-weight:400; | ||
183 | - color:rgba(189,196,206,1); | 240 | + |
241 | + .rightT { | ||
242 | + font-size: 28rpx; | ||
243 | + font-family: PingFangSC-Regular, PingFang SC; | ||
244 | + font-weight: 400; | ||
245 | + color: rgba(189, 196, 206, 1); | ||
184 | } | 246 | } |
185 | - .infobox{ | 247 | + |
248 | + .infobox { | ||
186 | height: 204rpx; | 249 | height: 204rpx; |
187 | display: flex; | 250 | display: flex; |
188 | align-items: center; | 251 | align-items: center; |
189 | justify-content: space-between; | 252 | justify-content: space-between; |
190 | } | 253 | } |
191 | - .shop{ | 254 | + |
255 | + .shop { | ||
192 | width: 140rpx; | 256 | width: 140rpx; |
193 | } | 257 | } |
194 | - .info{ | 258 | + |
259 | + .info { | ||
195 | width: 530rpx; | 260 | width: 530rpx; |
196 | padding: 32rpx 0; | 261 | padding: 32rpx 0; |
197 | border-bottom: 1px solid #EEEEEE; | 262 | border-bottom: 1px solid #EEEEEE; |
198 | box-sizing: border-box; | 263 | box-sizing: border-box; |
199 | } | 264 | } |
200 | - .word{ | ||
201 | - font-size:30rpx; | ||
202 | - font-family:PingFangSC-Medium,PingFang SC; | ||
203 | - font-weight:500; | ||
204 | - color:rgba(61,69,76,1); | ||
205 | - margin-top: 8px; | ||
206 | - } | ||
207 | - .price{ | ||
208 | - font-size:32rpx; | ||
209 | - font-family:PingFangSC-Medium,PingFang SC; | ||
210 | - font-weight:500; | ||
211 | - color:rgba(255,91,78,1); | 265 | + |
266 | + .word { | ||
267 | + width:520rpx; | ||
268 | + height:76rpx; | ||
269 | + display: -webkit-box; | ||
270 | + -webkit-box-orient: vertical; | ||
271 | + -webkit-line-clamp: 2; | ||
272 | + overflow: hidden; | ||
273 | + font-size: 30rpx; | ||
274 | + font-family: PingFangSC-Medium, PingFang SC; | ||
275 | + font-weight: 500; | ||
276 | + color: rgba(61, 69, 76, 1); | ||
277 | + /* margin-top: 8px; */ | ||
278 | + } | ||
279 | + | ||
280 | + .price { | ||
281 | + font-size: 32rpx; | ||
282 | + font-family: PingFangSC-Medium, PingFang SC; | ||
283 | + font-weight: 500; | ||
284 | + color: rgba(255, 91, 78, 1); | ||
212 | margin-top: 20rpx; | 285 | margin-top: 20rpx; |
213 | } | 286 | } |
214 | - .btnbox{ | 287 | + |
288 | + .btnbox { | ||
215 | height: 100rpx; | 289 | height: 100rpx; |
216 | box-sizing: border-box; | 290 | box-sizing: border-box; |
217 | display: flex; | 291 | display: flex; |
218 | justify-content: flex-end; | 292 | justify-content: flex-end; |
219 | align-items: center; | 293 | align-items: center; |
220 | } | 294 | } |
221 | - .btn{ | ||
222 | - width:160rpx; | ||
223 | - height:64rpx; | ||
224 | - border-radius:8px; | ||
225 | - border:1px solid rgba(189,196,206,1); | ||
226 | - font-size:24rpx; | ||
227 | - font-family:PingFangSC-Regular,PingFang SC; | ||
228 | - font-weight:400; | ||
229 | - color:rgba(91,94,100,1); | 295 | + |
296 | + .btn { | ||
297 | + width: 160rpx; | ||
298 | + height: 64rpx; | ||
299 | + border-radius: 8px; | ||
300 | + border: 1px solid rgba(189, 196, 206, 1); | ||
301 | + font-size: 24rpx; | ||
302 | + font-family: PingFangSC-Regular, PingFang SC; | ||
303 | + font-weight: 400; | ||
304 | + color: rgba(91, 94, 100, 1); | ||
230 | display: flex; | 305 | display: flex; |
231 | align-items: center; | 306 | align-items: center; |
232 | justify-content: center; | 307 | justify-content: center; |
233 | margin-top: 10rpx; | 308 | margin-top: 10rpx; |
234 | } | 309 | } |
235 | - .bactive{ | 310 | + |
311 | + .bactive { | ||
236 | color: #FF9417; | 312 | color: #FF9417; |
237 | border-color: #FF9417; | 313 | border-color: #FF9417; |
238 | } | 314 | } |
@@ -3,29 +3,115 @@ | @@ -3,29 +3,115 @@ | ||
3 | <view class="box"> | 3 | <view class="box"> |
4 | <view class="item"> | 4 | <view class="item"> |
5 | <view class="left">用户头像</view> | 5 | <view class="left">用户头像</view> |
6 | - <view class="right"> | ||
7 | - <image src="../../static/userpic.png" mode="widthFix" class="avator" /> | 6 | + <view class="right " @click="chooseImage"> |
7 | + <image :src="avatar==''?'../../static/headtou.png':avatar" class="avator" /> | ||
8 | <image src="../../static/right.png" mode="widthFix" class="jiantou" /> | 8 | <image src="../../static/right.png" mode="widthFix" class="jiantou" /> |
9 | </view> | 9 | </view> |
10 | </view> | 10 | </view> |
11 | <view class="item"> | 11 | <view class="item"> |
12 | <view class="left">用户昵称</view> | 12 | <view class="left">用户昵称</view> |
13 | - <view class="right">昵称昵称昵称 | 13 | + <view class="right entername"> |
14 | + <input type="text" placeholder="请输入用户昵称" @input="enternickname" :value="nickname" placeholder-class="enterword"> | ||
15 | + | ||
14 | </view> | 16 | </view> |
15 | </view> | 17 | </view> |
16 | </view> | 18 | </view> |
17 | - <view class="btn">确认</view> | 19 | + <view class="btn" @click="surechange">确认</view> |
18 | </view> | 20 | </view> |
19 | </template> | 21 | </template> |
20 | 22 | ||
21 | <script> | 23 | <script> |
24 | + import app from "../../App.vue"; | ||
22 | export default { | 25 | export default { |
23 | data() { | 26 | data() { |
24 | return { | 27 | return { |
25 | - | 28 | + nickname:'', |
29 | + avatar:'' | ||
26 | } | 30 | } |
27 | }, | 31 | }, |
32 | + onLoad(options) { | ||
33 | + this.nickname=options.nickname; | ||
34 | + console.log(this.nickname) | ||
35 | + this.avatar=options.avatar; | ||
36 | + }, | ||
28 | methods: { | 37 | methods: { |
38 | + | ||
39 | + // 输入用户昵称 | ||
40 | + enternickname(e){ | ||
41 | + this.nickname=e.detail.value | ||
42 | + }, | ||
43 | + // 上传头像 | ||
44 | + chooseImage() { | ||
45 | + let that = this; | ||
46 | + uni.chooseImage({ | ||
47 | + count: 9, | ||
48 | + sizeType: ['original', 'compressed'], | ||
49 | + success: function (res) { | ||
50 | + console.log(res) | ||
51 | + console.log(res.tempFilePaths); | ||
52 | + console.log(res.tempFilePaths[0]) | ||
53 | + | ||
54 | + | ||
55 | + app.upload('image', res.tempFilePaths[0], "post").then((res) => { | ||
56 | + console.log('上传文件', res); | ||
57 | + let url = app.globalData.imgurl+res.url; | ||
58 | + that.avatar=url | ||
59 | + console.log(that.avatar) | ||
60 | + | ||
61 | + }).catch((err) => { | ||
62 | + console.log(err) | ||
63 | + }) | ||
64 | + | ||
65 | + }, | ||
66 | + fail: function (res) { } | ||
67 | + }) | ||
68 | + }, | ||
69 | + | ||
70 | + //确认修改 | ||
71 | + surechange(){ | ||
72 | + let that = this; | ||
73 | + if(that.avatar==''){ | ||
74 | + uni.showToast({ | ||
75 | + title:'请上传头像', | ||
76 | + icon:'none' | ||
77 | + }) | ||
78 | + return false | ||
79 | + } | ||
80 | + if(that.nickname==''){ | ||
81 | + uni.showToast({ | ||
82 | + title:'请输入昵称', | ||
83 | + icon:'none' | ||
84 | + }) | ||
85 | + return false | ||
86 | + } | ||
87 | + var url = 'member/update_user'; | ||
88 | + var params = { | ||
89 | + avatar: that.avatar, | ||
90 | + nickname:that.nickname, | ||
91 | + longitude:uni.getStorageSync("longitude"), | ||
92 | + latitude:uni.getStorageSync("latitude") | ||
93 | + } | ||
94 | + console.log('7766554', params) | ||
95 | + app.post(url, params).then((res) => { | ||
96 | + console.log(res); | ||
97 | + uni.showToast({ | ||
98 | + title:"提交成功", | ||
99 | + icon:'none' | ||
100 | + }) | ||
101 | + | ||
102 | + setTimeout(function(){ | ||
103 | + uni.navigateBack({ | ||
104 | + checked:true | ||
105 | + }) | ||
106 | + },1500) | ||
107 | + | ||
108 | + | ||
109 | + }).catch((err) => { | ||
110 | + console.log(err) | ||
111 | + | ||
112 | + }) | ||
113 | + } | ||
114 | + | ||
29 | 115 | ||
30 | } | 116 | } |
31 | } | 117 | } |
@@ -36,7 +122,7 @@ | @@ -36,7 +122,7 @@ | ||
36 | background: #F7F7F7; | 122 | background: #F7F7F7; |
37 | 123 | ||
38 | } | 124 | } |
39 | - | 125 | + |
40 | .box { | 126 | .box { |
41 | padding: 0 32rpx; | 127 | padding: 0 32rpx; |
42 | box-sizing: border-box; | 128 | box-sizing: border-box; |
@@ -76,6 +162,9 @@ | @@ -76,6 +162,9 @@ | ||
76 | 162 | ||
77 | .right .avator { | 163 | .right .avator { |
78 | width: 84rpx; | 164 | width: 84rpx; |
165 | + height:84rpx; | ||
166 | + font-size: 0; | ||
167 | + border-radius: 50%; | ||
79 | } | 168 | } |
80 | 169 | ||
81 | .right .jiantou { | 170 | .right .jiantou { |
@@ -103,4 +192,27 @@ | @@ -103,4 +192,27 @@ | ||
103 | page{ | 192 | page{ |
104 | overflow-y: hidden; | 193 | overflow-y: hidden; |
105 | } | 194 | } |
195 | + .entername{ | ||
196 | + width:490rpx; | ||
197 | + } | ||
198 | + .entername input{ | ||
199 | + width:100%; | ||
200 | + color:#3D454C; | ||
201 | + font-size: 28rpx; | ||
202 | + text-align: right; | ||
203 | + } | ||
204 | + .enterword{ | ||
205 | + color:#3D454C; | ||
206 | + font-size: 28rpx; | ||
207 | + } | ||
208 | + .headimg{ | ||
209 | + width:120rpx; | ||
210 | + height:120rpx; | ||
211 | + font-size: 0; | ||
212 | + border-radius: 50%; | ||
213 | + | ||
214 | + } | ||
215 | + .headimg image{ | ||
216 | + border-radius: 50%; | ||
217 | + } | ||
106 | </style> | 218 | </style> |
@@ -6,31 +6,42 @@ | @@ -6,31 +6,42 @@ | ||
6 | ¥ | 6 | ¥ |
7 | <input type="text" class="fill" /> | 7 | <input type="text" class="fill" /> |
8 | </view> | 8 | </view> |
9 | + | ||
10 | + <view class="huiyuanbot"> | ||
11 | + <view class="behuiyuanbtn" @click="sureti">确认</view> | ||
12 | + </view> | ||
9 | </view> | 13 | </view> |
10 | - <view class="cover"> | 14 | + |
15 | + <view class="cover" v-if="showwrap"> | ||
11 | <view class="coverBox"> | 16 | <view class="coverBox"> |
12 | <view class="top"> | 17 | <view class="top"> |
13 | - <view class="close"><image src="../../static/colose.png" mode="widthFix" /></view> | 18 | + <view class="close" @click="hidewrap"> |
19 | + <image src="../../static/colose.png" mode="widthFix" /> | ||
20 | + </view> | ||
14 | 支付 | 21 | 支付 |
15 | </view> | 22 | </view> |
16 | - <view class="monetall"> | 23 | + <!-- <view class="monetall"> |
17 | <view class="moneyNum">¥2560.00</view> | 24 | <view class="moneyNum">¥2560.00</view> |
18 | <view class="moneyTitle">订单总额</view> | 25 | <view class="moneyTitle">订单总额</view> |
19 | - </view> | 26 | + </view> --> |
20 | <view class="payBox"> | 27 | <view class="payBox"> |
21 | <view class="payItem"> | 28 | <view class="payItem"> |
22 | <view class="left"> | 29 | <view class="left"> |
23 | <image src="../../static/paya.png" mode="widthFix" /> | 30 | <image src="../../static/paya.png" mode="widthFix" /> |
24 | 支付宝 | 31 | 支付宝 |
25 | </view> | 32 | </view> |
26 | - <view class="right"><image src="../../static/nocheck.png" mode="widthFix" class="check" /></view> | 33 | + <view class="right"> |
34 | + <image src="../../static/nocheck.png" mode="widthFix" class="check" /> | ||
35 | + </view> | ||
27 | </view> | 36 | </view> |
28 | <view class="payItem"> | 37 | <view class="payItem"> |
29 | <view class="left"> | 38 | <view class="left"> |
30 | <image src="../../static/payb.png" mode="widthFix" /> | 39 | <image src="../../static/payb.png" mode="widthFix" /> |
31 | 微信 | 40 | 微信 |
32 | </view> | 41 | </view> |
33 | - <view class="right"><image src="../../static/check.png" mode="widthFix" class="check" /></view> | 42 | + <view class="right"> |
43 | + <image src="../../static/check.png" mode="widthFix" class="check" /> | ||
44 | + </view> | ||
34 | </view> | 45 | </view> |
35 | </view> | 46 | </view> |
36 | <view class="submit">确认支付(¥2560.00)</view> | 47 | <view class="submit">确认支付(¥2560.00)</view> |
@@ -40,139 +51,189 @@ | @@ -40,139 +51,189 @@ | ||
40 | </template> | 51 | </template> |
41 | 52 | ||
42 | <script> | 53 | <script> |
43 | -export default { | ||
44 | - data() { | ||
45 | - return {}; | ||
46 | - }, | ||
47 | - methods: {} | ||
48 | -}; | 54 | + export default { |
55 | + data() { | ||
56 | + return { | ||
57 | + showwrap: false, | ||
58 | + }; | ||
59 | + }, | ||
60 | + methods: { | ||
61 | + sureti(){ | ||
62 | + this.showwrap=true | ||
63 | + }, | ||
64 | + // 隐藏弹出 | ||
65 | + hidewrap(){ | ||
66 | + this.showwrap=false | ||
67 | + } | ||
68 | + } | ||
69 | + }; | ||
49 | </script> | 70 | </script> |
50 | 71 | ||
51 | <style> | 72 | <style> |
52 | -page { | ||
53 | - background: #f7f7f7; | ||
54 | - height: 100%; | ||
55 | -} | ||
56 | -.box { | ||
57 | - margin-top: 20rpx; | ||
58 | - padding: 20rpx 32rpx 16rpx; | ||
59 | - box-sizing: border-box; | ||
60 | - border-bottom: 1px solid #eaeaea; | ||
61 | -} | ||
62 | -.title { | ||
63 | - font-size: 32rpx; | ||
64 | - font-family: PingFangHK-Regular, PingFangHK; | ||
65 | - font-weight: 400; | ||
66 | - color: rgba(8, 18, 31, 1); | ||
67 | - margin: 40rpx 0; | ||
68 | -} | ||
69 | -.money { | ||
70 | - display: flex; | ||
71 | - align-items: center; | ||
72 | - font-size: 72rpx; | ||
73 | - font-family: PingFangHK-Regular, PingFangHK; | ||
74 | - font-weight: 400; | ||
75 | - color: rgba(8, 18, 31, 1); | ||
76 | -} | ||
77 | -.fill { | ||
78 | - margin-left: 20rpx; | ||
79 | -} | ||
80 | -.cover { | ||
81 | - position: fixed; | ||
82 | - left: 0; | ||
83 | - top: 0; | ||
84 | - width: 100%; | ||
85 | - height: 100%; | ||
86 | - background: rgba(0, 0, 0, 0.2); | ||
87 | -} | ||
88 | -.coverBox { | ||
89 | - position: absolute; | ||
90 | - left: 0; | ||
91 | - bottom: 0; | ||
92 | - width: 100%; | ||
93 | - height: 766rpx; | ||
94 | - background: rgba(255, 255, 255, 1); | ||
95 | - border-radius: 24rpx 24rpx 0px 0px; | ||
96 | -} | ||
97 | -.top { | ||
98 | - height: 96rpx; | ||
99 | - display: flex; | ||
100 | - align-items: center; | ||
101 | - justify-content: center; | ||
102 | - position: relative; | ||
103 | - font-size: 32rpx; | ||
104 | - font-family: PingFangSC-Regular, PingFang SC; | ||
105 | - font-weight: 400; | ||
106 | - color: rgba(6, 18, 31, 1); | ||
107 | - border-bottom: 1px solid #eeeeee; | ||
108 | -} | ||
109 | -.close { | ||
110 | - width: 48rpx; | ||
111 | - position: absolute; | ||
112 | - left: 32rpx; | ||
113 | - top: 24rpx; | ||
114 | -} | ||
115 | -.close image { | ||
116 | - width: 100%; | ||
117 | -} | ||
118 | -.monetall { | ||
119 | - margin-top: 70rpx; | ||
120 | -} | ||
121 | -.moneyNum { | ||
122 | - font-size: 68rpx; | ||
123 | - font-family: PingFangSC-Regular, PingFang SC; | ||
124 | - font-weight: 400; | ||
125 | - color: rgba(194, 148, 69, 1); | ||
126 | - text-align: center; | ||
127 | -} | ||
128 | -.moneyTitle { | ||
129 | - font-size: 28rpx; | ||
130 | - font-family: PingFangSC-Regular, PingFang SC; | ||
131 | - font-weight: 400; | ||
132 | - color: rgba(61, 68, 76, 1); | ||
133 | - text-align: center; | ||
134 | -} | ||
135 | -.payBox { | ||
136 | - margin-bottom: 80rpx; | ||
137 | - padding: 0 32rpx; | ||
138 | - box-sizing: border-box; | ||
139 | -} | ||
140 | -.payItem { | ||
141 | - margin-top: 64rpx; | ||
142 | - display: flex; | ||
143 | - align-items: center; | ||
144 | - justify-content: space-between; | ||
145 | -} | ||
146 | -.left { | ||
147 | - display: flex; | ||
148 | - align-items: center; | ||
149 | - font-size: 32rpx; | ||
150 | - font-family: PingFangSC-Regular, PingFang SC; | ||
151 | - font-weight: 400; | ||
152 | - color: rgba(6, 18, 31, 1); | ||
153 | -} | ||
154 | - | ||
155 | -.left image { | ||
156 | - width: 48rpx; | ||
157 | - margin-right: 32rpx; | ||
158 | -} | ||
159 | -.right { | ||
160 | - width: 48rpx; | ||
161 | -} | ||
162 | -.check { | ||
163 | - width: 100%; | ||
164 | -} | ||
165 | -.submit { | ||
166 | - width: 686rpx; | ||
167 | - height: 88rpx; | ||
168 | - background: #c29445; | ||
169 | - border-radius: 10rpx; | ||
170 | - font-size: 32rpx; | ||
171 | - font-family: PingFangSC-Medium, PingFang SC; | ||
172 | - font-weight: 500; | ||
173 | - color: rgba(254, 254, 254, 1); | ||
174 | - line-height: 88rpx; | ||
175 | - text-align: center; | ||
176 | - margin: 0 auto; | ||
177 | -} | 73 | + page { |
74 | + background: #f7f7f7; | ||
75 | + height: 100%; | ||
76 | + } | ||
77 | + | ||
78 | + .behuiyuanbtn { | ||
79 | + width: 686rpx; | ||
80 | + height: 88rpx; | ||
81 | + background: #C29445; | ||
82 | + color: #fff; | ||
83 | + font-size: 32rpx; | ||
84 | + text-align: center; | ||
85 | + line-height: 88rpx; | ||
86 | + border-radius: 10rpx; | ||
87 | + | ||
88 | + } | ||
89 | + | ||
90 | + .huiyuanbot { | ||
91 | + position: fixed; | ||
92 | + background: #fff; | ||
93 | + bottom: 0; | ||
94 | + left: 0; | ||
95 | + width: 750rpx; | ||
96 | + height: 116rpx; | ||
97 | + padding: 14rpx 32rpx; | ||
98 | + } | ||
99 | + | ||
100 | + .box { | ||
101 | + margin-top: 20rpx; | ||
102 | + padding: 20rpx 32rpx 16rpx; | ||
103 | + box-sizing: border-box; | ||
104 | + border-bottom: 1px solid #eaeaea; | ||
105 | + } | ||
106 | + | ||
107 | + .title { | ||
108 | + font-size: 32rpx; | ||
109 | + font-family: PingFangHK-Regular, PingFangHK; | ||
110 | + font-weight: 400; | ||
111 | + color: rgba(8, 18, 31, 1); | ||
112 | + margin: 40rpx 0; | ||
113 | + } | ||
114 | + | ||
115 | + .money { | ||
116 | + display: flex; | ||
117 | + align-items: center; | ||
118 | + font-size: 72rpx; | ||
119 | + font-family: PingFangHK-Regular, PingFangHK; | ||
120 | + font-weight: 400; | ||
121 | + color: rgba(8, 18, 31, 1); | ||
122 | + } | ||
123 | + | ||
124 | + .fill { | ||
125 | + margin-left: 20rpx; | ||
126 | + } | ||
127 | + | ||
128 | + .cover { | ||
129 | + position: fixed; | ||
130 | + left: 0; | ||
131 | + top: 0; | ||
132 | + width: 100%; | ||
133 | + height: 100%; | ||
134 | + background: rgba(0, 0, 0, 0.2); | ||
135 | + } | ||
136 | + | ||
137 | + .coverBox { | ||
138 | + position: absolute; | ||
139 | + left: 0; | ||
140 | + bottom: 0; | ||
141 | + width: 100%; | ||
142 | + height: 566rpx; | ||
143 | + background: rgba(255, 255, 255, 1); | ||
144 | + border-radius: 24rpx 24rpx 0px 0px; | ||
145 | + } | ||
146 | + | ||
147 | + .top { | ||
148 | + height: 96rpx; | ||
149 | + display: flex; | ||
150 | + align-items: center; | ||
151 | + justify-content: center; | ||
152 | + position: relative; | ||
153 | + font-size: 32rpx; | ||
154 | + font-family: PingFangSC-Regular, PingFang SC; | ||
155 | + font-weight: 400; | ||
156 | + color: rgba(6, 18, 31, 1); | ||
157 | + border-bottom: 1px solid #eeeeee; | ||
158 | + } | ||
159 | + | ||
160 | + .close { | ||
161 | + width: 48rpx; | ||
162 | + position: absolute; | ||
163 | + left: 32rpx; | ||
164 | + top: 24rpx; | ||
165 | + } | ||
166 | + | ||
167 | + .close image { | ||
168 | + width: 100%; | ||
169 | + } | ||
170 | + | ||
171 | + .monetall { | ||
172 | + margin-top: 70rpx; | ||
173 | + } | ||
174 | + | ||
175 | + .moneyNum { | ||
176 | + font-size: 68rpx; | ||
177 | + font-family: PingFangSC-Regular, PingFang SC; | ||
178 | + font-weight: 400; | ||
179 | + color: rgba(194, 148, 69, 1); | ||
180 | + text-align: center; | ||
181 | + } | ||
182 | + | ||
183 | + .moneyTitle { | ||
184 | + font-size: 28rpx; | ||
185 | + font-family: PingFangSC-Regular, PingFang SC; | ||
186 | + font-weight: 400; | ||
187 | + color: rgba(61, 68, 76, 1); | ||
188 | + text-align: center; | ||
189 | + } | ||
190 | + | ||
191 | + .payBox { | ||
192 | + margin-bottom: 80rpx; | ||
193 | + padding: 0 32rpx; | ||
194 | + box-sizing: border-box; | ||
195 | + } | ||
196 | + | ||
197 | + .payItem { | ||
198 | + margin-top: 64rpx; | ||
199 | + display: flex; | ||
200 | + align-items: center; | ||
201 | + justify-content: space-between; | ||
202 | + } | ||
203 | + | ||
204 | + .left { | ||
205 | + display: flex; | ||
206 | + align-items: center; | ||
207 | + font-size: 32rpx; | ||
208 | + font-family: PingFangSC-Regular, PingFang SC; | ||
209 | + font-weight: 400; | ||
210 | + color: rgba(6, 18, 31, 1); | ||
211 | + } | ||
212 | + | ||
213 | + .left image { | ||
214 | + width: 48rpx; | ||
215 | + margin-right: 32rpx; | ||
216 | + } | ||
217 | + | ||
218 | + .right { | ||
219 | + width: 48rpx; | ||
220 | + } | ||
221 | + | ||
222 | + .check { | ||
223 | + width: 100%; | ||
224 | + } | ||
225 | + | ||
226 | + .submit { | ||
227 | + width: 686rpx; | ||
228 | + height: 88rpx; | ||
229 | + background: #c29445; | ||
230 | + border-radius: 10rpx; | ||
231 | + font-size: 32rpx; | ||
232 | + font-family: PingFangSC-Medium, PingFang SC; | ||
233 | + font-weight: 500; | ||
234 | + color: rgba(254, 254, 254, 1); | ||
235 | + line-height: 88rpx; | ||
236 | + text-align: center; | ||
237 | + margin: 0 auto; | ||
238 | + } | ||
178 | </style> | 239 | </style> |
1 | <template> | 1 | <template> |
2 | <view class="page"> | 2 | <view class="page"> |
3 | <view class="infobox"> | 3 | <view class="infobox"> |
4 | - <image src="../../static/userpic.png" mode="widthFix" class="avator"></image> | ||
5 | - <view class="word">我是用户昵称</view> | 4 | + <image :src="avatar==''?'../../static/headtou.png':avatar" mode="widthFix" class="avator"></image> |
5 | + <view class="word">{{nickname==''?'暂无昵称':nickname}}</view> | ||
6 | </view> | 6 | </view> |
7 | <view class="list"> | 7 | <view class="list"> |
8 | <view class="item"> | 8 | <view class="item"> |
9 | <view class="left"> | 9 | <view class="left"> |
10 | <image src="../../static/icond.png" mode="widthFix" class="icon"></image>我的邀请码 | 10 | <image src="../../static/icond.png" mode="widthFix" class="icon"></image>我的邀请码 |
11 | </view> | 11 | </view> |
12 | - <view class="right"> | ||
13 | - 15621564879<image src="../../static/icona.png" mode="widthFix" class="rcion"></image> | 12 | + <view class="right salecode"> |
13 | + 15621564879 | ||
14 | + <image src="../../static/icona.png" mode="widthFix" class="rcion"></image> | ||
14 | </view> | 15 | </view> |
15 | </view> | 16 | </view> |
16 | <view class="item" @click="yeji"> | 17 | <view class="item" @click="yeji"> |
@@ -34,23 +35,50 @@ | @@ -34,23 +35,50 @@ | ||
34 | </template> | 35 | </template> |
35 | 36 | ||
36 | <script> | 37 | <script> |
38 | + import app from "../../App.vue"; | ||
37 | export default { | 39 | export default { |
38 | data() { | 40 | data() { |
39 | return { | 41 | return { |
40 | - | 42 | + nickname:'', |
43 | + avatar:'' | ||
41 | } | 44 | } |
42 | }, | 45 | }, |
46 | + onLoad() { | ||
47 | + | ||
48 | + }, | ||
43 | methods: { | 49 | methods: { |
44 | yeji() { | 50 | yeji() { |
45 | uni.navigateTo({ | 51 | uni.navigateTo({ |
46 | url: "/pages/usercenter/myAchievement" | 52 | url: "/pages/usercenter/myAchievement" |
47 | }) | 53 | }) |
48 | }, | 54 | }, |
49 | - kehu(){ | 55 | + kehu() { |
50 | uni.navigateTo({ | 56 | uni.navigateTo({ |
51 | - url:"/pages/usercenter/myCustomer" | 57 | + url: "/pages/usercenter/myCustomer" |
52 | }) | 58 | }) |
59 | + }, | ||
60 | + // 获取用户信息 | ||
61 | + getuserinfo() { | ||
62 | + let that = this; | ||
63 | + var url = 'member/index'; | ||
64 | + var params = { | ||
65 | + | ||
53 | } | 66 | } |
67 | + console.log('7766554', params) | ||
68 | + app.post(url, params).then((res) => { | ||
69 | + console.log(res); | ||
70 | + that.nickname = res.data.data.nickname; | ||
71 | + that.avatar = res.data.data.avatar; | ||
72 | + | ||
73 | + | ||
74 | + }).catch((err) => { | ||
75 | + | ||
76 | + }) | ||
77 | + }, | ||
78 | + }, | ||
79 | + | ||
80 | + onShow() { | ||
81 | + this.getuserinfo() | ||
54 | } | 82 | } |
55 | } | 83 | } |
56 | </script> | 84 | </script> |
@@ -71,6 +99,8 @@ | @@ -71,6 +99,8 @@ | ||
71 | 99 | ||
72 | .avator { | 100 | .avator { |
73 | width: 128rpx; | 101 | width: 128rpx; |
102 | + height:128rpx; | ||
103 | + border-radius: 50%; | ||
74 | margin-right: 28rpx; | 104 | margin-right: 28rpx; |
75 | } | 105 | } |
76 | 106 | ||
@@ -124,4 +154,7 @@ | @@ -124,4 +154,7 @@ | ||
124 | width: 32rpx; | 154 | width: 32rpx; |
125 | margin-left: 12rpx; | 155 | margin-left: 12rpx; |
126 | } | 156 | } |
157 | + .salecode{ | ||
158 | + font-size: 28rpx; | ||
159 | + } | ||
127 | </style> | 160 | </style> |
@@ -52,16 +52,21 @@ | @@ -52,16 +52,21 @@ | ||
52 | export default { | 52 | export default { |
53 | data() { | 53 | data() { |
54 | return { | 54 | return { |
55 | - | 55 | + avatar:'', |
56 | + nickname:'' | ||
56 | } | 57 | } |
57 | }, | 58 | }, |
59 | + onLoad(options) { | ||
60 | + this.avatar=options.avatar; | ||
61 | + this.nickname=options.nickname; | ||
62 | + }, | ||
58 | methods: { | 63 | methods: { |
59 | // 个人资料 | 64 | // 个人资料 |
60 | person(e) { | 65 | person(e) { |
61 | let id=e.currentTarget.dataset.id; | 66 | let id=e.currentTarget.dataset.id; |
62 | if(id==1){ | 67 | if(id==1){ |
63 | uni.navigateTo({ | 68 | uni.navigateTo({ |
64 | - url: '/pages/usercenter/personalData' | 69 | + url: '/pages/usercenter/personalData?avatar='+this.avatar+'&nickname='+this.nickname |
65 | }) | 70 | }) |
66 | }else if(id==2){ | 71 | }else if(id==2){ |
67 | uni.navigateTo({ | 72 | uni.navigateTo({ |
@@ -2,7 +2,7 @@ | @@ -2,7 +2,7 @@ | ||
2 | <view class="page"> | 2 | <view class="page"> |
3 | <view class="item"> | 3 | <view class="item"> |
4 | <view class="title">账户余额</view> | 4 | <view class="title">账户余额</view> |
5 | - <view class="money">¥998.57</view> | 5 | + <view class="money">¥{{userinfo.money}}</view> |
6 | <view class="moneyBox"> | 6 | <view class="moneyBox"> |
7 | <view class="mitem" @click="chonghzi"> | 7 | <view class="mitem" @click="chonghzi"> |
8 | <image src="../../static/money_a.png" mode="widthFix" class="itemImg" /> | 8 | <image src="../../static/money_a.png" mode="widthFix" class="itemImg" /> |
@@ -21,15 +21,15 @@ | @@ -21,15 +21,15 @@ | ||
21 | </view> | 21 | </view> |
22 | <view class="item"> | 22 | <view class="item"> |
23 | <view class="title">赊吧剩余额度</view> | 23 | <view class="title">赊吧剩余额度</view> |
24 | - <view class="money">¥698.57</view> | 24 | + <view class="money">¥{{userinfo.borrow_money}}</view> |
25 | <view class="moneyBox"> | 25 | <view class="moneyBox"> |
26 | <view class="zitem"> | 26 | <view class="zitem"> |
27 | <view class="name">总额度</view> | 27 | <view class="name">总额度</view> |
28 | - <view class="word">¥8800.00</view> | 28 | + <view class="word">¥{{userinfo.borrow_money_limit}}</view> |
29 | </view> | 29 | </view> |
30 | <view class="zitem"> | 30 | <view class="zitem"> |
31 | <view class="name">全部待还</view> | 31 | <view class="name">全部待还</view> |
32 | - <view class="word">¥1100.00</view> | 32 | + <view class="word">¥{{remainshengyu}}</view> |
33 | </view> | 33 | </view> |
34 | </view> | 34 | </view> |
35 | <view class="tipsword" @click="sheba">赊吧订单</view> | 35 | <view class="tipsword" @click="sheba">赊吧订单</view> |
@@ -38,13 +38,39 @@ | @@ -38,13 +38,39 @@ | ||
38 | </template> | 38 | </template> |
39 | 39 | ||
40 | <script> | 40 | <script> |
41 | + import app from "../../App.vue"; | ||
41 | export default { | 42 | export default { |
42 | data() { | 43 | data() { |
43 | return { | 44 | return { |
44 | - | 45 | + userinfo:'', |
46 | + remainshengyu:'' | ||
45 | } | 47 | } |
46 | }, | 48 | }, |
49 | + onLoad() { | ||
50 | + this.getuserinfo() | ||
51 | + }, | ||
47 | methods: { | 52 | methods: { |
53 | + // 获取用户信息 | ||
54 | + getuserinfo() { | ||
55 | + let that = this; | ||
56 | + var url = 'member/index'; | ||
57 | + var params = { | ||
58 | + | ||
59 | + } | ||
60 | + console.log('7766554', params) | ||
61 | + app.post(url, params).then((res) => { | ||
62 | + console.log(res); | ||
63 | + that.userinfo = res.data.data; | ||
64 | + that.label = res.data.data.label; | ||
65 | + that.nickname=res.data.data.nickname; | ||
66 | + that.avatar=res.data.data.avatar; | ||
67 | + that.remainshengyu=that.userinfo.borrow_money_limit*100/100-that.userinfo.borrow_money*100/100 | ||
68 | + | ||
69 | + | ||
70 | + }).catch((err) => { | ||
71 | + | ||
72 | + }) | ||
73 | + }, | ||
48 | // 赊吧 | 74 | // 赊吧 |
49 | sheba() { | 75 | sheba() { |
50 | uni.navigateTo({ | 76 | uni.navigateTo({ |
@@ -140,7 +166,9 @@ | @@ -140,7 +166,9 @@ | ||
140 | display: flex; | 166 | display: flex; |
141 | flex-wrap: wrap; | 167 | flex-wrap: wrap; |
142 | justify-content: center; | 168 | justify-content: center; |
143 | - ; | 169 | + align-items: center; |
170 | + flex-direction: column; | ||
171 | + | ||
144 | 172 | ||
145 | } | 173 | } |
146 | 174 |
此 diff 太大无法显示。
此 diff 太大无法显示。
-
请 注册 或 登录 后发表评论