作者 韩昌

修改:评论

@@ -166,6 +166,12 @@ const getOrderPays = async () => { @@ -166,6 +166,12 @@ const getOrderPays = async () => {
166 proxy.$methods.pay(res) 166 proxy.$methods.pay(res)
167 canclePop() 167 canclePop()
168 console.log('getOrderPay', res) 168 console.log('getOrderPay', res)
  169 + if (defaultMode.value === 1) {
  170 + uni.showToast({ title: '支付成功', icon: 'none' })
  171 + setTimeout(() => {
  172 + uni.navigateBack()
  173 + }, 1500)
  174 + }
169 // 保存数据 175 // 保存数据
170 } catch (err) { 176 } catch (err) {
171 uni.showToast({ title: err, icon: 'none' }) 177 uni.showToast({ title: err, icon: 'none' })
@@ -32,7 +32,8 @@ @@ -32,7 +32,8 @@
32 <view class="topBox flexJ"> 32 <view class="topBox flexJ">
33 <view class="titles"> 33 <view class="titles">
34 <view class="title">特价专区</view> 34 <view class="title">特价专区</view>
35 - <text>Special price zone</text> 35 + <!-- <text>Special price zone</text> -->
  36 + <text>SPECIAL PRICE ZONE</text>
36 </view> 37 </view>
37 <view class="more flexA" @click="toBargainPriceMoreHandler"> 38 <view class="more flexA" @click="toBargainPriceMoreHandler">
38 更多 39 更多
@@ -33,7 +33,7 @@ @@ -33,7 +33,7 @@
33 <image src="/static/indexIc/orangeRight.png" mode=""></image> 33 <image src="/static/indexIc/orangeRight.png" mode=""></image>
34 </view> 34 </view>
35 </view> 35 </view>
36 - <view v-if="commentList.length > 0"> 36 + <view v-if="commentList.length">
37 <comment :commentList="commentList"></comment> 37 <comment :commentList="commentList"></comment>
38 </view> 38 </view>
39 <!-- 暂无评论 --> 39 <!-- 暂无评论 -->
@@ -155,7 +155,7 @@ const getShopDetailes = async id => { @@ -155,7 +155,7 @@ const getShopDetailes = async id => {
155 moreSpec.value = res.specData //多规格 155 moreSpec.value = res.specData //多规格
156 shopType.value = res.detail.goodstatus //商品类型 156 shopType.value = res.detail.goodstatus //商品类型
157 value.value = res.cartNum 157 value.value = res.cartNum
158 - console.log('getShopDetaile', res) 158 + // console.log('评论数据', commentList.value)
159 // 保存数据 159 // 保存数据
160 } catch (err) { 160 } catch (err) {
161 uni.showToast({ title: err, icon: 'none' }) 161 uni.showToast({ title: err, icon: 'none' })
@@ -36,29 +36,39 @@ import { onShow, onLoad } from '@dcloudio/uni-app' @@ -36,29 +36,39 @@ import { onShow, onLoad } from '@dcloudio/uni-app'
36 import { getComment } from '@/api/' 36 import { getComment } from '@/api/'
37 const count = ref(5) //最高可选星星数 37 const count = ref(5) //最高可选星星数
38 const value = ref(0) //星星选中数 38 const value = ref(0) //星星选中数
39 -let photoList = reactive([]) //图片 39 +let photoList = reactive([]) // 显示图片
  40 +const imgList = ref([])
40 let desc = ref('') //评论 41 let desc = ref('') //评论
41 const { proxy } = getCurrentInstance() //获取当前实例 42 const { proxy } = getCurrentInstance() //获取当前实例
42 // 提交评论 43 // 提交评论
43 const submit = () => { 44 const submit = () => {
44 getComments() 45 getComments()
45 } 46 }
  47 +
  48 +const evaluateOrderId = ref(0) // 评价订单 id
  49 +
  50 +onLoad(e => {
  51 + evaluateOrderId.value = e.id
  52 +})
  53 +
46 // 上传图片 54 // 上传图片
47 const addPhoto = () => 55 const addPhoto = () =>
48 proxy.$methods.upload('http://health.shs.broing.cn/api/common/upload', imgUrl => { 56 proxy.$methods.upload('http://health.shs.broing.cn/api/common/upload', imgUrl => {
49 console.log('返回图片', imgUrl) 57 console.log('返回图片', imgUrl)
  58 + imgList.value.push(imgUrl.upImg)
50 photoList.push(imgUrl.avatar) 59 photoList.push(imgUrl.avatar)
51 }) 60 })
52 // 删除图片 61 // 删除图片
53 const delPhoto = index => { 62 const delPhoto = index => {
  63 + imgList.value.splice(index, 1)
54 photoList.splice(index, 1) 64 photoList.splice(index, 1)
55 } 65 }
56 // 写评论 66 // 写评论
57 const getComments = async () => { 67 const getComments = async () => {
58 try { 68 try {
59 let params = { 69 let params = {
60 - goods_id: 86, //integer 否 商品id  
61 - image: photoList.join(','), //string 是 图片 70 + id: evaluateOrderId.value,
  71 + image: imgList.value.join(','), //string 是 图片
62 content: desc.value //integer 否 内容 72 content: desc.value //integer 否 内容
63 } 73 }
64 const res = await getComment(params) 74 const res = await getComment(params)
1 <template> 1 <template>
2 - <view>  
3 - <u-navbar title="我的" bgColor="transparent"></u-navbar>  
4 - <view class="topBgBox">  
5 - <view class="name flexA">  
6 - <!-- <image src="../../static/logo.png" mode=""></image> 2 + <view>
  3 + <u-navbar title="我的" bgColor="transparent"></u-navbar>
  4 + <view class="topBgBox">
  5 + <view class="name flexA">
  6 + <!-- <image src="../../static/logo.png" mode=""></image>
7 <text>阅读</text> --> 7 <text>阅读</text> -->
8 - <view class="avatar">  
9 - <open-data type="userAvatarUrl"></open-data>  
10 - </view>  
11 - <view class="nicName">  
12 - <open-data type="userNickName"></open-data>  
13 - </view>  
14 - </view>  
15 - <view class="vipBox">  
16 - <image class="blackBg" src="/static/mineIc/blackBg.png" mode=""></image>  
17 - <view class="vip flexJ">  
18 - <view>  
19 - <view class="title flexA">  
20 - <image src="/static/mineIc/Vector.png" mode=""></image>  
21 - 会员中心  
22 - </view>  
23 - <view class="tip">充值会员享更多权益</view>  
24 - </view>  
25 - <view class="btn flexC" @click="toRecharg">立即充值</view>  
26 - </view>  
27 - </view>  
28 - </view>  
29 - <view class="mainBox">  
30 - <view class="orderClass">  
31 - <view class="classTitle flexJ" @click="orderStatus(5)">  
32 - <view class="my">我的订单</view>  
33 - <view class="all flexA">  
34 - 全部  
35 - <image src="/static/mineIc/gayRight.png" mode=""></image>  
36 - </view>  
37 - </view>  
38 - <view class="classBox flexJ">  
39 - <view class="items flexV" v-for="(item,index) in classList" :key="item.id" @click="orderStatus(index)">  
40 - <view class="badge">  
41 - <u-badge absolute :offset="[-4,-10]" color="#FFFFFF" bgColor="#F74637" max="99"  
42 - :value="item.num"></u-badge>  
43 - <image :src="item.ic" mode=""></image>  
44 - </view>  
45 - <text>{{item.name}}</text>  
46 - </view>  
47 - </view>  
48 - </view>  
49 - <view class="functionBox">  
50 - <view class="item flexJ" v-for="(item,index) in functionList" :key="item.id" @click="functionC(index)">  
51 - <view class="itemIc flexA">  
52 - <image :src="item.ic" mode=""></image>  
53 - <text>{{item.name}}</text>  
54 - </view>  
55 - <image src="/static/mineIc/gayRight.png" mode=""></image>  
56 - </view>  
57 - <view class="myService flexJ">  
58 - <view class="service flexA">  
59 - <image src="/static/indexIc/service.png" mode=""></image>  
60 - <text>我的客服</text>  
61 - </view>  
62 - <image src="/static/mineIc/gayRight.png" mode=""></image>  
63 - <button open-type="contact"></button>  
64 - </view>  
65 - </view>  
66 - </view>  
67 - </view> 8 + <view class="avatar">
  9 + <open-data type="userAvatarUrl"></open-data>
  10 + </view>
  11 + <view class="nicName">
  12 + <open-data type="userNickName"></open-data>
  13 + </view>
  14 + </view>
  15 + <view class="vipBox">
  16 + <image class="blackBg" src="/static/mineIc/blackBg.png" mode=""></image>
  17 + <view class="vip flexJ">
  18 + <view>
  19 + <view class="title flexA">
  20 + <image src="/static/mineIc/Vector.png" mode=""></image>
  21 + 会员中心
  22 + </view>
  23 + <view class="tip">充值会员享更多权益</view>
  24 + </view>
  25 + <view class="btn flexC" @click="toRecharg">立即充值</view>
  26 + </view>
  27 + </view>
  28 + </view>
  29 + <view class="mainBox">
  30 + <view class="orderClass">
  31 + <view class="classTitle flexJ" @click="orderStatus(5)">
  32 + <view class="my">我的订单</view>
  33 + <view class="all flexA">
  34 + 全部
  35 + <image src="/static/mineIc/gayRight.png" mode=""></image>
  36 + </view>
  37 + </view>
  38 + <view class="classBox flexJ">
  39 + <view class="items flexV" v-for="(item, index) in classList" :key="item.id" @click="orderStatus(index)">
  40 + <view class="badge">
  41 + <u-badge absolute :offset="[-4, -10]" color="#FFFFFF" bgColor="#F74637" max="99" :value="item.num"></u-badge>
  42 + <image :src="item.ic" mode=""></image>
  43 + </view>
  44 + <text>{{ item.name }}</text>
  45 + </view>
  46 + </view>
  47 + </view>
  48 + <view class="functionBox">
  49 + <view class="item flexJ" v-for="(item, index) in functionList" :key="item.id" @click="functionC(index)">
  50 + <view class="itemIc flexA">
  51 + <image :src="item.ic" mode=""></image>
  52 + <text>{{ item.name }}</text>
  53 + </view>
  54 + <image src="/static/mineIc/gayRight.png" mode=""></image>
  55 + </view>
  56 + <view class="myService flexJ">
  57 + <view class="service flexA">
  58 + <image src="/static/indexIc/service.png" mode=""></image>
  59 + <text>我的客服</text>
  60 + </view>
  61 + <image src="/static/mineIc/gayRight.png" mode=""></image>
  62 + <button open-type="contact"></button>
  63 + </view>
  64 + </view>
  65 + </view>
  66 + </view>
68 </template> 67 </template>
69 68
70 <script setup> 69 <script setup>
71 - import { ref,reactive} from 'vue'  
72 - import {onShow,onLoad} from '@dcloudio/uni-app'  
73 - import { getMine } from '@/api/'  
74 - onShow(()=>{  
75 - getMines()  
76 - })  
77 - let classList = reactive([{id:1,name:'待付款',num:0,ic:'/static/mineIc/obligation.png'},  
78 - {id:2,name:'待发货',num:0,ic:'/static/mineIc/shipped.png'},  
79 - {id:3,name:'待收货',num:0,ic:'/static/mineIc/received.png'},  
80 - {id:4,name:'待评价',num:0,ic:'/static/mineIc/evaluated.png'},  
81 - {id:5,name:'售后',num:0,ic:'/static/mineIc/afterSales.png'}])  
82 - let functionList = reactive([{id:1,name:'我的余额',ic:'/static/mineIc/balance.png'},  
83 - {id:2,name:'我的积分',ic:'/static/mineIc/collect.png'},  
84 - {id:3,name:'我的地址',ic:'/static/mineIc/addressBlack.png'}])  
85 - let info = ref({})  
86 - // 订单跳转  
87 - const orderStatus = (index)=> {  
88 - uni.navigateTo({  
89 - url:`/pages/mine/myOrder?status=${index==5 ? 0 : Number(index) + 1}`  
90 - })  
91 - }  
92 - // 功能跳转  
93 - const functionC = (index)=> {  
94 - // uni.navigateTo({  
95 - // url:'/pages/mine/' + ( index < 2 ? 'myPoints' : index==1 ? 'myCollection' :'myAddress' )  
96 - // })  
97 - if(index < 2) {  
98 - uni.navigateTo({  
99 - url:`/pages/mine/myPoints?type=${index}`  
100 - })  
101 - } else {  
102 - uni.navigateTo({  
103 - url:'/pages/mine/myAddress'  
104 - })  
105 - }  
106 - }  
107 - // 跳转充值中心  
108 - const toRecharg = ()=> {  
109 - uni.navigateTo({  
110 - url:'/pages/mine/recharge'  
111 - })  
112 - }  
113 - // 个人信息  
114 - const getMines = async ()=>{  
115 - try {  
116 - const res = await getMine()  
117 - classList[0].num = res.dfk  
118 - classList[1].num = res.dfh  
119 - classList[2].num = res.dsh  
120 - classList[3].num = res.ywc  
121 - classList[4].num = res.yth  
122 - info.value = res.userInfo  
123 - console.log('getMine', res)  
124 - // 保存数据  
125 - } catch (err) {  
126 - uni.showToast({ title:err,icon:'none' })  
127 - console.log('getMine', err)  
128 - }  
129 - } 70 +import { ref, reactive } from 'vue'
  71 +import { onShow, onLoad } from '@dcloudio/uni-app'
  72 +import { getMine } from '@/api/'
  73 +onShow(() => {
  74 + getMines()
  75 +})
  76 +let classList = reactive([
  77 + { id: 1, name: '待付款', num: 0, ic: '/static/mineIc/obligation.png' },
  78 + { id: 2, name: '待发货', num: 0, ic: '/static/mineIc/shipped.png' },
  79 + { id: 3, name: '待收货', num: 0, ic: '/static/mineIc/received.png' },
  80 + { id: 4, name: '待评价', num: 0, ic: '/static/mineIc/evaluated.png' },
  81 + { id: 5, name: '售后', num: 0, ic: '/static/mineIc/afterSales.png' }
  82 +])
  83 +let functionList = reactive([
  84 + { id: 1, name: '我的余额', ic: '/static/mineIc/balance.png' },
  85 + { id: 2, name: '我的积分', ic: '/static/mineIc/collect.png' },
  86 + { id: 3, name: '我的地址', ic: '/static/mineIc/addressBlack.png' }
  87 +])
  88 +let info = ref({})
  89 +// 订单跳转
  90 +const orderStatus = index => {
  91 + uni.navigateTo({
  92 + url: `/pages/mine/myOrder?status=${index == 5 ? 0 : Number(index) + 1}`
  93 + })
  94 +}
  95 +// 功能跳转
  96 +const functionC = index => {
  97 + // uni.navigateTo({
  98 + // url:'/pages/mine/' + ( index < 2 ? 'myPoints' : index==1 ? 'myCollection' :'myAddress' )
  99 + // })
  100 + if (index < 2) {
  101 + uni.navigateTo({
  102 + url: `/pages/mine/myPoints?type=${index}`
  103 + })
  104 + } else {
  105 + uni.navigateTo({
  106 + url: '/pages/mine/myAddress'
  107 + })
  108 + }
  109 +}
  110 +// 跳转充值中心
  111 +const toRecharg = () => {
  112 + uni.navigateTo({
  113 + url: '/pages/mine/recharge'
  114 + })
  115 +}
  116 +// 个人信息
  117 +const getMines = async () => {
  118 + try {
  119 + const res = await getMine()
  120 + classList[0].num = res.dfk
  121 + classList[1].num = res.dfh
  122 + classList[2].num = res.dsh
  123 + classList[3].num = res.dpj
  124 + classList[4].num = res.yth
  125 + info.value = res.userInfo
  126 + console.log('getMine', res)
  127 + // 保存数据
  128 + } catch (err) {
  129 + uni.showToast({ title: err, icon: 'none' })
  130 + console.log('getMine', err)
  131 + }
  132 +}
130 </script> 133 </script>
131 134
132 <style lang="scss"> 135 <style lang="scss">
133 - .u-icon__icon {  
134 - display: none !important;  
135 - }  
136 -  
137 - page {  
138 - background-color: #F6F8FA;  
139 - }  
140 -  
141 - .topBgBox {  
142 - width: 100%;  
143 - height: 520rpx;  
144 - padding: 202rpx 24rpx 26rpx;  
145 - box-sizing: border-box;  
146 - opacity: 1;  
147 - background: linear-gradient(180deg, #ffece3ff 0%, #f7f8faff 100%);  
148 -  
149 - .name {  
150 - margin-bottom: 32rpx;  
151 -  
152 - .avatar {  
153 - overflow: hidden;  
154 - margin-right: 40rpx;  
155 - width: 120rpx;  
156 - height: 120rpx;  
157 - border-radius: 50% !important;  
158 - }  
159 - .nicName {  
160 - color: #000000e6;  
161 - font-size: 40rpx;  
162 - font-weight: 700;  
163 - }  
164 - }  
165 -  
166 - .vipBox {  
167 - position: relative;  
168 - width: 702rpx;  
169 - height: 140rpx;  
170 -  
171 - .blackBg {  
172 - width: 100%;  
173 - height: 100%;  
174 - }  
175 -  
176 - .vip {  
177 - width: 642rpx;  
178 - position: absolute;  
179 - top: 28rpx;  
180 - left: 28rpx;  
181 -  
182 - .title {  
183 - color: #ffdcb5ff;  
184 - font-size: 30rpx;  
185 - font-weight: 700;  
186 -  
187 - image {  
188 - margin-right: 8rpx;  
189 - width: 58rpx;  
190 - height: 26rpx;  
191 - }  
192 - }  
193 -  
194 - .btn {  
195 - width: 136rpx;  
196 - height: 56rpx;  
197 - border-radius: 34rpx;  
198 - color: #361e0dff;  
199 - font-size: 26rpx;  
200 - font-weight: 700;  
201 - background: linear-gradient(142.6deg, #fbcd9bff 0%, #ebc295ff 100%);  
202 - box-shadow: inset 0 -6rpx 8rpx 0 #9760217d;  
203 - }  
204 -  
205 - .tip {  
206 - color: #ffffffb3;  
207 - font-size: 22rpx;  
208 - margin-top: 16rpx;  
209 - }  
210 - }  
211 - }  
212 - }  
213 -  
214 - .mainBox {  
215 - width: 100%;  
216 - padding: 0 24rpx;  
217 - box-sizing: border-box;  
218 -  
219 - .orderClass {  
220 - width: 100%;  
221 - padding: 28rpx 24rpx;  
222 - box-sizing: border-box;  
223 - background: #fff;  
224 -  
225 - .classTitle {  
226 - margin-bottom: 28rpx;  
227 -  
228 - .my {  
229 - color: #323233ff;  
230 - font-size: 30rpx;  
231 - font-weight: 700;  
232 - }  
233 -  
234 - .all {  
235 - color: #969799ff;  
236 - font-size: 26rpx;  
237 -  
238 - image {  
239 - margin: 4rpx 0 0 12rpx;  
240 - width: 16rpx;  
241 - height: 32rpx;  
242 - }  
243 - }  
244 - }  
245 -  
246 - .classBox {  
247 -  
248 - .items {  
249 - .badge {  
250 - position: relative;  
251 -  
252 - image {  
253 - width: 48rpx;  
254 - height: 48rpx;  
255 - margin-bottom: 16rpx;  
256 - }  
257 - }  
258 -  
259 - text {  
260 - color: #646566ff;  
261 - font-size: 24rpx;  
262 - }  
263 - }  
264 - }  
265 - }  
266 -  
267 - .functionBox {  
268 - width: 100%;  
269 - padding: 0 32rpx 0 24rpx;  
270 - box-sizing: border-box;  
271 - border-radius: 34rpx;  
272 - margin-top: 24rpx;  
273 - background-color: #fff;  
274 -  
275 - .item {  
276 - width: 100%;  
277 - height: 104rpx;  
278 -  
279 - .itemIc {  
280 - text {  
281 - color: #000000e6;  
282 - font-size: 28rpx;  
283 - }  
284 -  
285 - image {  
286 - margin-right: 24rpx;  
287 - width: 36rpx;  
288 - height: 36rpx;  
289 - }  
290 - }  
291 -  
292 - image {  
293 - width: 16rpx;  
294 - height: 32rpx;  
295 - }  
296 - }  
297 -  
298 - .myService {  
299 - position: relative;  
300 - width: 100%;  
301 - height: 104rpx;  
302 -  
303 - .service {  
304 -  
305 - image {  
306 - margin-right: 24rpx;  
307 - width: 36rpx;  
308 - height: 36rpx;  
309 - }  
310 -  
311 - text {  
312 - color: #000000e6;  
313 - font-size: 28rpx;  
314 - }  
315 - }  
316 -  
317 - button {  
318 - position: absolute;  
319 - width: 100%;  
320 - height: 100%;  
321 - background-color: transparent;  
322 - &::after {  
323 - border: none;  
324 - }  
325 - }  
326 -  
327 - image {  
328 - width: 16rpx;  
329 - height: 32rpx;  
330 - }  
331 - }  
332 - }  
333 - } 136 +.u-icon__icon {
  137 + display: none !important;
  138 +}
  139 +
  140 +page {
  141 + background-color: #f6f8fa;
  142 +}
  143 +
  144 +.topBgBox {
  145 + width: 100%;
  146 + height: 520rpx;
  147 + padding: 202rpx 24rpx 26rpx;
  148 + box-sizing: border-box;
  149 + opacity: 1;
  150 + background: linear-gradient(180deg, #ffece3ff 0%, #f7f8faff 100%);
  151 +
  152 + .name {
  153 + margin-bottom: 32rpx;
  154 +
  155 + .avatar {
  156 + overflow: hidden;
  157 + margin-right: 40rpx;
  158 + width: 120rpx;
  159 + height: 120rpx;
  160 + border-radius: 50% !important;
  161 + }
  162 + .nicName {
  163 + color: #000000e6;
  164 + font-size: 40rpx;
  165 + font-weight: 700;
  166 + }
  167 + }
  168 +
  169 + .vipBox {
  170 + position: relative;
  171 + width: 702rpx;
  172 + height: 140rpx;
  173 +
  174 + .blackBg {
  175 + width: 100%;
  176 + height: 100%;
  177 + }
  178 +
  179 + .vip {
  180 + width: 642rpx;
  181 + position: absolute;
  182 + top: 28rpx;
  183 + left: 28rpx;
  184 +
  185 + .title {
  186 + color: #ffdcb5ff;
  187 + font-size: 30rpx;
  188 + font-weight: 700;
  189 +
  190 + image {
  191 + margin-right: 8rpx;
  192 + width: 58rpx;
  193 + height: 26rpx;
  194 + }
  195 + }
  196 +
  197 + .btn {
  198 + width: 136rpx;
  199 + height: 56rpx;
  200 + border-radius: 34rpx;
  201 + color: #361e0dff;
  202 + font-size: 26rpx;
  203 + font-weight: 700;
  204 + background: linear-gradient(142.6deg, #fbcd9bff 0%, #ebc295ff 100%);
  205 + box-shadow: inset 0 -6rpx 8rpx 0 #9760217d;
  206 + }
  207 +
  208 + .tip {
  209 + color: #ffffffb3;
  210 + font-size: 22rpx;
  211 + margin-top: 16rpx;
  212 + }
  213 + }
  214 + }
  215 +}
  216 +
  217 +.mainBox {
  218 + width: 100%;
  219 + padding: 0 24rpx;
  220 + box-sizing: border-box;
  221 +
  222 + .orderClass {
  223 + width: 100%;
  224 + padding: 28rpx 24rpx;
  225 + box-sizing: border-box;
  226 + background: #fff;
  227 +
  228 + .classTitle {
  229 + margin-bottom: 28rpx;
  230 +
  231 + .my {
  232 + color: #323233ff;
  233 + font-size: 30rpx;
  234 + font-weight: 700;
  235 + }
  236 +
  237 + .all {
  238 + color: #969799ff;
  239 + font-size: 26rpx;
  240 +
  241 + image {
  242 + margin: 4rpx 0 0 12rpx;
  243 + width: 16rpx;
  244 + height: 32rpx;
  245 + }
  246 + }
  247 + }
  248 +
  249 + .classBox {
  250 + .items {
  251 + .badge {
  252 + position: relative;
  253 +
  254 + image {
  255 + width: 48rpx;
  256 + height: 48rpx;
  257 + margin-bottom: 16rpx;
  258 + }
  259 + }
  260 +
  261 + text {
  262 + color: #646566ff;
  263 + font-size: 24rpx;
  264 + }
  265 + }
  266 + }
  267 + }
  268 +
  269 + .functionBox {
  270 + width: 100%;
  271 + padding: 0 32rpx 0 24rpx;
  272 + box-sizing: border-box;
  273 + border-radius: 34rpx;
  274 + margin-top: 24rpx;
  275 + background-color: #fff;
  276 +
  277 + .item {
  278 + width: 100%;
  279 + height: 104rpx;
  280 +
  281 + .itemIc {
  282 + text {
  283 + color: #000000e6;
  284 + font-size: 28rpx;
  285 + }
  286 +
  287 + image {
  288 + margin-right: 24rpx;
  289 + width: 36rpx;
  290 + height: 36rpx;
  291 + }
  292 + }
  293 +
  294 + image {
  295 + width: 16rpx;
  296 + height: 32rpx;
  297 + }
  298 + }
  299 +
  300 + .myService {
  301 + position: relative;
  302 + width: 100%;
  303 + height: 104rpx;
  304 +
  305 + .service {
  306 + image {
  307 + margin-right: 24rpx;
  308 + width: 36rpx;
  309 + height: 36rpx;
  310 + }
  311 +
  312 + text {
  313 + color: #000000e6;
  314 + font-size: 28rpx;
  315 + }
  316 + }
  317 +
  318 + button {
  319 + position: absolute;
  320 + width: 100%;
  321 + height: 100%;
  322 + background-color: transparent;
  323 + &::after {
  324 + border: none;
  325 + }
  326 + }
  327 +
  328 + image {
  329 + width: 16rpx;
  330 + height: 32rpx;
  331 + }
  332 + }
  333 + }
  334 +}
334 </style> 335 </style>
1 <template> 1 <template>
2 - <!-- 我的地址列表 -->  
3 - <view>  
4 - <u-navbar placeholder title="我的地址" bgColor="#fff" :autoBack="true"></u-navbar>  
5 - <view class="mainBox">  
6 - <view class="addressBox" v-for="item in addressList" :key="item.id" @click="checkAddress(item)">  
7 - <view class="topBox flexJ">  
8 - <view class="nameBox flexA">  
9 - <image src="/static/mineIc/redAddress.png" mode=""></image>  
10 - <view class="name">{{item.name}}</view>  
11 - <text>{{item.mobile}}</text>  
12 - </view>  
13 - <view class="rightIc flexA">  
14 - <image @click.stop="del(item.id)" src="/static/mineIc/delAddress.png" mode=""></image>  
15 - <image @click.stop="newAdd(0,item.id)" src="/static/mineIc/edit.png" mode=""></image>  
16 - </view>  
17 - </view>  
18 - <view class="area">  
19 - {{item.diqu}}  
20 - <test>{{item.address}}</test>  
21 - </view>  
22 - </view>  
23 - </view>  
24 - <!-- 地址列表为空 -->  
25 - <view class="addressNull flexV" v-if="!addressList">  
26 - <image src="/static/mineIc/addressNull.png" mode=""></image>  
27 - <text>暂无收货地址</text>  
28 - </view>  
29 - <view class="btnBox iosAuto">  
30 - <view class="btn flexC" @click="newAdd(1)">新建收货地址</view>  
31 - </view>  
32 - </view> 2 + <!-- 我的地址列表 -->
  3 + <view>
  4 + <u-navbar placeholder title="我的地址" bgColor="#fff" :autoBack="true"></u-navbar>
  5 + <view class="mainBox">
  6 + <view class="addressBox" v-for="item in addressList" :key="item.id" @click="checkAddress(item)">
  7 + <view class="topBox flexJ">
  8 + <view class="nameBox flexA">
  9 + <image src="/static/mineIc/redAddress.png" mode=""></image>
  10 + <view class="name">{{ item.name }}</view>
  11 + <text>{{ item.mobile }}</text>
  12 + </view>
  13 + <view class="rightIc flexA">
  14 + <image @click.stop="del(item.id)" src="/static/mineIc/delAddress.png" mode=""></image>
  15 + <image @click.stop="newAdd(0, item.id)" src="/static/mineIc/edit.png" mode=""></image>
  16 + </view>
  17 + </view>
  18 + <view class="area">
  19 + {{ item.diqu }}
  20 + <test>{{ item.address }}</test>
  21 + </view>
  22 + </view>
  23 + </view>
  24 + <!-- 地址列表为空 -->
  25 + <view class="addressNull flexV" v-if="!addressList">
  26 + <image src="/static/mineIc/addressNull.png" mode=""></image>
  27 + <text>暂无收货地址</text>
  28 + </view>
  29 + <view class="btnBox iosAuto">
  30 + <view class="btn flexC" @click="newAdd(1)">新建收货地址</view>
  31 + </view>
  32 + </view>
33 </template> 33 </template>
34 34
35 <script setup> 35 <script setup>
36 - import { ref, reactive } from 'vue'  
37 - import {onShow,onLoad} from '@dcloudio/uni-app'  
38 - import { getAdressList,getDelAdres } from '@/api/'  
39 - onShow(()=>{  
40 - getAdressLists() //地址列表  
41 - })  
42 - onLoad((e)=> {  
43 - isCheck.value = e.isCheck //是否选这地址  
44 - })  
45 - const addressList = ref([])  
46 - //type==0 修改地址 - 新建地址  
47 - const newAdd = (type,id)=> {  
48 - uni.navigateTo({  
49 - url:`/pages/mine/newAddress?id=${type == 0 ? id :''}`  
50 - })  
51 - }  
52 - let isCheck = ref(0)  
53 - // 选这地址  
54 - const checkAddress = (item)=> {  
55 - if(isCheck.value == 1) {  
56 - const pop = getCurrentPages().pop();  
57 - pop.$vm.getOpenerEventChannel().emit("steBack", item)  
58 - uni.navigateBack()  
59 - }  
60 - }  
61 - const del = (id)=> {  
62 - uni.showModal({  
63 - title: '提示',  
64 - content: '确认删除此地址吗',  
65 - success: function (res) {  
66 - if (res.confirm) {  
67 - getDelAdress(id)  
68 - }  
69 - }  
70 - });  
71 - }  
72 - // 删除地址  
73 - const getDelAdress = async (ids)=> {  
74 - try {  
75 - const res = await getDelAdres(ids)  
76 - uni.showToast({ title:'删除成功!',icon:'none' })  
77 - getAdressLists()  
78 - console.log('getDelAdres', res)  
79 - // 保存数据  
80 - } catch (err) {  
81 - console.log('getDelAdres', err)  
82 - }  
83 - }  
84 - // 获取地址列表  
85 - const getAdressLists = async ()=>{  
86 - try {  
87 - const res = await getAdressList()  
88 - addressList.value = res  
89 - let defaultAdres = res.find(item=>item.is_default == 1) //默认地址  
90 - uni.setStorageSync('defaultAdres',defaultAdres)  
91 - console.log('getAdressList', res)  
92 - // 保存数据  
93 - } catch (err) {  
94 - uni.showToast({ title:err,icon:'none' })  
95 - console.log('getAdressList', err)  
96 - }  
97 - } 36 +import { ref, reactive } from 'vue'
  37 +import { onShow, onLoad } from '@dcloudio/uni-app'
  38 +import { getAdressList, getDelAdres } from '@/api/'
  39 +
  40 +const addressList = ref([])
  41 +
  42 +onShow(() => {
  43 + addressList.value.splice(0)
  44 + getAdressLists() //地址列表
  45 +})
  46 +onLoad(e => {
  47 + isCheck.value = e.isCheck //是否选这地址
  48 +})
  49 +//type==0 修改地址 - 新建地址
  50 +const newAdd = (type, id) => {
  51 + console.log(type, id, 'type id是什么')
  52 + uni.navigateTo({
  53 + url: `/pages/mine/newAddress?id=${type == 0 ? id : ''}`
  54 + })
  55 +}
  56 +let isCheck = ref(0)
  57 +// 选这地址
  58 +const checkAddress = item => {
  59 + if (isCheck.value == 1) {
  60 + const pop = getCurrentPages().pop()
  61 + pop.$vm.getOpenerEventChannel().emit('steBack', item)
  62 + uni.navigateBack()
  63 + }
  64 +}
  65 +const del = id => {
  66 + uni.showModal({
  67 + title: '提示',
  68 + content: '确认删除此地址吗',
  69 + success: function (res) {
  70 + if (res.confirm) {
  71 + getDelAdress(id)
  72 + }
  73 + }
  74 + })
  75 +}
  76 +// 删除地址
  77 +const getDelAdress = async ids => {
  78 + try {
  79 + const res = await getDelAdres(ids)
  80 + uni.showToast({ title: '删除成功!', icon: 'none' })
  81 + getAdressLists()
  82 + console.log('getDelAdres', res)
  83 + // 保存数据
  84 + } catch (err) {
  85 + console.log('getDelAdres', err)
  86 + }
  87 +}
  88 +// 获取地址列表
  89 +const getAdressLists = async () => {
  90 + try {
  91 + const res = await getAdressList()
  92 + addressList.value = res
  93 + let defaultAdres = res.find(item => item.is_default == 1) //默认地址
  94 + uni.setStorageSync('defaultAdres', defaultAdres)
  95 + console.log('getAdressList', res)
  96 + // 保存数据
  97 + } catch (err) {
  98 + uni.showToast({ title: err, icon: 'none' })
  99 + console.log('getAdressList', err)
  100 + }
  101 +}
98 </script> 102 </script>
99 103
100 <style lang="scss"> 104 <style lang="scss">
101 - .mainBox {  
102 - background: #f8f9feff;  
103 -  
104 - .addressBox {  
105 - width: 100%;  
106 - padding: 44rpx 32rpx;  
107 - box-sizing: border-box;  
108 - background: #fff;  
109 - margin-bottom: 12rpx;  
110 -  
111 - .topBox {  
112 - margin-bottom: 18rpx;  
113 -  
114 - .nameBox {  
115 - image {  
116 - width: 32rpx;  
117 - height: 32rpx;  
118 - }  
119 -  
120 - .name {  
121 - color: #000000cc;  
122 - font-size: 32rpx;  
123 - font-weight: 700;  
124 - margin: 0 20rpx;  
125 - }  
126 -  
127 - text {  
128 - color: #000000cc;  
129 - font-size: 28rpx;  
130 - font-weight: 700;  
131 - }  
132 - }  
133 -  
134 - .rightIc {  
135 - image {  
136 - margin-left: 32rpx;  
137 - width: 36rpx;  
138 - height: 36rpx;  
139 - }  
140 - }  
141 - }  
142 -  
143 - .area {  
144 - color: #00000066;  
145 - font-size: 26rpx;  
146 -  
147 - text {  
148 - margin-left: 8rpx;  
149 - }  
150 - }  
151 - }  
152 - }  
153 -  
154 - .addressNull {  
155 - margin-top: 266rpx;  
156 -  
157 - image {  
158 - width: 266rpx;  
159 - height: 266rpx;  
160 - }  
161 -  
162 - text {  
163 - color: #00000066;  
164 - font-size: 26rpx;  
165 - }  
166 - }  
167 -  
168 - .btnBox {  
169 - position: fixed;  
170 - left: 0;  
171 - bottom: 0;  
172 - background: #fff;  
173 - width: 100%;  
174 - height: 120rpx;  
175 -  
176 - .btn {  
177 - width: 686rpx;  
178 - height: 88rpx;  
179 - border-radius: 12rpx;  
180 - color: #ffffffff;  
181 - font-size: 32rpx;  
182 - font-weight: 700;  
183 - margin: 0 auto;  
184 - background: linear-gradient(139deg, #fb753cff 0%, #fb3e3cff 100%);  
185 - }  
186 - } 105 +.mainBox {
  106 + background: #f8f9feff;
  107 +
  108 + .addressBox {
  109 + width: 100%;
  110 + padding: 44rpx 32rpx;
  111 + box-sizing: border-box;
  112 + background: #fff;
  113 + margin-bottom: 12rpx;
  114 +
  115 + .topBox {
  116 + margin-bottom: 18rpx;
  117 +
  118 + .nameBox {
  119 + image {
  120 + width: 32rpx;
  121 + height: 32rpx;
  122 + }
  123 +
  124 + .name {
  125 + color: #000000cc;
  126 + font-size: 32rpx;
  127 + font-weight: 700;
  128 + margin: 0 20rpx;
  129 + }
  130 +
  131 + text {
  132 + color: #000000cc;
  133 + font-size: 28rpx;
  134 + font-weight: 700;
  135 + }
  136 + }
  137 +
  138 + .rightIc {
  139 + image {
  140 + margin-left: 32rpx;
  141 + width: 36rpx;
  142 + height: 36rpx;
  143 + }
  144 + }
  145 + }
  146 +
  147 + .area {
  148 + color: #00000066;
  149 + font-size: 26rpx;
  150 +
  151 + text {
  152 + margin-left: 8rpx;
  153 + }
  154 + }
  155 + }
  156 +}
  157 +
  158 +.addressNull {
  159 + margin-top: 266rpx;
  160 +
  161 + image {
  162 + width: 266rpx;
  163 + height: 266rpx;
  164 + }
  165 +
  166 + text {
  167 + color: #00000066;
  168 + font-size: 26rpx;
  169 + }
  170 +}
  171 +
  172 +.btnBox {
  173 + position: fixed;
  174 + left: 0;
  175 + bottom: 0;
  176 + background: #fff;
  177 + width: 100%;
  178 + height: 120rpx;
  179 +
  180 + .btn {
  181 + width: 686rpx;
  182 + height: 88rpx;
  183 + border-radius: 12rpx;
  184 + color: #ffffffff;
  185 + font-size: 32rpx;
  186 + font-weight: 700;
  187 + margin: 0 auto;
  188 + background: linear-gradient(139deg, #fb753cff 0%, #fb3e3cff 100%);
  189 + }
  190 +}
187 </style> 191 </style>
@@ -77,7 +77,7 @@ onLoad(e => { @@ -77,7 +77,7 @@ onLoad(e => {
77 }) 77 })
78 onShow(() => { 78 onShow(() => {
79 console.log('订单状态', tabStatus.value) 79 console.log('订单状态', tabStatus.value)
80 - getOrderLists(tabStatus.value == 5 ? 21 : tabStatus.value * 1) 80 + getOrderLists(tabStatus.value == 5 ? 21 : tabStatus.value == 4 ? 5 : tabStatus.value * 1)
81 }) 81 })
82 let tabStatus = ref(0) //订单状态 82 let tabStatus = ref(0) //订单状态
83 let orderList = ref([]) //订单 83 let orderList = ref([]) //订单
@@ -94,7 +94,7 @@ const operateOrder = (item, type) => { @@ -94,7 +94,7 @@ const operateOrder = (item, type) => {
94 getReceipts() //确认收货 94 getReceipts() //确认收货
95 } else if (type == 4) { 95 } else if (type == 4) {
96 uni.navigateTo({ 96 uni.navigateTo({
97 - url: '/pages/mine/evaluate' 97 + url: `/pages/mine/evaluate?id=${item.id}`
98 }) 98 })
99 } else if (type == 5) { 99 } else if (type == 5) {
100 toDetaile(item.id) 100 toDetaile(item.id)
@@ -134,7 +134,7 @@ const click = e => { @@ -134,7 +134,7 @@ const click = e => {
134 console.log(e) 134 console.log(e)
135 getOrderLists(e.index == 5 ? 21 : e.index == 4 ? 5 : e.index) 135 getOrderLists(e.index == 5 ? 21 : e.index == 4 ? 5 : e.index)
136 } 136 }
137 -//订单状态: 0=全部,1=待付款,2=待发货,3=待收货,4=待评价,11=已取消,21=售后 137 +// 订单状态: 0=全部,1=待付款,2=待发货,3=待收货,4=待评价,11=已取消,21=售后
138 const getOrderLists = async status => { 138 const getOrderLists = async status => {
139 try { 139 try {
140 const res = await getOrderList(status) 140 const res = await getOrderList(status)
@@ -65,7 +65,7 @@ const getyues = async () => { @@ -65,7 +65,7 @@ const getyues = async () => {
65 const getMoneyDetails = async () => { 65 const getMoneyDetails = async () => {
66 try { 66 try {
67 const res = await getMoneyDetail() 67 const res = await getMoneyDetail()
68 - recordList.value = res.mingxi 68 + recordList.value = res
69 console.log('getMoneyDetail', res) 69 console.log('getMoneyDetail', res)
70 // 保存数据 70 // 保存数据
71 } catch (err) { 71 } catch (err) {
1 <template> 1 <template>
2 - <!-- 新建地址 -->  
3 - <view>  
4 - <u-navbar placeholder :title=" editId=='' ? '新建地址' : '修改地址' " bgColor="#f7f8faff" :autoBack="true"></u-navbar>  
5 - <view class="formBox flexA" v-for="item in formList" :key="item.id">  
6 - <view class="formTitle">{{item.name}}</view>  
7 - <input type="text" v-model="item.model" placeholder-class="gay" :placeholder="item.place" v-if="item.type == 'input'">  
8 - <view class="checkBox flexJ" :class="item.model!= ''? 'black' :'' " v-else @click="showPop">  
9 - <text>{{item.model == '' ? '选择地区' : item.model}}</text>  
10 - <image src="/static/mineIc/rightGayS.png" mode=""></image>  
11 - </view>  
12 - </view>  
13 - <view class="formBox flexJ">  
14 - <view class="defaults">设置为默认地址</view>  
15 - <view class="switch">  
16 - <u-switch activeColor="#FB623C" v-model="isDefault" @change="change"></u-switch>  
17 - </view>  
18 - </view>  
19 - <view class="btn flexC" @click="getEdits">保存</view>  
20 - <chekcArea @close="close" @popShow="popShow" :shows="shows"></chekcArea>  
21 - </view> 2 + <!-- 新建地址 -->
  3 + <view>
  4 + <u-navbar placeholder :title="editId == '' ? '新建地址' : '修改地址'" bgColor="#f7f8faff" :autoBack="true"></u-navbar>
  5 + <view class="formBox flexA" v-for="item in formList" :key="item.id">
  6 + <view class="formTitle">{{ item.name }}</view>
  7 + <input type="text" v-model="item.model" placeholder-class="gay" :placeholder="item.place" v-if="item.type == 'input'" />
  8 + <view class="checkBox flexJ" :class="item.model != '' ? 'black' : ''" v-else @click="showPop">
  9 + <text>{{ item.model == '' ? '选择地区' : item.model }}</text>
  10 + <image src="/static/mineIc/rightGayS.png" mode=""></image>
  11 + </view>
  12 + </view>
  13 + <view class="formBox flexJ">
  14 + <view class="defaults">设置为默认地址</view>
  15 + <view class="switch">
  16 + <u-switch activeColor="#FB623C" v-model="isDefault" @change="change"></u-switch>
  17 + </view>
  18 + </view>
  19 + <view class="btn flexC" @click="getEdits">保存</view>
  20 + <chekcArea @close="close" @popShow="popShow" :shows="shows"></chekcArea>
  21 + </view>
22 </template> 22 </template>
23 23
24 <script setup> 24 <script setup>
25 - import { ref, reactive } from 'vue'  
26 - import {onShow,onLoad} from '@dcloudio/uni-app'  
27 - import chekcArea from '@/componets/areaCheck.vue'  
28 - import { getEdit,getadresDetail } from '@/api/'  
29 - onLoad((e)=> {  
30 - editId.value = e.id //修改地址id  
31 - console.log('修改地址id',e.id)  
32 - if(e.id) {  
33 - getadresDetails(e.id) //地址详情  
34 - }  
35 - })  
36 - const formList = reactive([{id:1,name:'收货人',model:'',type:'input',place:'姓名'},  
37 - {id:2,name:'手机号',model:'',type:'input',place:'手机号码'},  
38 - {id:3,name:'所在地区',model:'',type:'check',place:'选这地区'},  
39 - {id:4,name:'详细地址',model:'',type:'input',place:'请填写详细地址'}])  
40 - let shows = ref(false)  
41 - const showPop = ()=> {  
42 - shows.value = true  
43 - }  
44 - const close = (data)=> {  
45 - shows.value = false  
46 - }  
47 - const popShow = (data)=> {  
48 - shows.value = false  
49 - formList[2].model = data.join('-')  
50 - console.log('省市区数据',data)  
51 - }  
52 - const isDefault = ref(false)  
53 - // 默认地址  
54 - const change = (e)=> {  
55 - console.log('默认地址', e);  
56 - isDefault.value = e  
57 - }  
58 - // 地址详情  
59 - const getadresDetails = async (id)=>{  
60 - try {  
61 - const res = await getadresDetail(id)  
62 - formList[0].model = res.name  
63 - formList[1].model = res.mobile  
64 - formList[2].model = res.diqu  
65 - formList[3].model = res.address  
66 - isDefault.value = res.is_default == 1 ? true : false  
67 - console.log('getadresDetail', res)  
68 - // 保存数据  
69 - } catch (err) {  
70 - uni.showToast({ title:err,icon:'none' })  
71 - console.log('getadresDetail', err)  
72 - }  
73 - }  
74 - let editId = ref('') //修改地址的id  
75 - // 修改 / 新建地址  
76 - const getEdits = async ()=>{  
77 - try {  
78 - let params = {  
79 - id:editId.value, //integer 否 地址ID—修改时必须  
80 - name:formList[0].model, //string 是 姓名  
81 - mobile:formList[1].model, //string 是 联系方式  
82 - diqu:formList[2].model, //string 是 所在地区  
83 - is_default:isDefault.value ? 1 : 0, //string 是 是否为默认地址1是  
84 - address:formList[3].model, //string 是 详细地址  
85 - }  
86 - const res = await getEdit(params)  
87 - uni.showToast({ title: editId.value == '' ? '新建地址成功' : '已修改',icon:'none' })  
88 - setTimeout(()=> {  
89 - uni.navigateBack()  
90 - },1000)  
91 - console.log('getEdit', res)  
92 - // 保存数据  
93 - } catch (err) {  
94 - uni.showToast({ title:err,icon:'none' })  
95 - console.log('getEdit', err)  
96 - }  
97 - } 25 +import { ref, reactive } from 'vue'
  26 +import { onShow, onLoad } from '@dcloudio/uni-app'
  27 +import chekcArea from '@/componets/areaCheck.vue'
  28 +import { getEdit, getadresDetail } from '@/api/'
  29 +onLoad(e => {
  30 + editId.value = e.id //修改地址id
  31 + console.log('修改地址id', e.id)
  32 + if (e.id) {
  33 + getadresDetails(e.id) //地址详情
  34 + }
  35 +})
  36 +const formList = reactive([
  37 + { id: 1, name: '收货人', model: '', type: 'input', place: '姓名' },
  38 + { id: 2, name: '手机号', model: '', type: 'input', place: '手机号码' },
  39 + { id: 3, name: '所在地区', model: '', type: 'check', place: '选这地区' },
  40 + { id: 4, name: '详细地址', model: '', type: 'input', place: '请填写详细地址' }
  41 +])
  42 +let shows = ref(false)
  43 +const showPop = () => {
  44 + shows.value = true
  45 +}
  46 +const close = data => {
  47 + shows.value = false
  48 +}
  49 +const popShow = data => {
  50 + shows.value = false
  51 + formList[2].model = data.join('-')
  52 + console.log('省市区数据', data)
  53 +}
  54 +const isDefault = ref(false)
  55 +// 默认地址
  56 +const change = e => {
  57 + console.log('默认地址', e)
  58 + isDefault.value = e
  59 +}
  60 +// 地址详情
  61 +const getadresDetails = async id => {
  62 + try {
  63 + const res = await getadresDetail(id)
  64 + formList[0].model = res.name
  65 + formList[1].model = res.mobile
  66 + formList[2].model = res.diqu
  67 + formList[3].model = res.address
  68 + isDefault.value = res.is_default == 1 ? true : false
  69 + console.log('getadresDetail', res)
  70 + // 保存数据
  71 + } catch (err) {
  72 + uni.showToast({ title: err, icon: 'none' })
  73 + console.log('getadresDetail', err)
  74 + }
  75 +}
  76 +let editId = ref('') //修改地址的id
  77 +// 修改 / 新建地址
  78 +const getEdits = async () => {
  79 + try {
  80 + let params = {
  81 + id: editId.value, //integer 否 地址ID—修改时必须
  82 + name: formList[0].model, //string 是 姓名
  83 + mobile: formList[1].model, //string 是 联系方式
  84 + diqu: formList[2].model, //string 是 所在地区
  85 + is_default: isDefault.value ? 1 : 0, //string 是 是否为默认地址1是
  86 + address: formList[3].model //string 是 详细地址
  87 + }
  88 + const res = await getEdit(params)
  89 + uni.showToast({ title: editId.value == '' ? '新建地址成功' : '已修改', icon: 'none' })
  90 + setTimeout(() => {
  91 + uni.navigateBack()
  92 + }, 1000)
  93 + console.log('getEdit', res)
  94 + // 保存数据
  95 + } catch (err) {
  96 + uni.showToast({ title: err, icon: 'none' })
  97 + console.log('getEdit', err)
  98 + }
  99 +}
98 </script> 100 </script>
99 101
100 <style lang="scss"> 102 <style lang="scss">
101 - page {  
102 - background: #f7f8faff;  
103 - } 103 +page {
  104 + background: #f7f8faff;
  105 +}
104 106
105 - .formBox {  
106 - padding: 32rpx;  
107 - background: #fff; 107 +.formBox {
  108 + padding: 32rpx;
  109 + background: #fff;
108 110
109 - .formTitle {  
110 - min-width: 112rpx;  
111 - margin-right: 152rpx;  
112 - color: #000000cc;  
113 - font-size: 28rpx;  
114 - }  
115 -  
116 - input {  
117 - color: #000000cc;  
118 - font-size: 28rpx;  
119 - }  
120 -  
121 - .gay {  
122 - color: #00000066;  
123 - font-size: 28rpx;  
124 - }  
125 -  
126 - .checkBox {  
127 - width: 100%;  
128 - color: #00000066;  
129 - font-size: 28rpx;  
130 -  
131 - image {  
132 - width: 24rpx;  
133 - height: 24rpx;  
134 - }  
135 - }  
136 -  
137 - .black {  
138 - color: #000000cc;  
139 - font-size: 28rpx;  
140 - }  
141 -  
142 - .defaults {  
143 - color: #000000cc;  
144 - font-size: 28rpx;  
145 - font-weight: 700;  
146 - }  
147 - }  
148 -  
149 - .btn {  
150 - width: 686rpx;  
151 - height: 88rpx;  
152 - border-radius: 12rpx;  
153 - color: #ffffffff;  
154 - font-size: 32rpx;  
155 - font-weight: 700;  
156 - margin: 188rpx auto 0;  
157 - background: linear-gradient(139deg, #fb753cff 0%, #fb3e3cff 100%);  
158 - } 111 + .formTitle {
  112 + min-width: 112rpx;
  113 + margin-right: 152rpx;
  114 + color: #000000cc;
  115 + font-size: 28rpx;
  116 + }
  117 +
  118 + input {
  119 + color: #000000cc;
  120 + font-size: 28rpx;
  121 + }
  122 +
  123 + .gay {
  124 + color: #00000066;
  125 + font-size: 28rpx;
  126 + }
  127 +
  128 + .checkBox {
  129 + width: 100%;
  130 + color: #00000066;
  131 + font-size: 28rpx;
  132 +
  133 + image {
  134 + width: 24rpx;
  135 + height: 24rpx;
  136 + }
  137 + }
  138 +
  139 + .black {
  140 + color: #000000cc;
  141 + font-size: 28rpx;
  142 + }
  143 +
  144 + .defaults {
  145 + color: #000000cc;
  146 + font-size: 28rpx;
  147 + font-weight: 700;
  148 + }
  149 +}
  150 +
  151 +.btn {
  152 + width: 686rpx;
  153 + height: 88rpx;
  154 + border-radius: 12rpx;
  155 + color: #ffffffff;
  156 + font-size: 32rpx;
  157 + font-weight: 700;
  158 + margin: 188rpx auto 0;
  159 + background: linear-gradient(139deg, #fb753cff 0%, #fb3e3cff 100%);
  160 +}
159 </style> 161 </style>
@@ -46,7 +46,15 @@ @@ -46,7 +46,15 @@
46 <view v-if="btnType == 1 || btnType == 3" class="red flexC" @click="btns(1)">{{ btnType == 1 ? '立即支付' : '确认收货' }}</view> 46 <view v-if="btnType == 1 || btnType == 3" class="red flexC" @click="btns(1)">{{ btnType == 1 ? '立即支付' : '确认收货' }}</view>
47 </view> 47 </view>
48 <!-- 选择支付方式 --> 48 <!-- 选择支付方式 -->
49 - <payMode @canclePop="modeShow = false" :orderId="orderId" :isOrderPay="true" :totalPrice="orderList.total_price" :modeShow="modeShow"></payMode> 49 + <payMode
  50 + @canclePop="modeShow = false"
  51 + :balance="balance"
  52 + :orderId="orderId"
  53 + :isOrderPay="true"
  54 + :totalPrice="orderList.total_price"
  55 + :modeShow="modeShow"
  56 + ></payMode>
  57 +
50 <!-- 提示弹窗 --> 58 <!-- 提示弹窗 -->
51 <tipPops @pointsBtns="pointsBtns" :integral="integral" :tipType="tipType" :tipShow="tipShow"></tipPops> 59 <tipPops @pointsBtns="pointsBtns" :integral="integral" :tipType="tipType" :tipShow="tipShow"></tipPops>
52 </view> 60 </view>
@@ -59,7 +67,7 @@ import shopAddres from '@/componets/address.vue' @@ -59,7 +67,7 @@ import shopAddres from '@/componets/address.vue'
59 import orderShops from '@/componets/orderShop.vue' 67 import orderShops from '@/componets/orderShop.vue'
60 import tipPops from '@/componets/tipPop.vue' 68 import tipPops from '@/componets/tipPop.vue'
61 import PayMode from '@/componets/checkPayMode.vue' 69 import PayMode from '@/componets/checkPayMode.vue'
62 -import { getOrderdetail, getCancleOrder, getRefund, getReceipt } from '@/api/' 70 +import { getOrderdetail, getCancleOrder, getRefund, getReceipt, getyue } from '@/api/'
63 onLoad(e => { 71 onLoad(e => {
64 console.log(e.id) 72 console.log(e.id)
65 orderId.value = e.id 73 orderId.value = e.id
@@ -72,6 +80,7 @@ let orderId = ref('') //订单id @@ -72,6 +80,7 @@ let orderId = ref('') //订单id
72 let btnType = ref(1) //按钮状态 80 let btnType = ref(1) //按钮状态
73 let integral = ref(0) //积分 81 let integral = ref(0) //积分
74 let tipType = ref(1) //1取消支付 2取消订单 82 let tipType = ref(1) //1取消支付 2取消订单
  83 +let balance = ref(0) //余额
75 let placeOrder = ref([ 84 let placeOrder = ref([
76 { id: 1, name: '订单编号', text: '1212' }, 85 { id: 1, name: '订单编号', text: '1212' },
77 { id: 2, name: '支付方式', text: '1212' }, 86 { id: 2, name: '支付方式', text: '1212' },
@@ -79,6 +88,21 @@ let placeOrder = ref([ @@ -79,6 +88,21 @@ let placeOrder = ref([
79 { id: 4, name: '快递编号', text: '1212' } 88 { id: 4, name: '快递编号', text: '1212' }
80 ]) 89 ])
81 90
  91 +onShow(() => {
  92 + getyues()
  93 +})
  94 +
  95 +const getyues = async () => {
  96 + try {
  97 + const res = await getyue()
  98 + balance.value = res.money
  99 + // 保存数据
  100 + } catch (err) {
  101 + uni.showToast({ title: err, icon: 'none' })
  102 + console.log('getyue', err)
  103 + }
  104 +}
  105 +
82 const leftClickHandler = () => { 106 const leftClickHandler = () => {
83 // const pages = getCurrentPages() 107 // const pages = getCurrentPages()
84 // const page = pages[pages.length - 2] 108 // const page = pages[pages.length - 2]
@@ -134,6 +134,12 @@ const _sfc_main = { @@ -134,6 +134,12 @@ const _sfc_main = {
134 proxy.$methods.pay(res); 134 proxy.$methods.pay(res);
135 canclePop(); 135 canclePop();
136 console.log("getOrderPay", res); 136 console.log("getOrderPay", res);
  137 + if (defaultMode.value === 1) {
  138 + common_vendor.index.showToast({ title: "\u652F\u4ED8\u6210\u529F", icon: "none" });
  139 + setTimeout(() => {
  140 + common_vendor.index.navigateBack();
  141 + }, 1500);
  142 + }
137 } catch (err) { 143 } catch (err) {
138 common_vendor.index.showToast({ title: err, icon: "none" }); 144 common_vendor.index.showToast({ title: err, icon: "none" });
139 console.log("getOrderPay", err); 145 console.log("getOrderPay", err);
1 -<view><u-navbar wx:if="{{a}}" u-s="{{['left']}}" u-i="0a7f8b7d-0" bind:__l="__l" u-p="{{a}}"><view class="u-nav-slot" slot="left">大健康商城</view></u-navbar><view class="topBgBox"><image src="/static/indexIc/topBg.png" mode=""></image><view class="searchBox"><search u-i="0a7f8b7d-1" bind:__l="__l"></search><view class="vip flexC" bindtap="{{b}}"><image src="/static/indexIc/vip.png" mode=""></image></view></view></view><view class="classBox"><view wx:for="{{c}}" wx:for-item="item" wx:key="c" class="itemClss flexV" bindtap="{{item.d}}"><image src="{{item.a}}" mode=""></image><text>{{item.b}}</text></view><view class="itemClss flexV" bindtap="{{d}}"><image src="/static/indexIc/classIc.png" mode=""></image><text>更多</text></view></view><view class="specialOffer"><image class="pinkBg" src="/static/indexIc/pinkBg.png" mode=""></image><view class="special"><view class="topBox flexJ"><view class="titles"><view class="title">特价专区</view><text>Special price zone</text></view><view class="more flexA" bindtap="{{e}}"> 更多 <image src="/static/indexIc/orangeRight.png" mode=""></image></view></view><view class="shop"><shops wx:if="{{f}}" u-i="0a7f8b7d-2" bind:__l="__l" u-p="{{f}}"></shops></view></view></view><view class="recom flexA"><image src="/static/indexIc/recommendIc.png" mode=""></image> 推荐商品 <text>限时限量好物推荐</text></view><view class="recomBox"><shops wx:if="{{g}}" u-i="0a7f8b7d-3" bind:__l="__l" u-p="{{g}}"></shops></view></view>  
  1 +<view><u-navbar wx:if="{{a}}" u-s="{{['left']}}" u-i="0a7f8b7d-0" bind:__l="__l" u-p="{{a}}"><view class="u-nav-slot" slot="left">大健康商城</view></u-navbar><view class="topBgBox"><image src="/static/indexIc/topBg.png" mode=""></image><view class="searchBox"><search u-i="0a7f8b7d-1" bind:__l="__l"></search><view class="vip flexC" bindtap="{{b}}"><image src="/static/indexIc/vip.png" mode=""></image></view></view></view><view class="classBox"><view wx:for="{{c}}" wx:for-item="item" wx:key="c" class="itemClss flexV" bindtap="{{item.d}}"><image src="{{item.a}}" mode=""></image><text>{{item.b}}</text></view><view class="itemClss flexV" bindtap="{{d}}"><image src="/static/indexIc/classIc.png" mode=""></image><text>更多</text></view></view><view class="specialOffer"><image class="pinkBg" src="/static/indexIc/pinkBg.png" mode=""></image><view class="special"><view class="topBox flexJ"><view class="titles"><view class="title">特价专区</view><text>SPECIAL PRICE ZONE</text></view><view class="more flexA" bindtap="{{e}}"> 更多 <image src="/static/indexIc/orangeRight.png" mode=""></image></view></view><view class="shop"><shops wx:if="{{f}}" u-i="0a7f8b7d-2" bind:__l="__l" u-p="{{f}}"></shops></view></view></view><view class="recom flexA"><image src="/static/indexIc/recommendIc.png" mode=""></image> 推荐商品 <text>限时限量好物推荐</text></view><view class="recomBox"><shops wx:if="{{g}}" u-i="0a7f8b7d-3" bind:__l="__l" u-p="{{g}}"></shops></view></view>
@@ -77,7 +77,6 @@ const _sfc_main = { @@ -77,7 +77,6 @@ const _sfc_main = {
77 moreSpec.value = res.specData; 77 moreSpec.value = res.specData;
78 shopType.value = res.detail.goodstatus; 78 shopType.value = res.detail.goodstatus;
79 value.value = res.cartNum; 79 value.value = res.cartNum;
80 - console.log("getShopDetaile", res);  
81 } catch (err) { 80 } catch (err) {
82 common_vendor.index.showToast({ title: err, icon: "none" }); 81 common_vendor.index.showToast({ title: err, icon: "none" });
83 console.log("", err); 82 console.log("", err);
@@ -111,8 +110,8 @@ const _sfc_main = { @@ -111,8 +110,8 @@ const _sfc_main = {
111 }, common_vendor.unref(commentList).length > 0 ? { 110 }, common_vendor.unref(commentList).length > 0 ? {
112 k: common_vendor.o(seeAll) 111 k: common_vendor.o(seeAll)
113 } : {}, { 112 } : {}, {
114 - l: common_vendor.unref(commentList).length > 0  
115 - }, common_vendor.unref(commentList).length > 0 ? { 113 + l: common_vendor.unref(commentList).length
  114 + }, common_vendor.unref(commentList).length ? {
116 m: common_vendor.p({ 115 m: common_vendor.p({
117 commentList: common_vendor.unref(commentList) 116 commentList: common_vendor.unref(commentList)
118 }) 117 })
@@ -17,23 +17,30 @@ const _sfc_main = { @@ -17,23 +17,30 @@ const _sfc_main = {
17 const count = common_vendor.ref(5); 17 const count = common_vendor.ref(5);
18 const value = common_vendor.ref(0); 18 const value = common_vendor.ref(0);
19 let photoList = common_vendor.reactive([]); 19 let photoList = common_vendor.reactive([]);
  20 + const imgList = common_vendor.ref([]);
20 let desc = common_vendor.ref(""); 21 let desc = common_vendor.ref("");
21 const { proxy } = common_vendor.getCurrentInstance(); 22 const { proxy } = common_vendor.getCurrentInstance();
22 const submit = () => { 23 const submit = () => {
23 getComments(); 24 getComments();
24 }; 25 };
  26 + const evaluateOrderId = common_vendor.ref(0);
  27 + common_vendor.onLoad((e) => {
  28 + evaluateOrderId.value = e.id;
  29 + });
25 const addPhoto = () => proxy.$methods.upload("http://health.shs.broing.cn/api/common/upload", (imgUrl) => { 30 const addPhoto = () => proxy.$methods.upload("http://health.shs.broing.cn/api/common/upload", (imgUrl) => {
26 console.log("\u8FD4\u56DE\u56FE\u7247", imgUrl); 31 console.log("\u8FD4\u56DE\u56FE\u7247", imgUrl);
  32 + imgList.value.push(imgUrl.upImg);
27 photoList.push(imgUrl.avatar); 33 photoList.push(imgUrl.avatar);
28 }); 34 });
29 const delPhoto = (index) => { 35 const delPhoto = (index) => {
  36 + imgList.value.splice(index, 1);
30 photoList.splice(index, 1); 37 photoList.splice(index, 1);
31 }; 38 };
32 const getComments = async () => { 39 const getComments = async () => {
33 try { 40 try {
34 let params = { 41 let params = {
35 - goods_id: 86,  
36 - image: photoList.join(","), 42 + id: evaluateOrderId.value,
  43 + image: imgList.value.join(","),
37 content: desc.value 44 content: desc.value
38 }; 45 };
39 const res = await api_index.getComment(params); 46 const res = await api_index.getComment(params);
@@ -57,7 +57,7 @@ const _sfc_main = { @@ -57,7 +57,7 @@ const _sfc_main = {
57 classList[0].num = res.dfk; 57 classList[0].num = res.dfk;
58 classList[1].num = res.dfh; 58 classList[1].num = res.dfh;
59 classList[2].num = res.dsh; 59 classList[2].num = res.dsh;
60 - classList[3].num = res.ywc; 60 + classList[3].num = res.dpj;
61 classList[4].num = res.yth; 61 classList[4].num = res.yth;
62 info.value = res.userInfo; 62 info.value = res.userInfo;
63 console.log("getMine", res); 63 console.log("getMine", res);
@@ -28,7 +28,7 @@ @@ -28,7 +28,7 @@
28 display: none !important; 28 display: none !important;
29 } 29 }
30 page { 30 page {
31 - background-color: #F6F8FA; 31 + background-color: #f6f8fa;
32 } 32 }
33 .topBgBox { 33 .topBgBox {
34 width: 100%; 34 width: 100%;
@@ -13,14 +13,16 @@ if (!Math) { @@ -13,14 +13,16 @@ if (!Math) {
13 } 13 }
14 const _sfc_main = { 14 const _sfc_main = {
15 setup(__props) { 15 setup(__props) {
  16 + const addressList = common_vendor.ref([]);
16 common_vendor.onShow(() => { 17 common_vendor.onShow(() => {
  18 + addressList.value.splice(0);
17 getAdressLists(); 19 getAdressLists();
18 }); 20 });
19 common_vendor.onLoad((e) => { 21 common_vendor.onLoad((e) => {
20 isCheck.value = e.isCheck; 22 isCheck.value = e.isCheck;
21 }); 23 });
22 - const addressList = common_vendor.ref([]);  
23 const newAdd = (type, id) => { 24 const newAdd = (type, id) => {
  25 + console.log(type, id, "type id\u662F\u4EC0\u4E48");
24 common_vendor.index.navigateTo({ 26 common_vendor.index.navigateTo({
25 url: `/pages/mine/newAddress?id=${type == 0 ? id : ""}` 27 url: `/pages/mine/newAddress?id=${type == 0 ? id : ""}`
26 }); 28 });
@@ -24,7 +24,7 @@ const _sfc_main = { @@ -24,7 +24,7 @@ const _sfc_main = {
24 }); 24 });
25 common_vendor.onShow(() => { 25 common_vendor.onShow(() => {
26 console.log("\u8BA2\u5355\u72B6\u6001", tabStatus.value); 26 console.log("\u8BA2\u5355\u72B6\u6001", tabStatus.value);
27 - getOrderLists(tabStatus.value == 5 ? 21 : tabStatus.value * 1); 27 + getOrderLists(tabStatus.value == 5 ? 21 : tabStatus.value == 4 ? 5 : tabStatus.value * 1);
28 }); 28 });
29 let tabStatus = common_vendor.ref(0); 29 let tabStatus = common_vendor.ref(0);
30 let orderList = common_vendor.ref([]); 30 let orderList = common_vendor.ref([]);
@@ -40,7 +40,7 @@ const _sfc_main = { @@ -40,7 +40,7 @@ const _sfc_main = {
40 getReceipts(); 40 getReceipts();
41 } else if (type == 4) { 41 } else if (type == 4) {
42 common_vendor.index.navigateTo({ 42 common_vendor.index.navigateTo({
43 - url: "/pages/mine/evaluate" 43 + url: `/pages/mine/evaluate?id=${item.id}`
44 }); 44 });
45 } else if (type == 5) { 45 } else if (type == 5) {
46 toDetaile(item.id); 46 toDetaile(item.id);
@@ -44,7 +44,7 @@ const _sfc_main = { @@ -44,7 +44,7 @@ const _sfc_main = {
44 const getMoneyDetails = async () => { 44 const getMoneyDetails = async () => {
45 try { 45 try {
46 const res = await api_index.getMoneyDetail(); 46 const res = await api_index.getMoneyDetail();
47 - recordList.value = res.mingxi; 47 + recordList.value = res;
48 console.log("getMoneyDetail", res); 48 console.log("getMoneyDetail", res);
49 } catch (err) { 49 } catch (err) {
50 common_vendor.index.showToast({ title: err, icon: "none" }); 50 common_vendor.index.showToast({ title: err, icon: "none" });
1 -<view><u-navbar wx:if="{{a}}" u-i="d543e3d0-0" bind:__l="__l" u-p="{{a}}"></u-navbar><view wx:for="{{b}}" wx:for-item="item" wx:key="i" class="formBox flexA"><view class="formTitle">{{item.a}}</view><input wx:if="{{item.b}}" type="text" placeholder-class="gay" placeholder="{{item.c}}" value="{{item.d}}" bindinput="{{item.e}}"></input><view wx:else class="{{['checkBox', 'flexJ', item.g]}}" bindtap="{{item.h}}"><text>{{item.f}}</text><image src="/static/mineIc/rightGayS.png" mode=""></image></view></view><view class="formBox flexJ"><view class="defaults">设置为默认地址</view><view class="switch"><u-switch wx:if="{{e}}" bindchange="{{c}}" u-i="d543e3d0-1" bind:__l="__l" bindupdateModelValue="{{d}}" u-p="{{e}}"></u-switch></view></view><view class="btn flexC" bindtap="{{f}}">保存</view><chekc-area wx:if="{{i}}" bindclose="{{g}}" bindpopShow="{{h}}" u-i="d543e3d0-2" bind:__l="__l" u-p="{{i}}"></chekc-area></view>  
  1 +<view><u-navbar wx:if="{{a}}" u-i="d543e3d0-0" bind:__l="__l" u-p="{{a}}"></u-navbar><view wx:for="{{b}}" wx:for-item="item" wx:key="i" class="formBox flexA"><view class="formTitle">{{item.a}}</view><input wx:if="{{item.b}}" type="text" placeholder-class="gay" placeholder="{{item.c}}" value="{{item.d}}" bindinput="{{item.e}}"/><view wx:else class="{{['checkBox', 'flexJ', item.g]}}" bindtap="{{item.h}}"><text>{{item.f}}</text><image src="/static/mineIc/rightGayS.png" mode=""></image></view></view><view class="formBox flexJ"><view class="defaults">设置为默认地址</view><view class="switch"><u-switch wx:if="{{e}}" bindchange="{{c}}" u-i="d543e3d0-1" bind:__l="__l" bindupdateModelValue="{{d}}" u-p="{{e}}"></u-switch></view></view><view class="btn flexC" bindtap="{{f}}">保存</view><chekc-area wx:if="{{i}}" bindclose="{{g}}" bindpopShow="{{h}}" u-i="d543e3d0-2" bind:__l="__l" u-p="{{i}}"></chekc-area></view>
@@ -28,12 +28,25 @@ const _sfc_main = { @@ -28,12 +28,25 @@ const _sfc_main = {
28 let btnType = common_vendor.ref(1); 28 let btnType = common_vendor.ref(1);
29 let integral = common_vendor.ref(0); 29 let integral = common_vendor.ref(0);
30 let tipType = common_vendor.ref(1); 30 let tipType = common_vendor.ref(1);
  31 + let balance = common_vendor.ref(0);
31 let placeOrder = common_vendor.ref([ 32 let placeOrder = common_vendor.ref([
32 { id: 1, name: "\u8BA2\u5355\u7F16\u53F7", text: "1212" }, 33 { id: 1, name: "\u8BA2\u5355\u7F16\u53F7", text: "1212" },
33 { id: 2, name: "\u652F\u4ED8\u65B9\u5F0F", text: "1212" }, 34 { id: 2, name: "\u652F\u4ED8\u65B9\u5F0F", text: "1212" },
34 { id: 3, name: "\u4E0B\u5355\u65F6\u95F4", text: "1212" }, 35 { id: 3, name: "\u4E0B\u5355\u65F6\u95F4", text: "1212" },
35 { id: 4, name: "\u5FEB\u9012\u7F16\u53F7", text: "1212" } 36 { id: 4, name: "\u5FEB\u9012\u7F16\u53F7", text: "1212" }
36 ]); 37 ]);
  38 + common_vendor.onShow(() => {
  39 + getyues();
  40 + });
  41 + const getyues = async () => {
  42 + try {
  43 + const res = await api_index.getyue();
  44 + balance.value = res.money;
  45 + } catch (err) {
  46 + common_vendor.index.showToast({ title: err, icon: "none" });
  47 + console.log("getyue", err);
  48 + }
  49 + };
37 const leftClickHandler = () => { 50 const leftClickHandler = () => {
38 common_vendor.index.navigateBack({ delta: 1 }); 51 common_vendor.index.navigateBack({ delta: 1 });
39 }; 52 };
@@ -155,6 +168,7 @@ const _sfc_main = { @@ -155,6 +168,7 @@ const _sfc_main = {
155 } : {}, { 168 } : {}, {
156 s: common_vendor.o(($event) => common_vendor.isRef(modeShow) ? modeShow.value = false : modeShow = false), 169 s: common_vendor.o(($event) => common_vendor.isRef(modeShow) ? modeShow.value = false : modeShow = false),
157 t: common_vendor.p({ 170 t: common_vendor.p({
  171 + balance: common_vendor.unref(balance),
158 orderId: common_vendor.unref(orderId), 172 orderId: common_vendor.unref(orderId),
159 isOrderPay: true, 173 isOrderPay: true,
160 totalPrice: common_vendor.unref(orderList).total_price, 174 totalPrice: common_vendor.unref(orderList).total_price,