Commit 4171c8beae1bbc3a9e749f8a3ccdc90bbd91bd67
1 parent
081c50da0c
Exists in
master
倒计时添加
Showing
2 changed files
with
104 additions
and
102 deletions
Show diff stats
src/pages/confirmOrder/confirmOrder.vue
| 1 | <template> | 1 | <template> |
| 2 | <view class="wrap"> | 2 | <view class="wrap"> |
| 3 | <view></view> | 3 | <view></view> |
| 4 | <view | 4 | <view |
| 5 | class="addAddress" | 5 | class="addAddress" |
| 6 | @tap="toaddAddress" | 6 | @tap="toaddAddress" |
| 7 | v-if="this.showAddress" | 7 | v-if="this.showAddress" |
| 8 | > | 8 | > |
| 9 | <view class="addIcon"> | 9 | <view class="addIcon"> |
| 10 | <image | 10 | <image |
| 11 | src="../../static/add.png" | 11 | src="../../static/add.png" |
| 12 | mode="aspectFill" | 12 | mode="aspectFill" |
| 13 | ></image> | 13 | ></image> |
| 14 | </view> | 14 | </view> |
| 15 | <view class="addressText">{{addAddress}}</view> | 15 | <view class="addressText">{{addAddress}}</view> |
| 16 | <image | 16 | <image |
| 17 | src="../../static/right.png" | 17 | src="../../static/right.png" |
| 18 | mode="aspectFill" | 18 | mode="aspectFill" |
| 19 | ></image> | 19 | ></image> |
| 20 | </view> | 20 | </view> |
| 21 | <view | 21 | <view |
| 22 | v-else | 22 | v-else |
| 23 | @tap="toaddAddress" | 23 | @tap="toaddAddress" |
| 24 | :class="addressInfo !== false ? 'list order-user' : 'list order-user user_address'" | 24 | :class="addressInfo !== false ? 'list order-user' : 'list order-user user_address'" |
| 25 | > | 25 | > |
| 26 | <view | 26 | <view |
| 27 | class="order-user-head" | 27 | class="order-user-head" |
| 28 | v-if="addressInfo != false" | 28 | v-if="addressInfo != false" |
| 29 | > | 29 | > |
| 30 | <view class="name"> | 30 | <view class="name"> |
| 31 | <view | 31 | <view |
| 32 | v-if="addressInfo.default === '1'" | 32 | v-if="addressInfo.default === '1'" |
| 33 | class="default" | 33 | class="default" |
| 34 | > | 34 | > |
| 35 | <text>默认</text> | 35 | <text>默认</text> |
| 36 | </view> | 36 | </view> |
| 37 | {{addressInfo.name}} | 37 | {{addressInfo.name}} |
| 38 | </view> | 38 | </view> |
| 39 | <text class="mobile">{{addressInfo.mobile}}</text> | 39 | <text class="mobile">{{addressInfo.mobile}}</text> |
| 40 | </view> | 40 | </view> |
| 41 | <view | 41 | <view |
| 42 | class="order-user-body" | 42 | class="order-user-body" |
| 43 | v-if="addressInfo !== false" | 43 | v-if="addressInfo !== false" |
| 44 | > | 44 | > |
| 45 | <image src="../../static/myorder-paying-location.png"></image> | 45 | <image src="../../static/myorder-paying-location.png"></image> |
| 46 | <text class="address">{{addressInfo.address}}\n{{addressInfo.add_detail}}</text> | 46 | <text class="address">{{addressInfo.address}}\n{{addressInfo.add_detail}}</text> |
| 47 | </view> | 47 | </view> |
| 48 | <view | 48 | <view |
| 49 | class="order_user_body_add" | 49 | class="order_user_body_add" |
| 50 | v-if="addressInfo == false" | 50 | v-if="addressInfo == false" |
| 51 | > | 51 | > |
| 52 | <image | 52 | <image |
| 53 | src="../../static/add_address.png" | 53 | src="../../static/add_address.png" |
| 54 | mode="aspectFill" | 54 | mode="aspectFill" |
| 55 | ></image> | 55 | ></image> |
| 56 | <text class="address_add">点击添加地址</text> | 56 | <text class="address_add">点击添加地址</text> |
| 57 | </view> | 57 | </view> |
| 58 | <image | 58 | <image |
| 59 | class="arrow" | 59 | class="arrow" |
| 60 | src="../../static/right.png" | 60 | src="../../static/right.png" |
| 61 | mode="aspectFill" | 61 | mode="aspectFill" |
| 62 | ></image> | 62 | ></image> |
| 63 | </view> | 63 | </view> |
| 64 | <view class="content"> | 64 | <view class="content"> |
| 65 | <view class="orderInfo"> | 65 | <view class="orderInfo"> |
| 66 | <view class="title"> | 66 | <view class="title"> |
| 67 | <image | 67 | <image |
| 68 | src="../../static/store.png" | 68 | src="../../static/store.png" |
| 69 | mode="aspectFill" | 69 | mode="aspectFill" |
| 70 | style="width: 40rpx;height: 40rpx;" | 70 | style="width: 40rpx;height: 40rpx;" |
| 71 | ></image> | 71 | ></image> |
| 72 | <text>非常戴镜</text> | 72 | <text>非常戴镜</text> |
| 73 | </view> | 73 | </view> |
| 74 | 74 | <template v-if="isCart === 'true'"> | |
| 75 | <view | 75 | <view |
| 76 | class="infoBox" | 76 | class="infoBox" |
| 77 | v-if="isCart === 'true'" | 77 | v-for="(item, index) in checkedCartLst" |
| 78 | v-for="(item, index) in checkedCartLst" | 78 | :key="index" |
| 79 | :key="index" | 79 | > |
| 80 | > | 80 | <view class="infoTop"> |
| 81 | <view class="infoTop"> | 81 | <image |
| 82 | <image | 82 | :src="item.img_index_url" |
| 83 | :src="item.img_index_url" | 83 | mode="aspectFill" |
| 84 | mode="aspectFill" | 84 | ></image> |
| 85 | ></image> | 85 | <view class="infoRight"> |
| 86 | <view class="infoRight"> | 86 | <text class="goodName">{{item.p_name}}</text> |
| 87 | <text class="goodName">{{item.p_name}}</text> | 87 | <text class="remarks">支持7天无理由退货 顺丰发货</text> |
| 88 | <text class="remarks">支持7天无理由退货 顺丰发货</text> | 88 | <view class="priceBox"> |
| 89 | <view class="priceBox"> | 89 | <view class="price">¥{{Number(item.nowPrice) }}<text class="originCost"> |
| 90 | <view class="price">¥{{Number(item.nowPrice) }}<text class="originCost"> | 90 | ¥{{item.oldPrice}} |
| 91 | ¥{{item.oldPrice}} | 91 | </text></view> |
| 92 | </text></view> | 92 | <view class="counter"> |
| 93 | <view class="counter"> | 93 | <view |
| 94 | <view | 94 | class="btn" |
| 95 | class="btn" | 95 | disabled="this.disabled" |
| 96 | disabled="this.disabled" | 96 | type="default" |
| 97 | type="default" | 97 | @click="counter(false,index)" |
| 98 | @click="counter(false,index)" | 98 | >-</view> |
| 99 | >-</view> | 99 | <text>{{checkedCartLst[index].num}}</text> |
| 100 | <text>{{checkedCartLst[index].num}}</text> | 100 | <view |
| 101 | <view | 101 | class="btn" |
| 102 | class="btn" | 102 | type="default" |
| 103 | type="default" | 103 | @click="counter(true,index)" |
| 104 | @click="counter(true,index)" | 104 | >+</view> |
| 105 | >+</view> | 105 | </view> |
| 106 | </view> | 106 | </view> |
| 107 | </view> | 107 | </view> |
| 108 | </view> | 108 | </view> |
| 109 | </view> | 109 | <view class="infoBottom"> |
| 110 | <view class="infoBottom"> | 110 | <view class="norm">规格 <text> |
| 111 | <view class="norm">规格 <text> | 111 | <!-- 长度超出变省略号未做 --> |
| 112 | <!-- 长度超出变省略号未做 --> | 112 | <block>{{item.sku_name}}<block v-if="index !== current.length -1">/</block> |
| 113 | <block>{{item.sku_name}}<block v-if="index !== current.length -1">/</block> | 113 | </block> |
| 114 | </block> | 114 | </text></view> |
| 115 | </text></view> | 115 | <view class="shippingMethod">使用人 <text> |
| 116 | <view class="shippingMethod">使用人 <text> | 116 | {{item.peopleName}} |
| 117 | {{item.peopleName}} | 117 | </text></view> |
| 118 | </text></view> | 118 | <view class="shippingMethod">配送方式 <text>快递</text></view> |
| 119 | <view class="shippingMethod">配送方式 <text>快递</text></view> | 119 | <view class="message">买家留言 |
| 120 | <view class="message">买家留言 | 120 | <input |
| 121 | <input | 121 | type="text" |
| 122 | type="text" | 122 | :value="note" |
| 123 | :value="note" | 123 | placeholder="建议提前协商(50字以内)" |
| 124 | placeholder="建议提前协商(50字以内)" | 124 | /> |
| 125 | /> | 125 | </view> |
| 126 | </view> | 126 | </view> |
| 127 | </view> | 127 | </view> |
| 128 | </view> | 128 | </template> |
| 129 | 129 | <template v-else> | |
| 130 | <view | 130 | <view class="infoBox"> |
| 131 | class="infoBox" | 131 | <view class="infoTop"> |
| 132 | v-else | 132 | <image |
| 133 | > | 133 | :src="buyItem.pic" |
| 134 | <view class="infoTop"> | 134 | mode="aspectFill" |
| 135 | <image | 135 | ></image> |
| 136 | :src="buyItem.pic" | 136 | <view class="infoRight"> |
| 137 | mode="aspectFill" | 137 | <text class="goodName">{{goodInfo.p_name}}</text> |
| 138 | ></image> | 138 | <text class="remarks">支持7天无理由退货 顺丰发货</text> |
| 139 | <view class="infoRight"> | 139 | <view class="priceBox"> |
| 140 | <text class="goodName">{{goodInfo.p_name}}</text> | 140 | <view class="price">¥{{buyItem.real_price}}<text class="originCost"> |
| 141 | <text class="remarks">支持7天无理由退货 顺丰发货</text> | 141 | ¥{{buyItem.out_price}} |
| 142 | <view class="priceBox"> | 142 | </text></view> |
| 143 | <view class="price">¥{{buyItem.real_price}}<text class="originCost"> | 143 | <view class="counter"> |
| 144 | ¥{{buyItem.out_price}} | 144 | <view |
| 145 | </text></view> | 145 | class="btn" |
| 146 | <view class="counter"> | 146 | disabled="this.disabled" |
| 147 | <view | 147 | type="default" |
| 148 | class="btn" | 148 | @click="counter(false)" |
| 149 | disabled="this.disabled" | 149 | >-</view> |
| 150 | type="default" | 150 | <text>{{count}}</text> |
| 151 | @click="counter(false)" | 151 | <view |
| 152 | >-</view> | 152 | class="btn" |
| 153 | <text>{{count}}</text> | 153 | type="default" |
| 154 | <view | 154 | @click="counter(true)" |
| 155 | class="btn" | 155 | >+</view> |
| 156 | type="default" | 156 | </view> |
| 157 | @click="counter(true)" | ||
| 158 | >+</view> | ||
| 159 | </view> | 157 | </view> |
| 160 | </view> | 158 | </view> |
| 161 | </view> | 159 | </view> |
| 162 | </view> | 160 | <view class="infoBottom"> |
| 163 | <view class="infoBottom"> | 161 | <view class="norm">规格 <text> |
| 164 | <view class="norm">规格 <text> | 162 | <!-- 长度超出变省略号未做 --> |
| 165 | <!-- 长度超出变省略号未做 --> | 163 | <block |
| 166 | <block | 164 | v-for="(item, index) in current" |
| 167 | v-for="(item, index) in current" | 165 | :key="index" |
| 168 | :key="index" | 166 | >{{attrList[index].attr[item].name}}<block v-if="index !== current.length -1">/</block> |
| 169 | >{{attrList[index].attr[item].name}}<block v-if="index !== current.length -1">/</block> | 167 | </block> |
| 170 | </block> | 168 | </text></view> |
| 171 | </text></view> | 169 | <view class="shippingMethod">使用人 <text> |
| 172 | <view class="shippingMethod">使用人 <text> | 170 | {{name}} |
| 173 | {{name}} | 171 | </text></view> |
| 174 | </text></view> | 172 | <view class="shippingMethod">配送方式 <text>快递</text></view> |
| 175 | <view class="shippingMethod">配送方式 <text>快递</text></view> | 173 | <view class="message">买家留言 |
| 176 | <view class="message">买家留言 | 174 | <input |
| 177 | <input | 175 | type="text" |
| 178 | type="text" | 176 | :value="note" |
| 179 | :value="note" | 177 | placeholder="建议提前协商(50字以内)" |
| 180 | placeholder="建议提前协商(50字以内)" | 178 | /> |
| 181 | /> | 179 | </view> |
| 182 | </view> | 180 | </view> |
| 183 | </view> | 181 | </view> |
| 184 | </view> | 182 | </template> |
| 183 | |||
| 185 | </view> | 184 | </view> |
| 186 | <view class="payWay"> | 185 | <view class="payWay"> |
| 187 | <view class="item"> | 186 | <view class="item"> |
| 188 | <text>支付方式</text> | 187 | <text>支付方式</text> |
| 189 | <view class="itemRight"> | 188 | <view class="itemRight"> |
| 190 | <view class="rightText"> | 189 | <view class="rightText"> |
| 191 | <view class="choosePayWay"> | 190 | <view class="choosePayWay"> |
| 192 | <image | 191 | <image |
| 193 | src="../../static/chat_logo.png" | 192 | src="../../static/chat_logo.png" |
| 194 | mode="aspectFill" | 193 | mode="aspectFill" |
| 195 | ></image> | 194 | ></image> |
| 196 | <text>微信支付</text> | 195 | <text>微信支付</text> |
| 197 | </view> | 196 | </view> |
| 198 | <!-- <view class="randomSubstraction">最高随机立减¥99</view> --> | 197 | <!-- <view class="randomSubstraction">最高随机立减¥99</view> --> |
| 199 | </view> | 198 | </view> |
| 200 | <!-- <image | 199 | <!-- <image |
| 201 | src="../../static/right.png" | 200 | src="../../static/right.png" |
| 202 | mode="aspectFill" | 201 | mode="aspectFill" |
| 203 | ></image> --> | 202 | ></image> --> |
| 204 | </view> | 203 | </view> |
| 205 | </view> | 204 | </view> |
| 206 | <!-- <view class="item"> | 205 | <!-- <view class="item"> |
| 207 | <text>优惠券</text> | 206 | <text>优惠券</text> |
| 208 | <view class="itemRight"> | 207 | <view class="itemRight"> |
| 209 | <view class="rightText"> | 208 | <view class="rightText"> |
| 210 | <view class="chooseOffers"> | 209 | <view class="chooseOffers"> |
| 211 | <text>-¥70.00</text> | 210 | <text>-¥70.00</text> |
| 212 | </view> | 211 | </view> |
| 213 | <view class="preferentialWay">最大优惠</view> | 212 | <view class="preferentialWay">最大优惠</view> |
| 214 | </view> | 213 | </view> |
| 215 | <image | 214 | <image |
| 216 | src="../../static/right.png" | 215 | src="../../static/right.png" |
| 217 | mode="aspectFill" | 216 | mode="aspectFill" |
| 218 | ></image> | 217 | ></image> |
| 219 | </view> | 218 | </view> |
| 220 | </view> --> | 219 | </view> --> |
| 221 | <view class="item"> | 220 | <view class="item"> |
| 222 | <text>运费</text> | 221 | <text>运费</text> |
| 223 | <view class="itemRight"> | 222 | <view class="itemRight"> |
| 224 | <view class="freight">免运费</view> | 223 | <view class="freight">免运费</view> |
| 225 | </view> | 224 | </view> |
| 226 | </view> | 225 | </view> |
| 227 | <view class="item"> | 226 | <view class="item"> |
| 228 | <text>合计</text> | 227 | <text>合计</text> |
| 229 | <view class="itemRight"> | 228 | <view class="itemRight"> |
| 230 | <view class="total">¥{{totalPrice}}</view> | 229 | <view class="total">¥{{totalPrice}}</view> |
| 231 | <!-- <view class="total" v-else>¥{{Number(skuInfo.real_price) * count}}</view> --> | 230 | <!-- <view class="total" v-else>¥{{Number(skuInfo.real_price) * count}}</view> --> |
| 232 | </view> | 231 | </view> |
| 233 | </view> | 232 | </view> |
| 234 | </view> | 233 | </view> |
| 235 | <!-- | 234 | <!-- |
| 236 | <view class="checkBox"> | 235 | <view class="checkBox"> |
| 237 | <checkbox-group> | 236 | <checkbox-group> |
| 238 | <label> | 237 | <label> |
| 239 | <checkbox color="#FF6B4A" value="isAnonymous" checked="true" />匿名购买 | 238 | <checkbox color="#FF6B4A" value="isAnonymous" checked="true" />匿名购买 |
| 240 | </label> | 239 | </label> |
| 241 | </checkbox-group> | 240 | </checkbox-group> |
| 242 | </view> --> | 241 | </view> --> |
| 243 | </view> | 242 | </view> |
| 244 | <view class="last_zhanwei"></view> | 243 | <view class="last_zhanwei"></view> |
| 245 | <view class="footer"> | 244 | <view class="footer"> |
| 246 | <view class="footerLeft">实付金额: | 245 | <view class="footerLeft">实付金额: |
| 247 | <text>¥{{totalPrice}}</text> | 246 | <text>¥{{totalPrice}}</text> |
| 248 | <!-- <text v-else>¥{{Number(skuInfo.real_price) * count}}</text> --> | 247 | <!-- <text v-else>¥{{Number(skuInfo.real_price) * count}}</text> --> |
| 249 | </view> | 248 | </view> |
| 250 | <view class="footerRight"> | 249 | <view class="footerRight"> |
| 251 | <view | 250 | <view |
| 252 | class="paybtn" | 251 | class="paybtn" |
| 253 | @tap="orderBuild" | 252 | @tap="orderBuild" |
| 254 | >立即支付</view> | 253 | >立即支付</view> |
| 255 | </view> | 254 | </view> |
| 256 | </view> | 255 | </view> |
| 257 | </view> | 256 | </view> |
| 258 | </template> | 257 | </template> |
| 259 | 258 | ||
| 260 | <script> | 259 | <script> |
| 261 | import store from '@/store' | 260 | import store from '@/store' |
| 262 | import MD5Util from '../../utils/md5' | 261 | import MD5Util from '../../utils/md5' |
| 263 | 262 | ||
| 264 | export default { | 263 | export default { |
| 265 | data() { | 264 | data() { |
| 266 | return { | 265 | return { |
| 267 | name: String, | 266 | name: String, |
| 268 | addAddress: '添加收货地址', | 267 | addAddress: '添加收货地址', |
| 269 | count: 1, | 268 | count: 1, |
| 270 | pid: 0, | 269 | pid: 0, |
| 271 | disabled: false, | 270 | disabled: false, |
| 272 | freight: 0.0, | 271 | freight: 0.0, |
| 273 | showAddress: false, | 272 | showAddress: false, |
| 274 | note: '', | 273 | note: '', |
| 275 | addressInfo: { | 274 | addressInfo: { |
| 276 | address: '', | 275 | address: '', |
| 277 | }, | 276 | }, |
| 278 | isCart: Boolean, | 277 | isCart: Boolean, |
| 279 | // isAnonymous: | 278 | // isAnonymous: |
| 280 | checkedCartLst: [], | 279 | checkedCartLst: [], |
| 281 | } | 280 | } |
| 282 | }, | 281 | }, |
| 283 | onShow(addressId) { | 282 | onShow(addressId) { |
| 284 | // console.log('+-+-*-*-+-+',addressId) | 283 | // console.log('+-+-*-*-+-+',addressId) |
| 285 | if (addressId) { | 284 | if (addressId) { |
| 286 | store | 285 | store |
| 287 | .dispatch('address/details', { | 286 | .dispatch('address/details', { |
| 288 | add_id: addressId, | 287 | add_id: addressId, |
| 289 | }) | 288 | }) |
| 290 | .then(({ code, data }) => { | 289 | .then(({ code, data }) => { |
| 291 | if (code === 1) { | 290 | if (code === 1) { |
| 292 | // console.log('code', code, data) | 291 | // console.log('code', code, data) |
| 293 | this.showAddress = true | 292 | this.showAddress = true |
| 294 | this.addressInfo = data | 293 | this.addressInfo = data |
| 295 | } | 294 | } |
| 296 | }) | 295 | }) |
| 297 | } | 296 | } |
| 298 | }, | 297 | }, |
| 299 | onLoad({ pid, addressId, isCart, count, name }) { | 298 | onLoad({ pid, addressId, isCart, count, name }) { |
| 300 | if (isCart === 'false') { | 299 | if (isCart === 'false') { |
| 301 | this.pid = pid | 300 | this.pid = pid |
| 302 | // store.dispatch('read/fetch', { | 301 | // store.dispatch('read/fetch', { |
| 303 | // pid, | 302 | // pid, |
| 304 | // }) | 303 | // }) |
| 305 | } | 304 | } |
| 306 | this.count = count | 305 | this.count = count |
| 307 | this.name = name | 306 | this.name = name |
| 308 | this.isCart = isCart | 307 | this.isCart = isCart |
| 309 | 308 | ||
| 310 | console.log('++++++++++++' + pid, addressId, isCart) | 309 | console.log('++++++++++++' + pid, addressId, isCart) |
| 311 | this.checkedCartLst = this.$store.state.cart.checkedCartLst | 310 | this.checkedCartLst = this.$store.state.cart.checkedCartLst |
| 312 | // console.log('++++++++++6666666666++',this.$store.state.cart.checkedCartLst) | 311 | // console.log('++++++++++6666666666++',this.$store.state.cart.checkedCartLst) |
| 313 | // 若已经选择地址 | 312 | // 若已经选择地址 |
| 314 | if (addressId) { | 313 | if (addressId) { |
| 315 | store | 314 | store |
| 316 | .dispatch('address/details', { | 315 | .dispatch('address/details', { |
| 317 | add_id: addressId, | 316 | add_id: addressId, |
| 318 | }) | 317 | }) |
| 319 | .then(({ code, data }) => { | 318 | .then(({ code, data }) => { |
| 320 | if (code === 1) { | 319 | if (code === 1) { |
| 321 | // console.log('code', code, data) | 320 | // console.log('code', code, data) |
| 322 | this.showAddress = true | 321 | this.showAddress = true |
| 323 | this.addressInfo = data | 322 | this.addressInfo = data |
| 324 | } | 323 | } |
| 325 | }) | 324 | }) |
| 326 | } else { | 325 | } else { |
| 327 | store.dispatch('address/default').then(({ code, data }) => { | 326 | store.dispatch('address/default').then(({ code, data }) => { |
| 328 | this.showAddress = true | 327 | this.showAddress = true |
| 329 | this.addressInfo = data | 328 | this.addressInfo = data |
| 330 | console.log('this.addressInfo', this.addressInfo) | 329 | console.log('this.addressInfo', this.addressInfo) |
| 331 | }) | 330 | }) |
| 332 | } | 331 | } |
| 333 | }, | 332 | }, |
| 334 | computed: { | 333 | computed: { |
| 335 | totalPrice() { | 334 | totalPrice() { |
| 336 | if (this.isCart == 'true') { | 335 | if (this.isCart == 'true') { |
| 337 | let total = 0 | 336 | let total = 0 |
| 338 | this.$store.state.cart.checkedCartLst.map(item => { | 337 | this.$store.state.cart.checkedCartLst.map(item => { |
| 339 | total += item.nowPrice * item.num | 338 | total += item.nowPrice * item.num |
| 340 | }) | 339 | }) |
| 341 | return total | 340 | return total |
| 342 | } else { | 341 | } else { |
| 343 | return this.buyItem.real_price * this.count | 342 | return this.buyItem.real_price * this.count |
| 344 | } | 343 | } |
| 345 | }, | 344 | }, |
| 346 | buyItem() { | 345 | buyItem() { |
| 347 | return this.$store.state.cart.buyItem | 346 | return this.$store.state.cart.buyItem |
| 348 | }, | 347 | }, |
| 349 | // checkedCartLst(){ | 348 | // checkedCartLst(){ |
| 350 | // console.log('checkedCartLst',this.$store.state.cart.checkedCartLst) | 349 | // console.log('checkedCartLst',this.$store.state.cart.checkedCartLst) |
| 351 | // return this.$store.state.cart.checkedCartLst | 350 | // return this.$store.state.cart.checkedCartLst |
| 352 | // }, | 351 | // }, |
| 353 | goodInfo() { | 352 | goodInfo() { |
| 354 | // console.log('state', this.$store.state.read.goodInfo) | 353 | // console.log('state', this.$store.state.read.goodInfo) |
| 355 | return this.$store.state.read.goodInfo | 354 | return this.$store.state.read.goodInfo |
| 356 | }, | 355 | }, |
| 357 | skuInfo() { | 356 | skuInfo() { |
| 358 | return this.$store.state.order.param.sk_id_arr | 357 | return this.$store.state.order.param.sk_id_arr |
| 359 | }, | 358 | }, |
| 360 | attrList() { | 359 | attrList() { |
| 361 | return this.$store.state.order.param.attrList | 360 | return this.$store.state.order.param.attrList |
| 362 | }, | 361 | }, |
| 363 | current() { | 362 | current() { |
| 364 | return this.$store.state.order.param.current | 363 | return this.$store.state.order.param.current |
| 365 | }, | 364 | }, |
| 366 | }, | 365 | }, |
| 367 | methods: { | 366 | methods: { |
| 368 | counter(isadd, index) { | 367 | counter(isadd, index) { |
| 369 | if (isadd) { | 368 | if (isadd) { |
| 370 | if (this.isCart == 'true') { | 369 | if (this.isCart == 'true') { |
| 371 | this.checkedCartLst[index].num++ | 370 | this.checkedCartLst[index].num++ |
| 372 | } else { | 371 | } else { |
| 373 | this.count++ | 372 | this.count++ |
| 374 | } | 373 | } |
| 375 | } else { | 374 | } else { |
| 376 | if (this.isCart == 'true') { | 375 | if (this.isCart == 'true') { |
| 377 | this.checkedCartLst[index].num <= 1 ? (this.disabled = true) : this.checkedCartLst[index].num-- | 376 | this.checkedCartLst[index].num <= 1 ? (this.disabled = true) : this.checkedCartLst[index].num-- |
| 378 | } else { | 377 | } else { |
| 379 | this.count <= 1 ? (this.disabled = true) : this.count-- | 378 | this.count <= 1 ? (this.disabled = true) : this.count-- |
| 380 | } | 379 | } |
| 381 | } | 380 | } |
| 382 | }, | 381 | }, |
| 383 | // 跳转添加地址页面 | 382 | // 跳转添加地址页面 |
| 384 | toaddAddress() { | 383 | toaddAddress() { |
| 385 | uni.navigateTo({ | 384 | uni.navigateTo({ |
| 386 | url: `../address/addressList?edit=${1}`, | 385 | url: `../address/addressList?edit=${1}`, |
| 387 | success: res => {}, | 386 | success: res => {}, |
| 388 | fail: error => { | 387 | fail: error => { |
| 389 | console.log('跳转到地址列表页面失败====>', error) | 388 | console.log('跳转到地址列表页面失败====>', error) |
| 390 | }, | 389 | }, |
| 391 | complete: () => {}, | 390 | complete: () => {}, |
| 392 | }) | 391 | }) |
| 393 | }, | 392 | }, |
| 394 | // 下单 | 393 | // 下单 |
| 395 | orderBuild() { | 394 | orderBuild() { |
| 396 | if (!this.addressInfo) { | 395 | if (!this.addressInfo) { |
| 397 | uni.showToast({ | 396 | uni.showToast({ |
| 398 | title: '请先添加地址', | 397 | title: '请先添加地址', |
| 399 | icon: 'none', | 398 | icon: 'none', |
| 400 | }) | 399 | }) |
| 401 | return | 400 | return |
| 402 | } | 401 | } |
| 403 | uni.showLoading({ | 402 | uni.showLoading({ |
| 404 | title: '支付中', | 403 | title: '支付中', |
| 405 | }) | 404 | }) |
| 406 | if (this.isCart === 'true') { | 405 | if (this.isCart === 'true') { |
| 407 | const checkedGoods = [] | 406 | const checkedGoods = [] |
| 408 | const sk_id_arr = [] | 407 | const sk_id_arr = [] |
| 409 | this.checkedCartLst.map(item => { | 408 | this.checkedCartLst.map(item => { |
| 410 | checkedGoods.push(item.cart_id) | 409 | checkedGoods.push(item.cart_id) |
| 411 | sk_id_arr.push(item.sk_id) | 410 | sk_id_arr.push(item.sk_id) |
| 412 | }) | 411 | }) |
| 413 | store.dispatch('order/build', { | 412 | store.dispatch('order/build', { |
| 414 | uid: this.$store.state.user.userInfo.uid, | 413 | uid: this.$store.state.user.userInfo.uid, |
| 415 | address: JSON.stringify(this.addressInfo), | 414 | address: JSON.stringify(this.addressInfo), |
| 416 | checkedGoods: checkedGoods, | 415 | checkedGoods: checkedGoods, |
| 417 | sk_id_arr: sk_id_arr, | 416 | sk_id_arr: sk_id_arr, |
| 418 | totalPrice: this.totalPrice * 100, | 417 | totalPrice: this.totalPrice * 100, |
| 419 | }).then((res) => { | 418 | }).then((res) => { |
| 420 | this.pay(res) | 419 | this.pay(res) |
| 421 | }) | 420 | }) |
| 422 | } | 421 | } |
| 423 | if (this.isCart === 'false') { | 422 | if (this.isCart === 'false') { |
| 424 | const { sk_id_arr: skId, mp_id: mpId } = this.$store.state.order.param | 423 | const { sk_id_arr: skId, mp_id: mpId } = this.$store.state.order.param |
| 425 | store.dispatch('order/buyNow', { | 424 | store.dispatch('order/buyNow', { |
| 426 | pid: skId.pid, | 425 | pid: skId.pid, |
| 427 | sk_id: skId.sk_id, | 426 | sk_id: skId.sk_id, |
| 428 | number: this.count, | 427 | number: this.count, |
| 429 | mp_id: mpId, | 428 | mp_id: mpId, |
| 430 | address: JSON.stringify(this.addressInfo), | 429 | address: JSON.stringify(this.addressInfo), |
| 431 | totalPrice: this.totalPrice * 100, | 430 | totalPrice: this.totalPrice * 100, |
| 432 | liuyan: this.note, | 431 | liuyan: this.note, |
| 433 | dir: 1, | 432 | dir: 1, |
| 434 | }).then((res) => { | 433 | }).then((res) => { |
| 435 | this.pay(res) | 434 | this.pay(res) |
| 436 | }) | 435 | }) |
| 437 | } | 436 | } |
| 438 | }, | 437 | }, |
| 439 | // 支付 | 438 | // 支付 |
| 440 | pay(res) { | 439 | pay(res) { |
| 441 | console.log('pay', res) | 440 | console.log('pay', res) |
| 442 | const { data, exKeyName: keyName } = res | 441 | const { data, exKeyName: keyName } = res |
| 443 | const uid = uni.getStorageSync('uid') | 442 | const uid = uni.getStorageSync('uid') |
| 444 | const timeStamp = new Date().getTime().toString() | 443 | const timeStamp = new Date().getTime().toString() |
| 445 | const nonceStr = 'asfafasfasfasfasf' | 444 | const nonceStr = 'asfafasfasfasfasf' |
| 446 | // 支付参数 | 445 | // 支付参数 |
| 447 | const fieldSet = { | 446 | const fieldSet = { |
| 448 | openid: this.$store.state.user.userInfo.openid, | 447 | openid: this.$store.state.user.userInfo.openid, |
| 449 | uid: this.$store.state.user.userInfo.uid, | 448 | uid: this.$store.state.user.userInfo.uid, |
| 450 | shopid: 0, | 449 | shopid: 0, |
| 451 | payCate: 2020, | 450 | payCate: 2020, |
| 452 | payMoney: this.totalPrice * 100, | 451 | payMoney: this.totalPrice * 100, |
| 453 | payWoodId: `fcdj-${uid}-${keyName}`, | 452 | payWoodId: `fcdj-${uid}-${keyName}`, |
| 454 | payWoodDesc: '在【非常戴镜】的微信付款凭证', | 453 | payWoodDesc: '在【非常戴镜】的微信付款凭证', |
| 455 | nonceStr, | 454 | nonceStr, |
| 456 | signType: 'MD5', | 455 | signType: 'MD5', |
| 457 | app_uid: 2020, | 456 | app_uid: 2020, |
| 458 | timeStamp, | 457 | timeStamp, |
| 459 | keyname: keyName, | 458 | keyname: keyName, |
| 460 | billInfo: JSON.stringify({ | 459 | billInfo: JSON.stringify({ |
| 461 | address: this.addressInfo, | 460 | address: this.addressInfo, |
| 462 | list: data, | 461 | list: data, |
| 463 | keyname: keyName, | 462 | keyname: keyName, |
| 464 | }), | 463 | }), |
| 465 | } | 464 | } |
| 466 | console.log('fieldSet', fieldSet) | 465 | console.log('fieldSet', fieldSet) |
| 467 | // 请求后台支付接口 | 466 | // 请求后台支付接口 |
| 468 | store.dispatch('order/pay', fieldSet).then(({ data, data2, pay_id: payId }) => { | 467 | store.dispatch('order/pay', fieldSet).then(({ data, data2, pay_id: payId }) => { |
| 469 | if (data.return_code === 'SUCCESS' && data.result_code === 'SUCCESS') { | 468 | if (data.return_code === 'SUCCESS' && data.result_code === 'SUCCESS') { |
| 470 | const stringA = `appId=wx115b25aa396d27ac&nonceStr=${nonceStr}&package=prepay_id=${data.prepay_id}&signType=MD5&timeStamp=${timeStamp}` | 469 | const stringA = `appId=wx115b25aa396d27ac&nonceStr=${nonceStr}&package=prepay_id=${data.prepay_id}&signType=MD5&timeStamp=${timeStamp}` |
| 471 | const stringSignTemp = stringA + '&key=NewMoney2017hatemydaddy123456789' | 470 | const stringSignTemp = stringA + '&key=NewMoney2017hatemydaddy123456789' |
| 472 | 471 | ||
| 473 | // 微信支付接口 | 472 | // 微信支付接口 |
| 474 | uni.requestPayment({ | 473 | uni.requestPayment({ |
| 475 | appId: data.appid, | 474 | appId: data.appid, |
| 476 | timeStamp, | 475 | timeStamp, |
| 477 | nonceStr, | 476 | nonceStr, |
| 478 | total_fee: this.totalPrice, | 477 | total_fee: this.totalPrice, |
| 479 | package: `prepay_id=${data.prepay_id}`, | 478 | package: `prepay_id=${data.prepay_id}`, |
| 480 | signType: 'MD5', | 479 | signType: 'MD5', |
| 481 | paySign: MD5Util.MD5(stringSignTemp).toUpperCase(), | 480 | paySign: MD5Util.MD5(stringSignTemp).toUpperCase(), |
| 482 | success: (res) => { | 481 | success: (res) => { |
| 483 | // 支付成功 | 482 | // 支付成功 |
| 484 | uni.showModal({ | 483 | uni.showModal({ |
| 485 | content: '支付成功', | 484 | content: '支付成功', |
| 486 | showCancel: false, | 485 | showCancel: false, |
| 487 | }) | 486 | }) |
| 488 | // 跳转订单详情页->状态 待收货 | 487 | // 跳转订单详情页->状态 待收货 |
| 489 | uni.reLaunch({ | 488 | uni.reLaunch({ |
| 490 | url: `../myOrderPaying/myOrderPaying?payId=${payId}&status=1&isPay=1`, | 489 | url: `../myOrderPaying/myOrderPaying?payId=${payId}&status=1&isPay=1`, |
| 491 | }) | 490 | }) |
| 492 | }, | 491 | }, |
| 493 | fail: (res) => { | 492 | fail: (res) => { |
| 494 | // 支付失败 | 493 | // 支付失败 |
| 495 | uni.showModal({ | 494 | uni.showModal({ |
| 496 | content: '支付失败', | 495 | content: '支付失败', |
| 497 | showCancel: false, | 496 | showCancel: false, |
| 498 | }) | 497 | }) |
| 499 | // 跳转订单详情页->状态 待付款 | 498 | // 跳转订单详情页->状态 待付款 |
| 500 | uni.reLaunch({ | 499 | uni.reLaunch({ |
| 501 | url: `../myOrderPaying/myOrderPaying?payId=${payId}&status=0&isPay=1`, | 500 | url: `../myOrderPaying/myOrderPaying?payId=${payId}&status=0&isPay=1`, |
| 502 | }) | 501 | }) |
| 503 | }, | 502 | }, |
| 504 | complete: () => { | 503 | complete: () => { |
| 505 | uni.hideLoading() | 504 | uni.hideLoading() |
| 506 | }, | 505 | }, |
| 507 | }) | 506 | }) |
| 508 | } else { | 507 | } else { |
| 509 | uni.showModal({ | 508 | uni.showModal({ |
| 510 | content: '支付失败', | 509 | content: '支付失败', |
| 511 | showCancel: false, | 510 | showCancel: false, |
| 512 | }) | 511 | }) |
| 513 | console.log('支付失败') | 512 | console.log('支付失败') |
| 514 | uni.hideLoading() | 513 | uni.hideLoading() |
| 515 | } | 514 | } |
| 516 | }) | 515 | }) |
| 517 | }, | 516 | }, |
| 518 | }, | 517 | }, |
| 519 | } | 518 | } |
| 520 | </script> | 519 | </script> |
| 521 | 520 | ||
| 522 | <style lang="scss"> | 521 | <style lang="scss"> |
| 523 | .wrap { | 522 | .wrap { |
| 524 | height: 100vh; | 523 | height: 100vh; |
| 525 | background-color: #f2f2f2; | 524 | background-color: #f2f2f2; |
| 526 | font-family: PingFangSC-Regular; | 525 | font-family: PingFangSC-Regular; |
| 527 | letter-spacing: -0.23px; | 526 | letter-spacing: -0.23px; |
| 528 | position: absolute; | 527 | position: absolute; |
| 529 | } | 528 | } |
| 530 | .addAddress { | 529 | .addAddress { |
| 531 | background-color: #ffffff; | 530 | background-color: #ffffff; |
| 532 | box-sizing: border-box; | 531 | box-sizing: border-box; |
| 533 | height: 124rpx; | 532 | height: 124rpx; |
| 534 | width: 100%; | 533 | width: 100%; |
| 535 | display: flex; | 534 | display: flex; |
| 536 | align-items: center; | 535 | align-items: center; |
| 537 | padding: 0 40rpx; | 536 | padding: 0 40rpx; |
| 538 | .addIcon { | 537 | .addIcon { |
| 539 | background-color: #f2f2f2; | 538 | background-color: #f2f2f2; |
| 540 | height: 56rpx; | 539 | height: 56rpx; |
| 541 | width: 60rpx; | 540 | width: 60rpx; |
| 542 | border-radius: 4rpx; | 541 | border-radius: 4rpx; |
| 543 | display: flex; | 542 | display: flex; |
| 544 | justify-content: center; | 543 | justify-content: center; |
| 545 | align-items: center; | 544 | align-items: center; |
| 546 | margin-right: 40rpx; | 545 | margin-right: 40rpx; |
| 547 | } | 546 | } |
| 548 | image { | 547 | image { |
| 549 | height: 28rpx; | 548 | height: 28rpx; |
| 550 | width: 30rpx; | 549 | width: 30rpx; |
| 551 | } | 550 | } |
| 552 | .addressText { | 551 | .addressText { |
| 553 | font-size: 28rpx; | 552 | font-size: 28rpx; |
| 554 | color: #333333; | 553 | color: #333333; |
| 555 | margin-right: 364rpx; | 554 | margin-right: 364rpx; |
| 556 | } | 555 | } |
| 557 | } | 556 | } |
| 558 | .content { | 557 | .content { |
| 559 | background-color: #f2f2f2; | 558 | background-color: #f2f2f2; |
| 560 | width: 100%; | 559 | width: 100%; |
| 561 | display: flex; | 560 | display: flex; |
| 562 | flex-direction: column; | 561 | flex-direction: column; |
| 563 | justify-content: center; | 562 | justify-content: center; |
| 564 | align-items: center; | 563 | align-items: center; |
| 565 | padding: 40rpx; | 564 | padding: 40rpx; |
| 566 | box-sizing: border-box; | 565 | box-sizing: border-box; |
| 567 | .orderInfo { | 566 | .orderInfo { |
| 568 | width: 670rpx; | 567 | width: 670rpx; |
| 569 | min-height: 488rpx; | 568 | min-height: 488rpx; |
| 570 | background-color: #ffffff; | 569 | background-color: #ffffff; |
| 571 | border-radius: 20rpx; | 570 | border-radius: 20rpx; |
| 572 | box-sizing: border-box; | 571 | box-sizing: border-box; |
| 573 | padding: 0 40rpx 40rpx 40rpx; | 572 | padding: 0 40rpx 40rpx 40rpx; |
| 574 | .title { | 573 | .title { |
| 575 | display: flex; | 574 | display: flex; |
| 576 | align-items: center; | 575 | align-items: center; |
| 577 | font-size: 28rpx; | 576 | font-size: 28rpx; |
| 578 | color: #333333; | 577 | color: #333333; |
| 579 | height: 60rpx; | 578 | height: 60rpx; |
| 580 | line-height: 40rpx; | 579 | line-height: 40rpx; |
| 581 | padding: 10rpx 10rpx 10rpx 0rpx; | 580 | padding: 10rpx 10rpx 10rpx 0rpx; |
| 582 | image { | 581 | image { |
| 583 | margin-right: 20rpx; | 582 | margin-right: 20rpx; |
| 584 | } | 583 | } |
| 585 | } | 584 | } |
| 586 | .infoBox { | 585 | .infoBox { |
| 587 | margin-top: 42rpx; | 586 | margin-top: 42rpx; |
| 588 | .infoTop { | 587 | .infoTop { |
| 589 | display: flex; | 588 | display: flex; |
| 590 | flex-direction: row; | 589 | flex-direction: row; |
| 591 | image { | 590 | image { |
| 592 | height: 188rpx; | 591 | height: 188rpx; |
| 593 | width: 188rpx; | 592 | width: 188rpx; |
| 594 | margin-right: 24rpx; | 593 | margin-right: 24rpx; |
| 595 | } | 594 | } |
| 596 | .infoRight { | 595 | .infoRight { |
| 597 | width: 374rpx; | 596 | width: 374rpx; |
| 598 | display: flex; | 597 | display: flex; |
| 599 | flex-direction: column; | 598 | flex-direction: column; |
| 600 | align-items: flex-start; | 599 | align-items: flex-start; |
| 601 | justify-content: space-between; | 600 | justify-content: space-between; |
| 602 | .goodName { | 601 | .goodName { |
| 603 | font-size: 28rpx; | 602 | font-size: 28rpx; |
| 604 | color: #333333; | 603 | color: #333333; |
| 605 | } | 604 | } |
| 606 | .remarks { | 605 | .remarks { |
| 607 | font-size: 20rpx; | 606 | font-size: 20rpx; |
| 608 | color: #999999; | 607 | color: #999999; |
| 609 | } | 608 | } |
| 610 | .priceBox { | 609 | .priceBox { |
| 611 | display: flex; | 610 | display: flex; |
| 612 | justify-content: space-between; | 611 | justify-content: space-between; |
| 613 | align-items: center; | 612 | align-items: center; |
| 614 | width: 100%; | 613 | width: 100%; |
| 615 | .price { | 614 | .price { |
| 616 | color: #ff6b4a; | 615 | color: #ff6b4a; |
| 617 | font-size: 28rpx; | 616 | font-size: 28rpx; |
| 618 | text { | 617 | text { |
| 619 | margin-left: 10rpx; | 618 | margin-left: 10rpx; |
| 620 | } | 619 | } |
| 621 | } | 620 | } |
| 622 | .originCost { | 621 | .originCost { |
| 623 | text-decoration: line-through; | 622 | text-decoration: line-through; |
| 624 | color: #999999; | 623 | color: #999999; |
| 625 | font-size: 20rpx; | 624 | font-size: 20rpx; |
| 626 | } | 625 | } |
| 627 | .counter { | 626 | .counter { |
| 628 | display: flex; | 627 | display: flex; |
| 629 | flex-direction: row; | 628 | flex-direction: row; |
| 630 | justify-content: space-between; | 629 | justify-content: space-between; |
| 631 | font-size: 28rpx; | 630 | font-size: 28rpx; |
| 632 | color: #333333; | 631 | color: #333333; |
| 633 | width: 122rpx; | 632 | width: 122rpx; |
| 634 | .btn { | 633 | .btn { |
| 635 | display: flex; | 634 | display: flex; |
| 636 | justify-content: center; | 635 | justify-content: center; |
| 637 | line-height: 32rpx; | 636 | line-height: 32rpx; |
| 638 | height: 32rpx; | 637 | height: 32rpx; |
| 639 | width: 32rpx; | 638 | width: 32rpx; |
| 640 | background-color: #f2f2f2; | 639 | background-color: #f2f2f2; |
| 641 | color: #cfcfcf; | 640 | color: #cfcfcf; |
| 642 | } | 641 | } |
| 643 | } | 642 | } |
| 644 | } | 643 | } |
| 645 | } | 644 | } |
| 646 | } | 645 | } |
| 647 | .infoBottom { | 646 | .infoBottom { |
| 648 | display: flex; | 647 | display: flex; |
| 649 | flex-direction: column; | 648 | flex-direction: column; |
| 650 | justify-content: flex-start; | 649 | justify-content: flex-start; |
| 651 | font-size: 24rpx; | 650 | font-size: 24rpx; |
| 652 | color: #333333; | 651 | color: #333333; |
| 653 | text { | 652 | text { |
| 654 | color: #999999; | 653 | color: #999999; |
| 655 | margin-left: 20rpx; | 654 | margin-left: 20rpx; |
| 656 | } | 655 | } |
| 657 | 656 | ||
| 658 | .norm { | 657 | .norm { |
| 659 | margin-top: 28rpx; | 658 | margin-top: 28rpx; |
| 660 | } | 659 | } |
| 661 | .shippingMethod { | 660 | .shippingMethod { |
| 662 | margin-top: 12rpx; | 661 | margin-top: 12rpx; |
| 663 | } | 662 | } |
| 664 | .message { | 663 | .message { |
| 665 | display: flex; | 664 | display: flex; |
| 666 | flex-direction: row; | 665 | flex-direction: row; |
| 667 | align-items: center; | 666 | align-items: center; |
| 668 | margin-top: 18rpx; | 667 | margin-top: 18rpx; |
| 669 | input { | 668 | input { |
| 670 | margin-left: 20rpx; | 669 | margin-left: 20rpx; |
| 671 | width: 75%; | 670 | width: 75%; |
| 672 | } | 671 | } |
| 673 | } | 672 | } |
| 674 | } | 673 | } |
| 675 | } | 674 | } |
| 676 | } | 675 | } |
| 677 | .payWay { | 676 | .payWay { |
| 678 | height: 464rpx; | 677 | height: 464rpx; |
| 679 | width: 670rpx; | 678 | width: 670rpx; |
| 680 | background-color: #ffffff; | 679 | background-color: #ffffff; |
| 681 | color: #333333; | 680 | color: #333333; |
| 682 | font-size: 24rpx; | 681 | font-size: 24rpx; |
| 683 | border-radius: 20rpx; | 682 | border-radius: 20rpx; |
| 684 | box-sizing: border-box; | 683 | box-sizing: border-box; |
| 685 | padding: 0 52rpx 0rpx 40rpx; | 684 | padding: 0 52rpx 0rpx 40rpx; |
| 686 | margin-top: 20rpx; | 685 | margin-top: 20rpx; |
| 687 | display: flex; | 686 | display: flex; |
| 688 | flex-direction: column; | 687 | flex-direction: column; |
| 689 | justify-content: center; | 688 | justify-content: center; |
| 690 | align-items: flex-start; | 689 | align-items: flex-start; |
| 691 | .item { | 690 | .item { |
| 692 | display: flex; | 691 | display: flex; |
| 693 | flex-direction: row; | 692 | flex-direction: row; |
| 694 | justify-content: space-between; | 693 | justify-content: space-between; |
| 695 | align-items: center; | 694 | align-items: center; |
| 696 | width: 100%; | 695 | width: 100%; |
| 697 | height: 115rpx; | 696 | height: 115rpx; |
| 698 | .itemRight { | 697 | .itemRight { |
| 699 | display: flex; | 698 | display: flex; |
| 700 | flex-direction: row; | 699 | flex-direction: row; |
| 701 | justify-content: space-between; | 700 | justify-content: space-between; |
| 702 | align-items: center; | 701 | align-items: center; |
| 703 | image { | 702 | image { |
| 704 | height: 24rpx; | 703 | height: 24rpx; |
| 705 | width: 12rpx; | 704 | width: 12rpx; |
| 706 | } | 705 | } |
| 707 | .rightText { | 706 | .rightText { |
| 708 | margin-right: 20rpx; | 707 | margin-right: 20rpx; |
| 709 | text-align: right; | 708 | text-align: right; |
| 710 | .choosePayWay { | 709 | .choosePayWay { |
| 711 | display: flex; | 710 | display: flex; |
| 712 | align-items: center; | 711 | align-items: center; |
| 713 | text { | 712 | text { |
| 714 | color: #333333; | 713 | color: #333333; |
| 715 | } | 714 | } |
| 716 | image { | 715 | image { |
| 717 | height: 36rpx; | 716 | height: 36rpx; |
| 718 | width: 40rpx; | 717 | width: 40rpx; |
| 719 | margin-right: 8px; | 718 | margin-right: 8px; |
| 720 | } | 719 | } |
| 721 | } | 720 | } |
| 722 | .randomSubstraction { | 721 | .randomSubstraction { |
| 723 | color: #ff6b4a; | 722 | color: #ff6b4a; |
| 724 | } | 723 | } |
| 725 | .preferentialWay { | 724 | .preferentialWay { |
| 726 | color: #999999; | 725 | color: #999999; |
| 727 | } | 726 | } |
| 728 | } | 727 | } |
| 729 | .freight, | 728 | .freight, |
| 730 | .total { | 729 | .total { |
| 731 | margin-right: 32rpx; | 730 | margin-right: 32rpx; |
| 732 | } | 731 | } |
| 733 | text { | 732 | text { |
| 734 | color: #ff6b4a; | 733 | color: #ff6b4a; |
| 735 | } | 734 | } |
| 736 | } | 735 | } |
| 737 | } | 736 | } |
| 738 | } | 737 | } |
| 739 | // .checkBox { | 738 | // .checkBox { |
| 740 | // height: 58rpx; | 739 | // height: 58rpx; |
| 741 | // line-height: 58rpx; | 740 | // line-height: 58rpx; |
| 742 | // width: 100%; | 741 | // width: 100%; |
| 743 | // margin-top: 36rpx; | 742 | // margin-top: 36rpx; |
| 744 | // margin-left: 40rpx; | 743 | // margin-left: 40rpx; |
| 745 | // font-size: 12px; | 744 | // font-size: 12px; |
| 746 | // color: #999999; | 745 | // color: #999999; |
| 747 | // } | 746 | // } |
| 748 | } | 747 | } |
| 749 | .footer { | 748 | .footer { |
| 750 | height: 112rpx; | 749 | height: 112rpx; |
| 751 | width: 100%; | 750 | width: 100%; |
| 752 | background-color: #fff; | 751 | background-color: #fff; |
| 753 | font-size: 16px; | 752 | font-size: 16px; |
| 754 | display: flex; | 753 | display: flex; |
| 755 | justify-content: space-between; | 754 | justify-content: space-between; |
| 756 | align-items: center; | 755 | align-items: center; |
| 757 | position: fixed; | 756 | position: fixed; |
| 758 | bottom: 0; | 757 | bottom: 0; |
| 759 | z-index: 9999; | 758 | z-index: 9999; |
| 760 | .footerLeft { | 759 | .footerLeft { |
| 761 | display: flex; | 760 | display: flex; |
| 762 | justify-content: center; | 761 | justify-content: center; |
| 763 | align-items: center; | 762 | align-items: center; |
| 764 | width: 50%; | 763 | width: 50%; |
| 765 | color: #333333; | 764 | color: #333333; |
| 766 | text { | 765 | text { |
| 767 | color: #ff6b4a; | 766 | color: #ff6b4a; |
| 768 | } | 767 | } |
| 769 | } | 768 | } |
| 770 | .footerRight { | 769 | .footerRight { |
| 771 | display: flex; | 770 | display: flex; |
| 772 | justify-content: flex-end; | 771 | justify-content: flex-end; |
| 773 | align-items: center; | 772 | align-items: center; |
| 774 | width: 50%; | 773 | width: 50%; |
| 775 | margin-right: 26rpx; | 774 | margin-right: 26rpx; |
| 776 | .paybtn { | 775 | .paybtn { |
| 777 | display: flex; | 776 | display: flex; |
| 778 | justify-content: center; | 777 | justify-content: center; |
| 779 | align-items: center; | 778 | align-items: center; |
| 780 | background: #ff6b4a; | 779 | background: #ff6b4a; |
| 781 | border-radius: 20px; | 780 | border-radius: 20px; |
| 782 | border-radius: 20px; | 781 | border-radius: 20px; |
| 783 | color: #ffffff; | 782 | color: #ffffff; |
| 784 | width: 204rpx; | 783 | width: 204rpx; |
| 785 | height: 80rpx; | 784 | height: 80rpx; |
| 786 | } | 785 | } |
| 787 | } | 786 | } |
| 788 | } | 787 | } |
| 789 | // 地址信息样式 | 788 | // 地址信息样式 |
| 790 | .order-user { | 789 | .order-user { |
| 791 | width: 670rpx; | 790 | width: 670rpx; |
| 792 | height: 228rpx; | 791 | height: 228rpx; |
| 793 | background: #ffffff; | 792 | background: #ffffff; |
| 794 | border-radius: 14rpx; | 793 | border-radius: 14rpx; |
| 795 | margin: 0 auto; | 794 | margin: 0 auto; |
| 796 | margin-top: 20rpx; | 795 | margin-top: 20rpx; |
| 797 | position: relative; | 796 | position: relative; |
| 798 | .order-user-head { | 797 | .order-user-head { |
| 799 | display: flex; | 798 | display: flex; |
| 800 | height: 108rpx; | 799 | height: 108rpx; |
| 801 | width: 100%; | 800 | width: 100%; |
| 802 | align-items: center; | 801 | align-items: center; |
| 803 | padding-left: 126rpx; | 802 | padding-left: 126rpx; |
| 804 | box-sizing: border-box; | 803 | box-sizing: border-box; |
| 805 | .name { | 804 | .name { |
| 806 | display: flex; | 805 | display: flex; |
| 807 | justify-content: space-between; | 806 | justify-content: space-between; |
| 808 | font-size: 14px; | 807 | font-size: 14px; |
| 809 | color: #333333; | 808 | color: #333333; |
| 810 | letter-spacing: -0.26px; | 809 | letter-spacing: -0.26px; |
| 811 | margin-right: 20rpx; | 810 | margin-right: 20rpx; |
| 812 | .default { | 811 | .default { |
| 813 | height: 40rpx; | 812 | height: 40rpx; |
| 814 | width: 80rpx; | 813 | width: 80rpx; |
| 815 | background-color: #4a90e2; | 814 | background-color: #4a90e2; |
| 816 | border-radius: 13px; | 815 | border-radius: 13px; |
| 817 | border-radius: 13px; | 816 | border-radius: 13px; |
| 818 | text-align: center; | 817 | text-align: center; |
| 819 | margin-right: 20rpx; | 818 | margin-right: 20rpx; |
| 820 | text { | 819 | text { |
| 821 | display: flex; | 820 | display: flex; |
| 822 | justify-content: center; | 821 | justify-content: center; |
| 823 | align-items: center; | 822 | align-items: center; |
| 824 | font-size: 12px; | 823 | font-size: 12px; |
| 825 | color: #ffffff; | 824 | color: #ffffff; |
| 826 | letter-spacing: -0.23px; | 825 | letter-spacing: -0.23px; |
| 827 | } | 826 | } |
| 828 | } | 827 | } |
| 829 | } | 828 | } |
| 830 | .mobile { | 829 | .mobile { |
| 831 | font-size: 14px; | 830 | font-size: 14px; |
| 832 | color: #999999; | 831 | color: #999999; |
| 833 | letter-spacing: -0.26px; | 832 | letter-spacing: -0.26px; |
| 834 | } | 833 | } |
| 835 | } | 834 | } |
| 836 | .order-user-body { | 835 | .order-user-body { |
| 837 | display: flex; | 836 | display: flex; |
| 838 | width: 100%; | 837 | width: 100%; |
| 839 | image { | 838 | image { |
| 840 | width: 24px; | 839 | width: 24px; |
| 841 | height: 28px; | 840 | height: 28px; |
| 842 | margin: 12rpx 32rpx 0 40rpx; | 841 | margin: 12rpx 32rpx 0 40rpx; |
| 843 | } | 842 | } |
| 844 | .address { | 843 | .address { |
| 845 | font-weight: bold; | 844 | font-weight: bold; |
| 846 | font-size: 14px; | 845 | font-size: 14px; |
| 847 | color: #333333; | 846 | color: #333333; |
| 848 | letter-spacing: -0.26px; | 847 | letter-spacing: -0.26px; |
| 849 | } | 848 | } |
| 850 | } | 849 | } |
| 851 | 850 | ||
| 852 | .arrow { | 851 | .arrow { |
| 853 | width: 12px; | 852 | width: 12px; |
| 854 | height: 12px; | 853 | height: 12px; |
| 855 | position: absolute; | 854 | position: absolute; |
| 856 | right: 40rpx; | 855 | right: 40rpx; |
| 857 | bottom: 104rpx; | 856 | bottom: 104rpx; |
| 858 | } | 857 | } |
| 859 | } | 858 | } |
| 860 | 859 | ||
| 861 | .user_address { | 860 | .user_address { |
| 862 | height: 62px; | 861 | height: 62px; |
| 863 | .order_user_body_add { | 862 | .order_user_body_add { |
| 864 | display: flex; | 863 | display: flex; |
| 865 | align-items: center; | 864 | align-items: center; |
| 866 | image { | 865 | image { |
| 867 | background: #f2f2f2; | 866 | background: #f2f2f2; |
| 868 | border-radius: 2px; | 867 | border-radius: 2px; |
| 869 | border-radius: 2px; | 868 | border-radius: 2px; |
| 870 | width: 30px; | 869 | width: 30px; |
| 871 | height: 28px; | 870 | height: 28px; |
| 872 | margin: 0 20px; | 871 | margin: 0 20px; |
| 873 | } | 872 | } |
| 874 | .address_add { | 873 | .address_add { |
| 875 | font-family: PingFangSC-Regular; | 874 | font-family: PingFangSC-Regular; |
| 876 | font-size: 14px; | 875 | font-size: 14px; |
| 877 | color: #333333; | 876 | color: #333333; |
| 878 | letter-spacing: -0.26px; | 877 | letter-spacing: -0.26px; |
| 879 | line-height: 62px; | 878 | line-height: 62px; |
| 880 | } | 879 | } |
| 881 | } | 880 | } |
| 882 | .arrow { | 881 | .arrow { |
| 883 | bottom: 46rpx; | 882 | bottom: 46rpx; |
| 884 | } | 883 | } |
| 885 | } | 884 | } |
| 886 | .last_zhanwei { | 885 | .last_zhanwei { |
| 887 | background: #f2f2f2; | 886 | background: #f2f2f2; |
| 888 | height: 60px; | 887 | height: 60px; |
| 889 | } | 888 | } |
| 890 | </style> | 889 | </style> |
src/pages/myOrderPaying/myOrderPaying.vue
| 1 | <!-- 订单待付款 待收货 --> | 1 | <!-- 订单待付款 待收货 --> |
| 2 | <template> | 2 | <template> |
| 3 | <view class="content"> | 3 | <view class="content"> |
| 4 | <view | 4 | <view |
| 5 | class="headerBanner" | 5 | class="headerBanner" |
| 6 | v-if="status == '2'||'3'" | 6 | v-if="status == '2'||'3'" |
| 7 | > | 7 | > |
| 8 | <view class="bannerLeft"> | 8 | <view class="bannerLeft"> |
| 9 | <view class="T1">订单已完成</view> | 9 | <view class="T1">订单已完成</view> |
| 10 | </view> | 10 | </view> |
| 11 | <image | 11 | <image |
| 12 | src="../../static/car.png" | 12 | src="../../static/car.png" |
| 13 | mode="aspectFill" | 13 | mode="aspectFill" |
| 14 | ></image> | 14 | ></image> |
| 15 | </view> | 15 | </view> |
| 16 | <!-- 待付款 --> | 16 | <!-- 待付款 --> |
| 17 | <view | 17 | <view |
| 18 | class="order-time" | 18 | class="order-time" |
| 19 | v-if="status == '0'" | 19 | v-if="status == '0'" |
| 20 | > | 20 | > |
| 21 | <text>请在</text> | 21 | <text>请在</text> |
| 22 | <uni-countdown | 22 | <uni-countdown |
| 23 | color="#EC5D3B" | 23 | color="#EC5D3B" |
| 24 | splitor-color="#EC5D3B" | 24 | splitor-color="#EC5D3B" |
| 25 | :show-day="false" | 25 | :show-day="false" |
| 26 | :hour="0" | 26 | :hour="0" |
| 27 | :second="getLeftTime" | 27 | :second="getLeftTime" |
| 28 | @timeup="timeup" | 28 | @timeup="timeup" |
| 29 | > | 29 | > |
| 30 | </uni-countdown> | 30 | </uni-countdown> |
| 31 | 31 | ||
| 32 | <text>内完成付款</text> | 32 | <text>内完成付款</text> |
| 33 | </view> | 33 | </view> |
| 34 | 34 | ||
| 35 | <view | 35 | <view |
| 36 | class="headerBanner" | 36 | class="headerBanner" |
| 37 | v-if="status == '1'" | 37 | v-if="status == '1'" |
| 38 | > | 38 | > |
| 39 | <view class="bannerLeft"> | 39 | <view class="bannerLeft"> |
| 40 | <view class="T1">卖家已发货</view> | 40 | <view class="T1">卖家已发货</view> |
| 41 | <!-- <view class="T2">还剩 确认收货</view> --> | 41 | <!-- <view class="T2">还剩 确认收货</view> --> |
| 42 | </view> | 42 | </view> |
| 43 | <image | 43 | <image |
| 44 | src="../../static/car.png" | 44 | src="../../static/car.png" |
| 45 | mode="aspectFill" | 45 | mode="aspectFill" |
| 46 | ></image> | 46 | ></image> |
| 47 | </view> | 47 | </view> |
| 48 | 48 | ||
| 49 | <view class="order"> | 49 | <view class="order"> |
| 50 | <view class="order-user"> | 50 | <view class="order-user"> |
| 51 | <view class="order-user-head"> | 51 | <view class="order-user-head"> |
| 52 | <text class="p1">{{orderAddressInfo.name}}</text> | 52 | <text class="p1">{{orderAddressInfo.name}}</text> |
| 53 | <text class="p2">{{orderAddressInfo.mobile}}</text> | 53 | <text class="p2">{{orderAddressInfo.mobile}}</text> |
| 54 | </view> | 54 | </view> |
| 55 | <view class="order-user-body"> | 55 | <view class="order-user-body"> |
| 56 | <image src="../../static/myorder-paying-location.png"></image> | 56 | <image src="../../static/myorder-paying-location.png"></image> |
| 57 | <text class="p3">{{orderAddressInfo.address}}</text> | 57 | <text class="p3">{{orderAddressInfo.address}}</text> |
| 58 | </view> | 58 | </view> |
| 59 | </view> | 59 | </view> |
| 60 | <view class="order-info"> | 60 | <view class="order-info"> |
| 61 | <view | 61 | <view |
| 62 | class="order-info-head" | 62 | class="order-info-head" |
| 63 | v-for="(orderInfoListItem, index) in orderInfoList" | 63 | v-for="(orderInfoListItem, index) in orderInfoList" |
| 64 | :key="index" | 64 | :key="index" |
| 65 | > | 65 | > |
| 66 | <image | 66 | <image |
| 67 | :src="orderInfoListItem.imgUrl" | 67 | :src="orderInfoListItem.imgUrl" |
| 68 | mode="aspectFill" | 68 | mode="aspectFill" |
| 69 | ></image> | 69 | ></image> |
| 70 | <view class="order-info-head-r"> | 70 | <view class="order-info-head-r"> |
| 71 | <text class="p1">{{orderInfoListItem.p_name}}</text> | 71 | <text class="p1">{{orderInfoListItem.p_name}}</text> |
| 72 | <template v-if="orderInfoList.length === 1"> | 72 | <template v-if="orderInfoList.length === 1"> |
| 73 | <view | 73 | <view |
| 74 | class="p2" | 74 | class="p2" |
| 75 | style="margin: 0;" | 75 | style="margin: 0;" |
| 76 | > | 76 | > |
| 77 | {{skuList[0] ? skuList[0].sku_name.replace('_', '/') : ''}} | 77 | {{skuList[0] ? skuList[0].sku_name.replace('_', '/') : ''}} |
| 78 | </view> | 78 | </view> |
| 79 | </template> | 79 | </template> |
| 80 | <view class="infoText-bottom"> | 80 | <view class="infoText-bottom"> |
| 81 | <view class="markPrice">¥{{Number(orderInfoListItem.nowPrice)/100}}</view> | 81 | <view class="markPrice">¥{{Number(orderInfoListItem.nowPrice)/100}}</view> |
| 82 | <view class="buy-num">X {{orderInfoListItem.num}}</view> | 82 | <view class="buy-num">X {{orderInfoListItem.num}}</view> |
| 83 | </view> | 83 | </view> |
| 84 | </view> | 84 | </view> |
| 85 | </view> | 85 | </view> |
| 86 | <!-- <view class="order-info-goodsnum"> | 86 | <!-- <view class="order-info-goodsnum"> |
| 87 | <text>X1</text> | 87 | <text>X1</text> |
| 88 | </view> --> | 88 | </view> --> |
| 89 | <text class="order-info-freight"> | 89 | <text class="order-info-freight"> |
| 90 | <text class="p1">运费</text> | 90 | <text class="p1">运费</text> |
| 91 | <text class="p2">免运费</text> | 91 | <text class="p2">免运费</text> |
| 92 | </text> | 92 | </text> |
| 93 | <text class="order-info-discount"> | 93 | <text class="order-info-discount"> |
| 94 | <text class="p1">优惠</text> | 94 | <text class="p1">优惠</text> |
| 95 | <text class="p2">-¥{{totalDiscount}}</text> | 95 | <text class="p2">-¥{{totalDiscount}}</text> |
| 96 | </text> | 96 | </text> |
| 97 | <text class="order-info-price"> | 97 | <text class="order-info-price"> |
| 98 | <text class="p1">实付</text> | 98 | <text class="p1">实付</text> |
| 99 | <text class="p2">¥{{Number(totalPrice)/100}}</text> | 99 | <text class="p2">¥{{Number(totalPrice)/100}}</text> |
| 100 | </text> | 100 | </text> |
| 101 | <text class="order-info-num"> | 101 | <text class="order-info-num"> |
| 102 | <text>订单号:{{payId}}</text> | 102 | <text>订单号:{{payId}}</text> |
| 103 | </text> | 103 | </text> |
| 104 | <text class="order-info-time"> | 104 | <text class="order-info-time"> |
| 105 | <text>下单时间:{{orderInfo.pay_time}}</text> | 105 | <text>下单时间:{{orderInfo.pay_time}}</text> |
| 106 | </text> | 106 | </text> |
| 107 | <view class="order-info-hr"></view> | 107 | <view class="order-info-hr"></view> |
| 108 | <view class="order-info-contact"> | 108 | <view class="order-info-contact"> |
| 109 | <image src="../../static/myorder-paying-contact.png"></image> | 109 | <image src="../../static/myorder-paying-contact.png"></image> |
| 110 | <button open-type="contact">联系客服</button> | 110 | <button open-type="contact">联系客服</button> |
| 111 | </view> | 111 | </view> |
| 112 | </view> | 112 | </view> |
| 113 | </view> | 113 | </view> |
| 114 | <view | 114 | <view |
| 115 | class="order-confim" | 115 | class="order-confim" |
| 116 | v-if="status == '0'" | 116 | v-if="status == '0'" |
| 117 | > | 117 | > |
| 118 | <button | 118 | <button |
| 119 | class="b1" | 119 | class="b1" |
| 120 | @click="cancleOrder" | 120 | @click="cancleOrder" |
| 121 | >取消订单</button> | 121 | >取消订单</button> |
| 122 | <button | 122 | <button |
| 123 | class="b2" | 123 | class="b2" |
| 124 | @click="paylog" | 124 | @click="paylog" |
| 125 | >立即支付</button> | 125 | >立即支付</button> |
| 126 | </view> | 126 | </view> |
| 127 | 127 | ||
| 128 | <view | 128 | <view |
| 129 | class="order-confim" | 129 | class="order-confim" |
| 130 | v-if="status == '1'" | 130 | v-if="status == '1'" |
| 131 | > | 131 | > |
| 132 | <!-- <button class="b1">取消订单</button> --> | 132 | <!-- <button class="b1">取消订单</button> --> |
| 133 | <button | 133 | <button |
| 134 | class="b2" | 134 | class="b2" |
| 135 | @click="confirmOrder" | 135 | @click="confirmOrder" |
| 136 | >确认收货</button> | 136 | >确认收货</button> |
| 137 | </view> | 137 | </view> |
| 138 | <view | 138 | <view |
| 139 | class="order-confim" | 139 | class="order-confim" |
| 140 | v-if="status == '2'" | 140 | v-if="status == '2'" |
| 141 | > | 141 | > |
| 142 | <button | 142 | <button |
| 143 | class="b2" | 143 | class="b2" |
| 144 | @click="toDetail" | 144 | @click="toDetail" |
| 145 | >再次购买</button> | 145 | >再次购买</button> |
| 146 | </view> | 146 | </view> |
| 147 | 147 | ||
| 148 | </view> | 148 | </view> |
| 149 | </template> | 149 | </template> |
| 150 | 150 | ||
| 151 | <script> | 151 | <script> |
| 152 | import store from '@/store' | 152 | import store from '@/store' |
| 153 | import MD5Util from '../../utils/md5' | 153 | import MD5Util from '../../utils/md5' |
| 154 | import UniCountdown from '../../components/UniCountdown/UniCountdown.vue' | 154 | import UniCountdown from '../../components/UniCountdown/UniCountdown.vue' |
| 155 | export default { | 155 | export default { |
| 156 | components: { | 156 | components: { |
| 157 | UniCountdown, | 157 | UniCountdown, |
| 158 | }, | 158 | }, |
| 159 | data() { | 159 | data() { |
| 160 | return { | 160 | return { |
| 161 | payId: '', | 161 | payId: '', |
| 162 | payTime: '', | 162 | payTime: '', |
| 163 | status: '', // status 0 待付款 1 已发货 | 163 | status: '', // status 0 待付款 1 已发货 |
| 164 | uid: '', | 164 | uid: '', |
| 165 | openid: '', | 165 | openid: '', |
| 166 | lefttime: 0, | 166 | lefttime: 0, |
| 167 | isPay: 0, | 167 | isPay: 0, |
| 168 | totalPrice: 0, | 168 | totalPrice: 0, |
| 169 | index: 0, | 169 | index: 0, |
| 170 | } | 170 | } |
| 171 | }, | 171 | }, |
| 172 | async onLoad ({ payId, status, isPay }) { | 172 | async onLoad ({ payId, status, isPay }) { |
| 173 | this.payId = payId | 173 | this.payId = payId |
| 174 | this.status = status | 174 | this.status = status |
| 175 | this.isPay = isPay | 175 | this.isPay = isPay |
| 176 | // console.log('++++++++++++++++++',this.status) | 176 | // console.log('++++++++++++++++++',this.status) |
| 177 | const openid = uni.getStorageSync('openid') | 177 | const openid = uni.getStorageSync('openid') |
| 178 | const uid = this.$store.state.user.userInfo.uid | 178 | const uid = this.$store.state.user.userInfo.uid |
| 179 | this.uid = uid | 179 | this.uid = uid |
| 180 | this.openid = openid | 180 | this.openid = openid |
| 181 | await store.dispatch('orderRead/getOrderInfo', { | 181 | await store.dispatch('orderRead/getOrderInfo', { |
| 182 | pay_id: this.payId, | 182 | pay_id: this.payId, |
| 183 | uid: uid, | 183 | uid: uid, |
| 184 | openid: openid, | 184 | openid: openid, |
| 185 | }) | 185 | }) |
| 186 | const { list } = this.orderInfo.order_info | 186 | const { list } = this.orderInfo.order_info |
| 187 | for (let index = 0; index < list.length; index++) { | 187 | for (let index = 0; index < list.length; index++) { |
| 188 | await store.dispatch('orderRead/goodDetails', { | 188 | await store.dispatch('orderRead/goodDetails', { |
| 189 | pid: list[index].pid, | 189 | pid: list[index].pid, |
| 190 | skId: list[index].sk_id, | 190 | skId: list[index].sk_id, |
| 191 | }) | 191 | }) |
| 192 | } | 192 | } |
| 193 | this.totalPrice = this.orderInfo.total_fee | 193 | this.totalPrice = this.orderInfo.total_fee |
| 194 | }, | 194 | }, |
| 195 | // 若从支付页面跳转过来,返回直接返回到首页 | 195 | // 若从支付页面跳转过来,返回直接返回到首页 |
| 196 | onBackPress(option) { | 196 | onBackPress(option) { |
| 197 | if (option.from === 'backbutton' && this.isPay) { | 197 | if (option.from === 'backbutton' && this.isPay) { |
| 198 | uni.switchTab({ | 198 | uni.switchTab({ |
| 199 | url: '/pages/index/index', | 199 | url: '/pages/index/index', |
| 200 | }) | 200 | }) |
| 201 | return true // 阻止默认返回行为 | 201 | return true // 阻止默认返回行为 |
| 202 | } | 202 | } |
| 203 | }, | 203 | }, |
| 204 | computed: { | 204 | computed: { |
| 205 | // 规格列表 | 205 | // 规格列表 |
| 206 | skuList () { | 206 | skuList () { |
| 207 | return this.$store.state.orderRead.skuList | 207 | return this.$store.state.orderRead.skuList |
| 208 | }, | 208 | }, |
| 209 | orderInfo() { | 209 | orderInfo() { |
| 210 | return this.$store.state.orderRead.orderInfo | 210 | return this.$store.state.orderRead.orderInfo |
| 211 | }, | 211 | }, |
| 212 | orderInfoList () { | 212 | orderInfoList () { |
| 213 | return this.orderInfo.order_info ? this.orderInfo.order_info.list : null | 213 | return this.orderInfo.order_info ? this.orderInfo.order_info.list : null |
| 214 | }, | 214 | }, |
| 215 | // 获取订单地址信息 | 215 | // 获取订单地址信息 |
| 216 | orderAddressInfo () { | 216 | orderAddressInfo () { |
| 217 | return this.orderInfo.order_info ? this.orderInfo.order_info.address : null | 217 | return this.orderInfo.order_info ? this.orderInfo.order_info.address : null |
| 218 | }, | 218 | }, |
| 219 | // 订单付款时间 | 219 | // 订单付款时间 |
| 220 | getLeftTime () { | 220 | getLeftTime () { |
| 221 | return this.orderInfo.order_info ? this.orderInfo.order_info.lefttime : 1800 | 221 | const orderTime = new Date(this.orderInfo.pay_time.replace(/-/g, '/')).getTime() |
| 222 | const nowTime = new Date().getTime() | ||
| 223 | console.log('getLeftTime', 1800 - (nowTime - orderTime)) | ||
| 224 | return 1800 - (nowTime - orderTime) / 1000 | ||
| 222 | }, | 225 | }, |
| 223 | // 计算总优惠额 | 226 | // 计算总优惠额 |
| 224 | totalDiscount() { | 227 | totalDiscount() { |
| 225 | const discountInfoList = this.orderInfo.discount_info | 228 | const discountInfoList = this.orderInfo.discount_info |
| 226 | let totalDiscount = 0 | 229 | let totalDiscount = 0 |
| 227 | if (discountInfoList) { | 230 | if (discountInfoList) { |
| 228 | discountInfoList.map((discountItem, index) => { | 231 | discountInfoList.map((discountItem, index) => { |
| 229 | totalDiscount += Number(discountItem.value) | 232 | totalDiscount += Number(discountItem.value) |
| 230 | }) | 233 | }) |
| 231 | } | 234 | } |
| 232 | // console.log(totalDiscount) | 235 | // console.log(totalDiscount) |
| 233 | return totalDiscount | 236 | return totalDiscount |
| 234 | }, | 237 | }, |
| 235 | }, | 238 | }, |
| 236 | 239 | ||
| 237 | methods: { | 240 | methods: { |
| 238 | // 再次购买 暂时只支持跳转第一个商品 | 241 | // 再次购买 暂时只支持跳转第一个商品 |
| 239 | toDetail() { | 242 | toDetail() { |
| 240 | const pid = this.orderInfo.order_info.list[0].pid | 243 | const pid = this.orderInfo.order_info.list[0].pid |
| 241 | uni.navigateTo({ | 244 | uni.navigateTo({ |
| 242 | url: '../details/details?pid=' + pid, | 245 | url: '../details/details?pid=' + pid, |
| 243 | fail: (res) => { console.log(res) }, | 246 | fail: (res) => { console.log(res) }, |
| 244 | }) | 247 | }) |
| 245 | }, | 248 | }, |
| 246 | // 取消订单 | 249 | // 取消订单 |
| 247 | timeup() { | 250 | timeup() { |
| 248 | this.cancleOrder() | 251 | this.cancleOrder() |
| 249 | }, | 252 | }, |
| 250 | cancleOrder() { | 253 | cancleOrder() { |
| 251 | const uid = this.uid | 254 | const uid = this.uid |
| 252 | const openid = this.openid | 255 | const openid = this.openid |
| 253 | const keyname = this.orderInfo.order_info.keyname | 256 | const keyname = this.orderInfo.order_info.keyname |
| 254 | const that = this | 257 | const that = this |
| 255 | // console.log('keyname',this.orderInfo.keyname) | 258 | // console.log('keyname',this.orderInfo.keyname) |
| 256 | uni.showModal({ | 259 | uni.showModal({ |
| 257 | title: '提示', | 260 | title: '提示', |
| 258 | content: '现在取消,订单不可恢复哦,确认取消吗?', | 261 | content: '现在取消,订单不可恢复哦,确认取消吗?', |
| 259 | success: function(res) { | 262 | success: function(res) { |
| 260 | if (res.confirm) { | 263 | if (res.confirm) { |
| 261 | store.dispatch('cancelOrder/cancel', { | 264 | store.dispatch('cancelOrder/cancel', { |
| 262 | keyname: keyname, | 265 | keyname: keyname, |
| 263 | uid: uid, | 266 | uid: uid, |
| 264 | openid: openid, | 267 | openid: openid, |
| 265 | }).then(() => { | 268 | }).then(() => { |
| 266 | if (that.isPay === '1') { | 269 | if (that.isPay === '1') { |
| 267 | console.log('lalallala-1') | 270 | console.log('lalallala-1') |
| 268 | uni.switchTab({ | 271 | uni.switchTab({ |
| 269 | url: '/pages/index/index', | 272 | url: '/pages/index/index', |
| 270 | }) | 273 | }) |
| 271 | } else { | 274 | } else { |
| 272 | console.log('lalallala-2') | 275 | console.log('lalallala-2') |
| 273 | uni.navigateBack({ | 276 | uni.navigateBack({ |
| 274 | delta: 1, | 277 | delta: 1, |
| 275 | }) | 278 | }) |
| 276 | } | 279 | } |
| 277 | }) | 280 | }) |
| 278 | } else if (res.cancel) { | 281 | } else if (res.cancel) { |
| 279 | console.log('用户点击取消', that.isPay) | 282 | console.log('用户点击取消', that.isPay) |
| 280 | } | 283 | } |
| 281 | }, | 284 | }, |
| 282 | }) | 285 | }) |
| 283 | }, | 286 | }, |
| 284 | paylog() { | 287 | paylog() { |
| 285 | console.log('pay', this.orderInfo) | 288 | console.log('pay', this.orderInfo) |
| 286 | const { data, exKeyName: keyName } = this.orderInfo | 289 | const { data, exKeyName: keyName } = this.orderInfo |
| 287 | const uid = uni.getStorageSync('uid') | 290 | const uid = uni.getStorageSync('uid') |
| 288 | const timeStamp = new Date().getTime().toString() | 291 | const timeStamp = new Date().getTime().toString() |
| 289 | const nonceStr = 'asfafasfasfasfasf' | 292 | const nonceStr = 'asfafasfasfasfasf' |
| 290 | // 支付参数 | 293 | // 支付参数 |
| 291 | const fieldSet = { | 294 | const fieldSet = { |
| 292 | openid: this.$store.state.user.userInfo.openid, | 295 | openid: this.$store.state.user.userInfo.openid, |
| 293 | uid: this.$store.state.user.userInfo.uid, | 296 | uid: this.$store.state.user.userInfo.uid, |
| 294 | shopid: 0, | 297 | shopid: 0, |
| 295 | payCate: 2020, | 298 | payCate: 2020, |
| 296 | payMoney: this.totalPrice, | 299 | payMoney: this.totalPrice, |
| 297 | payWoodId: `fcdj-${uid}-${keyName}`, | 300 | payWoodId: `fcdj-${uid}-${keyName}`, |
| 298 | payWoodDesc: '在【非常戴镜】的微信付款凭证', | 301 | payWoodDesc: '在【非常戴镜】的微信付款凭证', |
| 299 | nonceStr, | 302 | nonceStr, |
| 300 | signType: 'MD5', | 303 | signType: 'MD5', |
| 301 | app_uid: 2020, | 304 | app_uid: 2020, |
| 302 | timeStamp, | 305 | timeStamp, |
| 303 | keyname: keyName, | 306 | keyname: keyName, |
| 304 | billInfo: JSON.stringify(data), | 307 | billInfo: JSON.stringify(data), |
| 305 | } | 308 | } |
| 306 | // 请求后台支付接口 | 309 | // 请求后台支付接口 |
| 307 | store.dispatch('order/pay', fieldSet).then(({ data, data2, pay_id: payId }) => { | 310 | store.dispatch('order/pay', fieldSet).then(({ data, data2, pay_id: payId }) => { |
| 308 | if (data.return_code === 'SUCCESS' && data.result_code === 'SUCCESS') { | 311 | if (data.return_code === 'SUCCESS' && data.result_code === 'SUCCESS') { |
| 309 | const stringA = `appId=wx115b25aa396d27ac&nonceStr=${nonceStr}&package=prepay_id=${data.prepay_id}&signType=MD5&timeStamp=${timeStamp}` | 312 | const stringA = `appId=wx115b25aa396d27ac&nonceStr=${nonceStr}&package=prepay_id=${data.prepay_id}&signType=MD5&timeStamp=${timeStamp}` |
| 310 | const stringSignTemp = stringA + '&key=NewMoney2017hatemydaddy123456789' | 313 | const stringSignTemp = stringA + '&key=NewMoney2017hatemydaddy123456789' |
| 311 | 314 | ||
| 312 | // 微信支付接口 | 315 | // 微信支付接口 |
| 313 | uni.requestPayment({ | 316 | uni.requestPayment({ |
| 314 | appId: data.appid, | 317 | appId: data.appid, |
| 315 | timeStamp, | 318 | timeStamp, |
| 316 | nonceStr, | 319 | nonceStr, |
| 317 | total_fee: this.totalPrice, | 320 | total_fee: this.totalPrice, |
| 318 | package: `prepay_id=${data.prepay_id}`, | 321 | package: `prepay_id=${data.prepay_id}`, |
| 319 | signType: 'MD5', | 322 | signType: 'MD5', |
| 320 | paySign: MD5Util.MD5(stringSignTemp).toUpperCase(), | 323 | paySign: MD5Util.MD5(stringSignTemp).toUpperCase(), |
| 321 | success: (res) => { | 324 | success: (res) => { |
| 322 | // 支付成功 | 325 | // 支付成功 |
| 323 | uni.showModal({ | 326 | uni.showModal({ |
| 324 | content: '支付成功', | 327 | content: '支付成功', |
| 325 | showCancel: false, | 328 | showCancel: false, |
| 326 | }) | 329 | }) |
| 327 | // 跳转订单详情页->状态 待收货 | 330 | // 跳转订单详情页->状态 待收货 |
| 328 | uni.reLaunch({ | 331 | uni.reLaunch({ |
| 329 | url: `../myOrderPaying/myOrderPaying?payId=${payId}&status=1&isPay=1`, | 332 | url: `../myOrderPaying/myOrderPaying?payId=${payId}&status=1&isPay=1`, |
| 330 | }) | 333 | }) |
| 331 | }, | 334 | }, |
| 332 | fail: (res) => { | 335 | fail: (res) => { |
| 333 | // 支付失败 | 336 | // 支付失败 |
| 334 | uni.showModal({ | 337 | uni.showModal({ |
| 335 | content: '支付失败', | 338 | content: '支付失败', |
| 336 | showCancel: false, | 339 | showCancel: false, |
| 337 | }) | 340 | }) |
| 338 | // 跳转订单详情页->刷新本页面 | 341 | // 跳转订单详情页->刷新本页面 |
| 339 | // uni.redirectTo({ | 342 | // uni.redirectTo({ |
| 340 | // url: `../myOrderPaying/myOrderPaying?payId=${payId}&status=0&isPay=1`, | 343 | // url: `../myOrderPaying/myOrderPaying?payId=${payId}&status=0&isPay=1`, |
| 341 | // }) | 344 | // }) |
| 342 | }, | 345 | }, |
| 343 | complete: () => { | 346 | complete: () => { |
| 344 | uni.hideLoading() | 347 | uni.hideLoading() |
| 345 | }, | 348 | }, |
| 346 | }) | 349 | }) |
| 347 | } else { | 350 | } else { |
| 348 | uni.showModal({ | 351 | uni.showModal({ |
| 349 | content: '支付失败', | 352 | content: '支付失败', |
| 350 | showCancel: false, | 353 | showCancel: false, |
| 351 | }) | 354 | }) |
| 352 | console.log('支付失败') | 355 | console.log('支付失败') |
| 353 | uni.hideLoading() | 356 | uni.hideLoading() |
| 354 | // uni.redirectTo({ | 357 | // uni.redirectTo({ |
| 355 | // url: `../myOrderPaying/myOrderPaying?payId=${payId}&status=0&isPay=1`, | 358 | // url: `../myOrderPaying/myOrderPaying?payId=${payId}&status=0&isPay=1`, |
| 356 | // }) | 359 | // }) |
| 357 | } | 360 | } |
| 358 | }) | 361 | }) |
| 359 | 362 | ||
| 360 | // 修改订单状态 待付款==>待收货 | 363 | // 修改订单状态 待付款==>待收货 |
| 361 | store.dispatch('statusConfirm/confirm', { | 364 | store.dispatch('statusConfirm/confirm', { |
| 362 | uid: this.uid, | 365 | uid: this.uid, |
| 363 | openid: this.openid, | 366 | openid: this.openid, |
| 364 | oldway: '0', | 367 | oldway: '0', |
| 365 | way: '1', | 368 | way: '1', |
| 366 | pay_id: this.payId, | 369 | pay_id: this.payId, |
| 367 | judgeContent: '', | 370 | judgeContent: '', |
| 368 | orderInfo: this.orderInfo.order_info, | 371 | orderInfo: this.orderInfo.order_info, |
| 369 | }) | 372 | }) |
| 370 | .then( | 373 | .then( |
| 371 | // setTimeout(() => { | 374 | // setTimeout(() => { |
| 372 | // uni.navigateBack(); | 375 | // uni.navigateBack(); |
| 373 | // }, 1500) | 376 | // }, 1500) |
| 374 | ) | 377 | ) |
| 375 | }, | 378 | }, |
| 376 | confirmOrder() { | 379 | confirmOrder() { |
| 377 | // 确认收货 way1 ==>way2 | 380 | // 确认收货 way1 ==>way2 |
| 378 | store | 381 | store |
| 379 | .dispatch('statusConfirm/confirm', { | 382 | .dispatch('statusConfirm/confirm', { |
| 380 | uid: this.uid, | 383 | uid: this.uid, |
| 381 | openid: this.openid, | 384 | openid: this.openid, |
| 382 | oldway: '1', | 385 | oldway: '1', |
| 383 | way: '2', | 386 | way: '2', |
| 384 | pay_id: this.payId, | 387 | pay_id: this.payId, |
| 385 | judgeContent: '', | 388 | judgeContent: '', |
| 386 | orderInfo: this.orderInfo.order_info, | 389 | orderInfo: this.orderInfo.order_info, |
| 387 | }) | 390 | }) |
| 388 | .then((res) => { | 391 | .then((res) => { |
| 389 | if (res.data.code === 1) { | 392 | if (res.data.code === 1) { |
| 390 | uni.showToast({ | 393 | uni.showToast({ |
| 391 | title: '已确认', | 394 | title: '已确认', |
| 392 | mask: true, | 395 | mask: true, |
| 393 | duration: 1500, | 396 | duration: 1500, |
| 394 | icon: 'success', | 397 | icon: 'success', |
| 395 | }) | 398 | }) |
| 396 | } else { | 399 | } else { |
| 397 | uni.showToast({ | 400 | uni.showToast({ |
| 398 | title: '服务器错误,确认失败!', | 401 | title: '服务器错误,确认失败!', |
| 399 | mask: true, | 402 | mask: true, |
| 400 | }) | 403 | }) |
| 401 | } | 404 | } |
| 402 | setTimeout(() => { | 405 | setTimeout(() => { |
| 403 | uni.navigateBack() | 406 | uni.navigateBack() |
| 404 | }, 1500) | 407 | }, 1500) |
| 405 | }) | 408 | }) |
| 406 | }, | 409 | }, |
| 407 | }, | 410 | }, |
| 408 | // filters: { | 411 | // filters: { |
| 409 | // timerChange: function(value) { | 412 | // timerChange: function(value) { |
| 410 | // var newDate = new Date() | 413 | // var newDate = new Date() |
| 411 | // newDate.setTime(value * 1000) | 414 | // newDate.setTime(value * 1000) |
| 412 | // return newDate.toLocaleString() | 415 | // return newDate.toLocaleString() |
| 413 | // }, | 416 | // }, |
| 414 | // }, | 417 | // }, |
| 415 | } | 418 | } |
| 416 | </script> | 419 | </script> |
| 417 | 420 | ||
| 418 | <style lang="scss" scoped> | 421 | <style lang="scss" scoped> |
| 419 | .content { | 422 | .content { |
| 420 | min-height: 100vh; | 423 | min-height: 100vh; |
| 421 | display: flex; | 424 | display: flex; |
| 422 | flex-direction: column; | 425 | flex-direction: column; |
| 423 | justify-content: flex-start; | 426 | justify-content: flex-start; |
| 424 | align-items: center; | 427 | align-items: center; |
| 425 | background-color: #f2f2f2; | 428 | background-color: #f2f2f2; |
| 426 | } | 429 | } |
| 427 | 430 | ||
| 428 | .order { | 431 | .order { |
| 429 | margin-bottom: 112rpx; | 432 | margin-bottom: 112rpx; |
| 430 | background: #f2f2f2; | 433 | background: #f2f2f2; |
| 431 | margin-top: 140rpx; | 434 | margin-top: 140rpx; |
| 432 | width: 670rpx; | 435 | width: 670rpx; |
| 433 | } | 436 | } |
| 434 | 437 | ||
| 435 | .order-time { | 438 | .order-time { |
| 436 | width: 100%; | 439 | width: 100%; |
| 437 | height: 140rpx; | 440 | height: 140rpx; |
| 438 | background-color: #fff; | 441 | background-color: #fff; |
| 439 | display: flex; | 442 | display: flex; |
| 440 | justify-content: center; | 443 | justify-content: center; |
| 441 | align-items: center; | 444 | align-items: center; |
| 442 | position: fixed; | 445 | position: fixed; |
| 443 | top: 0; | 446 | top: 0; |
| 444 | left: 0; | 447 | left: 0; |
| 445 | text { | 448 | text { |
| 446 | // font-family: PingFangSC-Regular; | 449 | // font-family: PingFangSC-Regular; |
| 447 | // margin-top: 48rpx; | 450 | // margin-top: 48rpx; |
| 448 | font-size: 14px; | 451 | font-size: 14px; |
| 449 | color: #333333; | 452 | color: #333333; |
| 450 | letter-spacing: -0.26px; | 453 | letter-spacing: -0.26px; |
| 451 | } | 454 | } |
| 452 | .p2 { | 455 | .p2 { |
| 453 | // font-family: DINAlternate-Bold; | 456 | // font-family: DINAlternate-Bold; |
| 454 | margin: 42rpx 20rpx 0 20rpx; | 457 | margin: 42rpx 20rpx 0 20rpx; |
| 455 | font-size: 18px; | 458 | font-size: 18px; |
| 456 | color: #ec5d3b; | 459 | color: #ec5d3b; |
| 457 | letter-spacing: -0.34px; | 460 | letter-spacing: -0.34px; |
| 458 | } | 461 | } |
| 459 | } | 462 | } |
| 460 | .headerBanner { | 463 | .headerBanner { |
| 461 | width: 100%; | 464 | width: 100%; |
| 462 | height: 140rpx; | 465 | height: 140rpx; |
| 463 | background: #4a90e2; | 466 | background: #4a90e2; |
| 464 | padding: 26rpx 60rpx 24rpx 60rpx; | 467 | padding: 26rpx 60rpx 24rpx 60rpx; |
| 465 | box-sizing: border-box; | 468 | box-sizing: border-box; |
| 466 | color: #ffffff; | 469 | color: #ffffff; |
| 467 | display: flex; | 470 | display: flex; |
| 468 | justify-content: space-between; | 471 | justify-content: space-between; |
| 469 | align-items: center; | 472 | align-items: center; |
| 470 | position: fixed; | 473 | position: fixed; |
| 471 | top: 0; | 474 | top: 0; |
| 472 | left: 0; | 475 | left: 0; |
| 473 | .bannerLeft { | 476 | .bannerLeft { |
| 474 | font-size: 36rpx; | 477 | font-size: 36rpx; |
| 475 | display: flex; | 478 | display: flex; |
| 476 | flex-direction: column; | 479 | flex-direction: column; |
| 477 | justify-content: center; | 480 | justify-content: center; |
| 478 | align-items: center; | 481 | align-items: center; |
| 479 | .T2 { | 482 | .T2 { |
| 480 | font-size: 24rpx; | 483 | font-size: 24rpx; |
| 481 | } | 484 | } |
| 482 | } | 485 | } |
| 483 | image { | 486 | image { |
| 484 | height: 56rpx; | 487 | height: 56rpx; |
| 485 | width: 72rpx; | 488 | width: 72rpx; |
| 486 | } | 489 | } |
| 487 | } | 490 | } |
| 488 | 491 | ||
| 489 | .order-user { | 492 | .order-user { |
| 490 | height: 228rpx; | 493 | height: 228rpx; |
| 491 | background: #ffffff; | 494 | background: #ffffff; |
| 492 | border-radius: 14rpx; | 495 | border-radius: 14rpx; |
| 493 | margin: 0 auto; | 496 | margin: 0 auto; |
| 494 | margin-top: 20rpx; | 497 | margin-top: 20rpx; |
| 495 | margin-bottom: 20rpx; | 498 | margin-bottom: 20rpx; |
| 496 | .order-user-head { | 499 | .order-user-head { |
| 497 | display: flex; | 500 | display: flex; |
| 498 | height: 108rpx; | 501 | height: 108rpx; |
| 499 | align-items: center; | 502 | align-items: center; |
| 500 | margin-left: 126rpx; | 503 | margin-left: 126rpx; |
| 501 | .p1 { | 504 | .p1 { |
| 502 | // font-family: PingFangSC-Regular; | 505 | // font-family: PingFangSC-Regular; |
| 503 | font-size: 14px; | 506 | font-size: 14px; |
| 504 | color: #333333; | 507 | color: #333333; |
| 505 | letter-spacing: -0.26px; | 508 | letter-spacing: -0.26px; |
| 506 | margin-right: 20rpx; | 509 | margin-right: 20rpx; |
| 507 | } | 510 | } |
| 508 | .p2 { | 511 | .p2 { |
| 509 | // font-family: PingFangSC-Regular; | 512 | // font-family: PingFangSC-Regular; |
| 510 | font-size: 14px; | 513 | font-size: 14px; |
| 511 | color: #999999; | 514 | color: #999999; |
| 512 | letter-spacing: -0.26px; | 515 | letter-spacing: -0.26px; |
| 513 | } | 516 | } |
| 514 | } | 517 | } |
| 515 | .order-user-body { | 518 | .order-user-body { |
| 516 | display: flex; | 519 | display: flex; |
| 517 | width: 100%; | 520 | width: 100%; |
| 518 | image { | 521 | image { |
| 519 | width: 24px; | 522 | width: 24px; |
| 520 | height: 26px; | 523 | height: 26px; |
| 521 | margin: 12rpx 32rpx 0 40rpx; | 524 | margin: 12rpx 32rpx 0 40rpx; |
| 522 | } | 525 | } |
| 523 | .p3 { | 526 | .p3 { |
| 524 | // font-family: PingFangSC-Semibold; | 527 | // font-family: PingFangSC-Semibold; |
| 525 | font-size: 14px; | 528 | font-size: 14px; |
| 526 | color: #333333; | 529 | color: #333333; |
| 527 | letter-spacing: -0.26px; | 530 | letter-spacing: -0.26px; |
| 528 | line-height: 70rpx; | 531 | line-height: 70rpx; |
| 529 | } | 532 | } |
| 530 | } | 533 | } |
| 531 | } | 534 | } |
| 532 | 535 | ||
| 533 | .order-info { | 536 | .order-info { |
| 534 | background-color: #fff; | 537 | background-color: #fff; |
| 535 | box-shadow: 0 0 20rpx 0 rgba(177, 128, 128, 0.06); | 538 | box-shadow: 0 0 20rpx 0 rgba(177, 128, 128, 0.06); |
| 536 | border-radius: 16rpx; | 539 | border-radius: 16rpx; |
| 537 | margin: 0 auto; | 540 | margin: 0 auto; |
| 538 | view { | 541 | view { |
| 539 | margin-left: 40rpx; | 542 | margin-left: 40rpx; |
| 540 | } | 543 | } |
| 541 | text { | 544 | text { |
| 542 | font-size: 14px; | 545 | font-size: 14px; |
| 543 | } | 546 | } |
| 544 | .order-info-head { | 547 | .order-info-head { |
| 545 | display: flex; | 548 | display: flex; |
| 546 | padding-top: 40rpx; | 549 | padding-top: 40rpx; |
| 547 | image { | 550 | image { |
| 548 | height: 188rpx; | 551 | height: 188rpx; |
| 549 | width: 188rpx; | 552 | width: 188rpx; |
| 550 | } | 553 | } |
| 551 | .order-info-head-r { | 554 | .order-info-head-r { |
| 552 | margin: 0; | 555 | margin: 0; |
| 553 | width: 368rpx; | 556 | width: 368rpx; |
| 554 | margin-left: 24rpx; | 557 | margin-left: 24rpx; |
| 555 | // margin-top: 40rpx; | 558 | // margin-top: 40rpx; |
| 556 | text { | 559 | text { |
| 557 | display: block; | 560 | display: block; |
| 558 | } | 561 | } |
| 559 | // .arrow{ | 562 | // .arrow{ |
| 560 | // width: 0; | 563 | // width: 0; |
| 561 | // height: 0; | 564 | // height: 0; |
| 562 | // border-left: 5px transparent; | 565 | // border-left: 5px transparent; |
| 563 | // border-right: 5px transparent; | 566 | // border-right: 5px transparent; |
| 564 | // border-top: 5px #979797; | 567 | // border-top: 5px #979797; |
| 565 | // border-bottom: 0 transparent; | 568 | // border-bottom: 0 transparent; |
| 566 | // border-style: solid; | 569 | // border-style: solid; |
| 567 | // position: relative; | 570 | // position: relative; |
| 568 | // // transform: scaleY(-1); | 571 | // // transform: scaleY(-1); |
| 569 | // } | 572 | // } |
| 570 | // .arrow::after{ | 573 | // .arrow::after{ |
| 571 | // content: ''; | 574 | // content: ''; |
| 572 | // position: absolute; | 575 | // position: absolute; |
| 573 | // top: -6.5px; | 576 | // top: -6.5px; |
| 574 | // left: -5px; | 577 | // left: -5px; |
| 575 | // border-left: 5px transparent; | 578 | // border-left: 5px transparent; |
| 576 | // border-right: 5px transparent; | 579 | // border-right: 5px transparent; |
| 577 | // border-top: 5px #FFFFFF; | 580 | // border-top: 5px #FFFFFF; |
| 578 | // border-bottom: 0 transparent; | 581 | // border-bottom: 0 transparent; |
| 579 | // border-style: solid; | 582 | // border-style: solid; |
| 580 | // } | 583 | // } |
| 581 | .p1 { | 584 | .p1 { |
| 582 | min-height: 40px; | 585 | min-height: 40px; |
| 583 | // font-family: PingFangSC-Regular; | 586 | // font-family: PingFangSC-Regular; |
| 584 | font-size: 14px; | 587 | font-size: 14px; |
| 585 | color: #333333; | 588 | color: #333333; |
| 586 | letter-spacing: -0.26px; | 589 | letter-spacing: -0.26px; |
| 587 | line-height: 18px; | 590 | line-height: 18px; |
| 588 | // line-height: 20px; | 591 | // line-height: 20px; |
| 589 | } | 592 | } |
| 590 | .p2 { | 593 | .p2 { |
| 591 | height: 34px; | 594 | height: 34px; |
| 592 | padding: 1px 0 3px 0; | 595 | padding: 1px 0 3px 0; |
| 593 | // font-family: PingFangSC-Regular; | 596 | // font-family: PingFangSC-Regular; |
| 594 | font-size: 12px; | 597 | font-size: 12px; |
| 595 | color: #999999; | 598 | color: #999999; |
| 596 | letter-spacing: -0.23px; | 599 | letter-spacing: -0.23px; |
| 597 | } | 600 | } |
| 598 | .infoText-bottom { | 601 | .infoText-bottom { |
| 599 | display: flex; | 602 | display: flex; |
| 600 | flex-direction: row; | 603 | flex-direction: row; |
| 601 | justify-content: flex-start; | 604 | justify-content: flex-start; |
| 602 | align-items: center; | 605 | align-items: center; |
| 603 | width: 100%; | 606 | width: 100%; |
| 604 | margin-left: 0; | 607 | margin-left: 0; |
| 605 | .markPrice { | 608 | .markPrice { |
| 606 | font-size: 14px; | 609 | font-size: 14px; |
| 607 | color: #ff6b4a; | 610 | color: #ff6b4a; |
| 608 | margin-right: 20rpx; | 611 | margin-right: 20rpx; |
| 609 | margin-left: 0rpx; | 612 | margin-left: 0rpx; |
| 610 | } | 613 | } |
| 611 | .buy-num { | 614 | .buy-num { |
| 612 | font-size: 12px; | 615 | font-size: 12px; |
| 613 | color: #999999; | 616 | color: #999999; |
| 614 | margin-left: 0; | 617 | margin-left: 0; |
| 615 | } | 618 | } |
| 616 | } | 619 | } |
| 617 | } | 620 | } |
| 618 | } | 621 | } |
| 619 | // .order-info-goodsnum { | 622 | // .order-info-goodsnum { |
| 620 | // display: flex; | 623 | // display: flex; |
| 621 | // align-items: center; | 624 | // align-items: center; |
| 622 | // justify-content: flex-end; | 625 | // justify-content: flex-end; |
| 623 | // text { | 626 | // text { |
| 624 | // margin-right: 44rpx; | 627 | // margin-right: 44rpx; |
| 625 | // // ont-family: PingFangSC-Regular; | 628 | // // ont-family: PingFangSC-Regular; |
| 626 | // font-size: 12px; | 629 | // font-size: 12px; |
| 627 | // color: #999999; | 630 | // color: #999999; |
| 628 | // letter-spacing: -0.23px; | 631 | // letter-spacing: -0.23px; |
| 629 | // } | 632 | // } |
| 630 | // } | 633 | // } |
| 631 | .order-info-freight { | 634 | .order-info-freight { |
| 632 | display: block; | 635 | display: block; |
| 633 | margin-left: 40rpx; | 636 | margin-left: 40rpx; |
| 634 | margin-top: 22rpx; | 637 | margin-top: 22rpx; |
| 635 | .p1 { | 638 | .p1 { |
| 636 | // font-family: PingFangSC-Regular; | 639 | // font-family: PingFangSC-Regular; |
| 637 | font-size: 14px; | 640 | font-size: 14px; |
| 638 | color: #333333; | 641 | color: #333333; |
| 639 | letter-spacing: -0.26px; | 642 | letter-spacing: -0.26px; |
| 640 | line-height: 18px; | 643 | line-height: 18px; |
| 641 | margin-right: 24px; | 644 | margin-right: 24px; |
| 642 | } | 645 | } |
| 643 | .p2 { | 646 | .p2 { |
| 644 | // font-family: PingFangSC-Regular; | 647 | // font-family: PingFangSC-Regular; |
| 645 | font-size: 14px; | 648 | font-size: 14px; |
| 646 | color: #ff6b4a; | 649 | color: #ff6b4a; |
| 647 | letter-spacing: -0.26px; | 650 | letter-spacing: -0.26px; |
| 648 | } | 651 | } |
| 649 | } | 652 | } |
| 650 | .order-info-discount { | 653 | .order-info-discount { |
| 651 | display: block; | 654 | display: block; |
| 652 | margin-left: 40rpx; | 655 | margin-left: 40rpx; |
| 653 | margin-top: 24rpx; | 656 | margin-top: 24rpx; |
| 654 | .p1 { | 657 | .p1 { |
| 655 | // font-family: PingFangSC-Regular; | 658 | // font-family: PingFangSC-Regular; |
| 656 | font-size: 14px; | 659 | font-size: 14px; |
| 657 | color: #333333; | 660 | color: #333333; |
| 658 | letter-spacing: -0.26px; | 661 | letter-spacing: -0.26px; |
| 659 | line-height: 18px; | 662 | line-height: 18px; |
| 660 | margin-right: 24px; | 663 | margin-right: 24px; |
| 661 | } | 664 | } |
| 662 | .p2 { | 665 | .p2 { |
| 663 | // font-family: PingFangSC-Regular; | 666 | // font-family: PingFangSC-Regular; |
| 664 | font-size: 14px; | 667 | font-size: 14px; |
| 665 | color: #ff6b4a; | 668 | color: #ff6b4a; |
| 666 | letter-spacing: -0.26px; | 669 | letter-spacing: -0.26px; |
| 667 | } | 670 | } |
| 668 | } | 671 | } |
| 669 | .order-info-price { | 672 | .order-info-price { |
| 670 | display: block; | 673 | display: block; |
| 671 | margin-left: 40rpx; | 674 | margin-left: 40rpx; |
| 672 | margin-top: 24rpx; | 675 | margin-top: 24rpx; |
| 673 | .p1 { | 676 | .p1 { |
| 674 | // font-family: PingFangSC-Semibold; | 677 | // font-family: PingFangSC-Semibold; |
| 675 | font-size: 14px; | 678 | font-size: 14px; |
| 676 | color: #333333; | 679 | color: #333333; |
| 677 | letter-spacing: -0.26px; | 680 | letter-spacing: -0.26px; |
| 678 | line-height: 18px; | 681 | line-height: 18px; |
| 679 | margin-right: 24px; | 682 | margin-right: 24px; |
| 680 | } | 683 | } |
| 681 | .p2 { | 684 | .p2 { |
| 682 | // font-family: PingFangSC-Semibold; | 685 | // font-family: PingFangSC-Semibold; |
| 683 | font-size: 14px; | 686 | font-size: 14px; |
| 684 | color: #ff6b4a; | 687 | color: #ff6b4a; |
| 685 | letter-spacing: -0.26px; | 688 | letter-spacing: -0.26px; |
| 686 | } | 689 | } |
| 687 | } | 690 | } |
| 688 | .order-info-num { | 691 | .order-info-num { |
| 689 | display: block; | 692 | display: block; |
| 690 | margin-left: 40rpx; | 693 | margin-left: 40rpx; |
| 691 | margin-top: 44rpx; | 694 | margin-top: 44rpx; |
| 692 | text { | 695 | text { |
| 693 | // font-family: PingFangSC-Regular; | 696 | // font-family: PingFangSC-Regular; |
| 694 | font-size: 12px; | 697 | font-size: 12px; |
| 695 | color: #999999; | 698 | color: #999999; |
| 696 | letter-spacing: -0.23px; | 699 | letter-spacing: -0.23px; |
| 697 | } | 700 | } |
| 698 | } | 701 | } |
| 699 | .order-info-time { | 702 | .order-info-time { |
| 700 | display: block; | 703 | display: block; |
| 701 | margin: 8rpx 0 48rpx 40rpx; | 704 | margin: 8rpx 0 48rpx 40rpx; |
| 702 | text { | 705 | text { |
| 703 | // font-family: PingFangSC-Regular; | 706 | // font-family: PingFangSC-Regular; |
| 704 | font-size: 12px; | 707 | font-size: 12px; |
| 705 | color: #999999; | 708 | color: #999999; |
| 706 | letter-spacing: -0.23px; | 709 | letter-spacing: -0.23px; |
| 707 | } | 710 | } |
| 708 | } | 711 | } |
| 709 | .order-info-hr { | 712 | .order-info-hr { |
| 710 | width: 520rpx; | 713 | width: 520rpx; |
| 711 | height: 1px; | 714 | height: 1px; |
| 712 | background-color: #e9e9e9; | 715 | background-color: #e9e9e9; |
| 713 | margin-bottom: 20rpx; | 716 | margin-bottom: 20rpx; |
| 714 | } | 717 | } |
| 715 | .order-info-contact { | 718 | .order-info-contact { |
| 716 | display: flex; | 719 | display: flex; |
| 717 | padding-bottom: 28rpx; | 720 | padding-bottom: 28rpx; |
| 718 | image { | 721 | image { |
| 719 | width: 19px; | 722 | width: 19px; |
| 720 | height: 16px; | 723 | height: 16px; |
| 721 | } | 724 | } |
| 722 | button { | 725 | button { |
| 723 | // font-family: PingFangSC-Regular; | 726 | // font-family: PingFangSC-Regular; |
| 724 | border: none; | 727 | border: none; |
| 725 | border-radius: 0; | 728 | border-radius: 0; |
| 726 | text-align: left; | 729 | text-align: left; |
| 727 | margin-left: 20rpx; | 730 | margin-left: 20rpx; |
| 728 | font-size: 14px; | 731 | font-size: 14px; |
| 729 | color: #333333; | 732 | color: #333333; |
| 730 | letter-spacing: -0.26px; | 733 | letter-spacing: -0.26px; |
| 731 | line-height: 18px; | 734 | line-height: 18px; |
| 732 | background-color: #fff; | 735 | background-color: #fff; |
| 733 | padding: 0; | 736 | padding: 0; |
| 734 | &::after { | 737 | &::after { |
| 735 | border: 0; | 738 | border: 0; |
| 736 | } | 739 | } |
| 737 | } | 740 | } |
| 738 | } | 741 | } |
| 739 | } | 742 | } |
| 740 | 743 | ||
| 741 | .order-confim { | 744 | .order-confim { |
| 742 | display: flex; | 745 | display: flex; |
| 743 | align-items: center; | 746 | align-items: center; |
| 744 | justify-content: flex-end; | 747 | justify-content: flex-end; |
| 745 | // z-index: 999; | 748 | // z-index: 999; |
| 746 | width: 100%; | 749 | width: 100%; |
| 747 | height: 112rpx; | 750 | height: 112rpx; |
| 748 | position: fixed; | 751 | position: fixed; |
| 749 | bottom: 0; | 752 | bottom: 0; |
| 750 | background: #ffffff; | 753 | background: #ffffff; |
| 751 | button { | 754 | button { |
| 752 | width: 204rpx; | 755 | width: 204rpx; |
| 753 | height: 80rpx; | 756 | height: 80rpx; |
| 754 | border: 1px solid #ff6b4a; | 757 | border: 1px solid #ff6b4a; |
| 755 | border-radius: 40rpx; | 758 | border-radius: 40rpx; |
| 756 | font-size: 32rpx; | 759 | font-size: 32rpx; |
| 757 | letter-spacing: -0.3px; | 760 | letter-spacing: -0.3px; |
| 758 | margin-right: 0; | 761 | margin-right: 0; |
| 759 | } | 762 | } |
| 760 | .b1 { | 763 | .b1 { |
| 761 | // font-family: PingFangSC-Regular; | 764 | // font-family: PingFangSC-Regular; |
| 762 | color: #ff6b4a; | 765 | color: #ff6b4a; |
| 763 | background-color: #ffffff; | 766 | background-color: #ffffff; |
| 764 | } | 767 | } |
| 765 | .b2 { | 768 | .b2 { |
| 766 | // font-family: PingFangSC-Regular; | 769 | // font-family: PingFangSC-Regular; |
| 767 | background-color: #ff6b4a; | 770 | background-color: #ff6b4a; |
| 768 | color: #ffffff; | 771 | color: #ffffff; |
| 769 | margin: 0 26rpx 0 20rpx; | 772 | margin: 0 26rpx 0 20rpx; |
| 770 | } | 773 | } |
| 771 | } | 774 | } |
| 772 | </style> | 775 | </style> |
| 773 | 776 |