Browse Source

上传

master
前端-胡立永 8 months ago
parent
commit
8f7d341dac
9 changed files with 171 additions and 25 deletions
  1. +0
    -1
      api/api.js
  2. +6
    -0
      components/tourGuide/locations.vue
  3. +2
    -2
      config.js
  4. +0
    -2
      pages_order/components/list/cardList.vue
  5. +19
    -7
      pages_order/components/product/cartAction.vue
  6. +123
    -7
      pages_order/mine/cart.vue
  7. +11
    -1
      pages_order/mine/subscribe.vue
  8. +4
    -3
      pages_order/order/order.vue
  9. +6
    -2
      pages_order/product/productList.vue

+ 0
- 1
api/api.js View File

@ -272,7 +272,6 @@ const config = {
updateShopcar: {
url: '/user/updateShopcar',
method: 'POST',
showLoading: true,
debounce : 500,
auth: true,
},


+ 6
- 0
components/tourGuide/locations.vue View File

@ -69,6 +69,7 @@
v-if="show && spotGuide.length > 0">
<view class="main"
v-for="(item, index) in spotGuide"
@click="toUrl(item)"
:key="index">
<image
class="main-image"
@ -199,6 +200,11 @@
callouttap(e) {
console.log('地图点击事件', e)
},
toUrl(item){
if(item.categoryId == 0){
// this.$utils.navigateTo(`/pages_order/service/articleDetail?id=${item.id}&type=Inheritance`)
}
},
}
}
</script>


+ 2
- 2
config.js View File

@ -44,7 +44,7 @@ const defaultConfig = {
api : 'queryArticleById',
},
Inheritance : {//遗产概况
title : '遗产概况',
title : '文化遗产',
api : 'queryArticleById',
},
tell : {//遗产讲述
@ -54,13 +54,13 @@ const defaultConfig = {
payType : 1,
screen : true,
roleId : 0,
showRoleLevel : true,
},
travel : {//达人同游
title : '达人同游',
collectType : 1,
subTitle : '同游现场',
payType : 2,
showRoleLevel : true,
roleId : 1,
},
path : {//遗产路径


+ 0
- 2
pages_order/components/list/cardList.vue View File

@ -83,8 +83,6 @@
roleId : this.dict.roleId,
}
console.log(this.result);
this.result.forEach(n => {
queryParams[n.name] = n.value
})


+ 19
- 7
pages_order/components/product/cartAction.vue View File

@ -3,22 +3,23 @@
<view class="icon">
<image src="/static/image/cart/1.png" mode=""></image>
<view class="num">
{{ cartCheckboxValue.length }}
{{ num || cartCheckboxValue.length }}
</view>
</view>
<view class="price">
<view class="count">
合计
<view class="">
<text>{{ totalPrice }}</text>
<text>{{ price || totalPrice }}</text>
</view>
</view>
<view class="text">
{{ cartCheckboxValue.length }}已享受更低优惠
{{ num || cartCheckboxValue.length }}已享受更低优惠
</view>
</view>
<view class="btn">
去结算
<view class="btn"
@click="$emit('submit')">
{{ submitTitle }}
</view>
</view>
</template>
@ -26,6 +27,17 @@
<script>
import { mapState } from 'vuex'
export default {
props : {
submitTitle : {
default : '结算'
},
price : {
default : 0
},
num : {
default : 0
}
},
data() {
return {
}
@ -37,9 +49,9 @@
}
let price = 0
this.cartList.forEach(n => {
if (this.cartCheckboxValue.includes(n.shopcar.id)) {
// if (this.cartCheckboxValue.includes(n.shopcar.id)) {
price += n.wares.waresPrice * (n.shopcar.shopcarNumber || 1)
}
// }
})
return price
},


+ 123
- 7
pages_order/mine/cart.vue View File

@ -3,9 +3,10 @@
<navbar title="购物车" leftClick @leftClick="$utils.navigateBack" />
<view class="user">
<uv-checkbox-group
<!-- <uv-checkbox-group
shape="circle"
v-model="cartCheckboxValue">
v-model="cartCheckboxValue"> -->
<uv-radio-group v-model="radiovalue">
<uv-swipe-action>
<view
@ -17,12 +18,19 @@
@click="delCart(item, index)">
<view class="item">
<view class="checkbox">
<uv-checkbox
<!-- <uv-checkbox
:name="item.shopcar.id"
activeColor="#FA5A0A"
size="40rpx"
icon-size="35rpx"
></uv-checkbox>
></uv-checkbox> -->
<uv-radio
:name="item.shopcar.id"
activeColor="#FA5A0A"
size="40rpx"
icon-size="35rpx">
</uv-radio>
</view>
<image
@ -52,10 +60,19 @@
</uv-swipe-action-item>
</view>
</uv-swipe-action>
</uv-checkbox-group>
<!-- </uv-checkbox-group> -->
</uv-radio-group>
<cartAction/>
<cartAction
:price="totalPrice"
:num="num"
@submit="$refs.addressPopup.open('bottom')"/>
</view>
<!-- 地址弹框 -->
<uv-popup ref="addressPopup" :round="30">
<addressList ref="addressList" height="60vh" @select="selectAddress" />
</uv-popup>
<tabber select="3" />
</view>
@ -64,12 +81,15 @@
<script>
import cartAction from '../components/product/cartAction.vue'
import { mapState } from 'vuex'
import addressList from '../components/address/addressList.vue'
export default {
components: {
cartAction
cartAction,
addressList,
},
data() {
return {
radiovalue : 0,
options: [
{
text: '删除',
@ -78,15 +98,60 @@
}
},
],
addressTotal: 0,
address: {
name: '请选择联系人',
addressDetail: ''
},
}
},
computed: {
...mapState(['cartList', 'cartCheckboxValue']),
totalPrice() {
if (!this.radiovalue) {
return '0'
}
let price = 0
this.cartList.forEach(n => {
if (this.radiovalue == n.shopcar.id) {
price += n.wares.waresPrice * (n.shopcar.shopcarNumber || 1)
}
})
return price
},
num(){
if (!this.radiovalue) {
return '0'
}
let num = 0
this.cartList.forEach(n => {
if (this.radiovalue == n.shopcar.id) {
num += (n.shopcar.shopcarNumber || 1)
}
})
return num
},
},
onShow() {
this.$store.commit('getCartList')
this.getAddressListA()
},
methods: {
//
selectAddress(e) {
this.address = e
this.$refs.addressPopup.close()
this.submit()
},
//
getAddressListA() {
this.$refs.addressList.getAddressList().then(res => {
this.addressTotal = res.total
if (this.addressTotal != 0) {
this.address = res.records[0]
}
})
},
valChange(item, e){
this.$api('updateShopcar', {
id : item.shopcar.id,
@ -106,6 +171,57 @@
}
})
},
submit(){
let data = {}
this.cartList.forEach(n => {
if (this.radiovalue == n.shopcar.id) {
data.waresId = n.shopcar.waresId
data.number = n.shopcar.shopcarNumber
data.addressId = this.address.id
}
})
if(this.$utils.verificationAll(data, {
addressId : '请选择地址',
waresId : '请选择商品',
number : '请选择数量',
})){
return
}
this.$api('addWaresOrder', data, res => {
if(res.code == 200){
uni.redirectTo({
url: '/pages_order/order/order'
})
// uni.requestPayment({
// provider: 'wxpay', //
// timeStamp: res.result.timeStamp, //
// nonceStr: res.result.nonceStr, //
// package: res.result.packageValue,
// signType: res.result.signType, //
// paySign: res.result.paySign, //
// success: function (res) {
// console.log('',res);
// uni.redirectTo({
// url: '/pages/index/order'
// })
// },
// fail: function (err) {
// console.log('',err);
// uni.showToast({
// icon:'none',
// title:""
// })
// }
// });
}
})
},
}
}
</script>


+ 11
- 1
pages_order/mine/subscribe.vue View File

@ -67,6 +67,10 @@
</uv-cell>
<view class="btns">
<view class="btn-info">
{{ statusTitle[item.orderStatus] }}
</view>
<view class="btn"
@click="toUrl(item)">
再次预约
@ -84,6 +88,7 @@
mixins : [mixinsList],
data() {
return {
statusTitle : ['待支付', '待使用', '已完成'],
tabs: [
{
name: '路径定制'
@ -160,7 +165,12 @@
}
.btns{
display: flex;
justify-content: flex-end;
justify-content: space-between;
.btn-info{
padding: 10px 30rpx;
font-size: 24rpx;
color: $uni-color;
}
.btn{
padding: 10px 30rpx;
font-size: 24rpx;


+ 4
- 3
pages_order/order/order.vue View File

@ -36,7 +36,7 @@
<!-- <text>{{item.type_dictText}}</text> -->
</view>
<view class="status">
<text> {{item.state_dictText}}</text>
<text> {{ statusTitle[item.travelWaresOrder.status] }}</text>
</view>
</view>
@ -98,6 +98,7 @@
},
data() {
return {
statusTitle : ['待支付', '待发货', '待收货', '已完成'],
tabs: [
{
name: '全部'
@ -131,7 +132,7 @@
},
methods: {
//tab
clickTabs(index) {
clickTabs({index}) {
if (index == 0) {
this.state = -1;
} else {
@ -150,7 +151,7 @@
...this.queryParams,
}
if(this.state != -1){
queryParams.state = this.state
queryParams.status = this.state
}
this.$api('queryWaresOrderList', queryParams, res => {
if(res.code == 200){


+ 6
- 2
pages_order/product/productList.vue View File

@ -13,7 +13,9 @@
<productList :list="list" />
</view>
<cartAction />
<cartAction
submitTitle="去结算"
@submit="$utils.navigateTo('/pages_order/mine/cart')"/>
<tabber />
</view>
</template>
@ -48,7 +50,9 @@
},
onShow() {
this.getData()
this.$store.commit('getCartList')
if(uni.getStorageSync('token')){
this.$store.commit('getCartList')
}
},
onLoad() {
this.queryParams.state = 0


Loading…
Cancel
Save