Merge branch 'master' of http://122.51.230.86:3000/dianliang/dl_uniapp
This commit is contained in:
commit
9ddbff0b71
@ -34,3 +34,12 @@ export function rightList(params) {
|
|||||||
params:params
|
params:params
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//------------------通告券相关-----------------------
|
||||||
|
//查询基础通告券
|
||||||
|
export function initCouponList() {
|
||||||
|
return request({
|
||||||
|
url: '/base/coupon/uniCouponList',
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
@ -34,14 +34,6 @@ export function toApply(data) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//------------------开通会员-----------------------
|
|
||||||
export function saveOrder(data) {
|
|
||||||
return request({
|
|
||||||
url: '/member/order/uniSaveOrder',
|
|
||||||
method: 'post',
|
|
||||||
data: data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
//------------------名片-----------------------
|
//------------------名片-----------------------
|
||||||
// 查询当前登录用户的名片
|
// 查询当前登录用户的名片
|
||||||
export function getUserBusiCard() {
|
export function getUserBusiCard() {
|
||||||
@ -130,3 +122,19 @@ export function selectMemberRights() {
|
|||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
//------------------订单相关-----------------------
|
||||||
|
export function getOrderList(params) {
|
||||||
|
return request({
|
||||||
|
url: '/member/order/list',
|
||||||
|
method: 'get',
|
||||||
|
params: params
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function saveOrder(data) {
|
||||||
|
return request({
|
||||||
|
url: '/member/order/uniSaveOrder',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
@ -67,19 +67,10 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import navigationBarVue from '@/components/navigation/navigationBar.vue';
|
import navigationBarVue from '@/components/navigation/navigationBar.vue';
|
||||||
import {
|
import {formatNumberWithUnits} from '@/utils/common.js'
|
||||||
formatNumberWithUnits
|
import {getUserBusiCard, removeBusiCard} from '@/api/business/member.js'
|
||||||
} from '@/utils/common.js'
|
import {getSignCard} from '@/api/business/signCard.js'
|
||||||
import {
|
import {hasRights} from '@/utils/common.js'
|
||||||
getUserBusiCard,
|
|
||||||
removeBusiCard
|
|
||||||
} from '@/api/business/member.js'
|
|
||||||
import {
|
|
||||||
getSignCard
|
|
||||||
} from '@/api/business/signCard.js'
|
|
||||||
import {
|
|
||||||
hasRights
|
|
||||||
} from '@/utils/common.js'
|
|
||||||
import rightsCode from '@/utils/rightsCode.js'
|
import rightsCode from '@/utils/rightsCode.js'
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
</view>
|
</view>
|
||||||
<view class="bottom-content">
|
<view class="bottom-content">
|
||||||
<view class="top-text">剩余<text>0</text>张</view>
|
<view class="top-text">剩余<text>{{ coupon }}</text>张</view>
|
||||||
<view class="button-dom" @click="goMyCoupon(0)">去获取</view>
|
<view class="button-dom" @click="goMyCoupon(0)">去获取</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
@ -45,8 +45,12 @@
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
globalConfig: getApp().globalData.config,
|
globalConfig: getApp().globalData.config,
|
||||||
|
coupon:0
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
onLoad(options){
|
||||||
|
this.coupon = options.coupon
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
viewRichText() {
|
viewRichText() {
|
||||||
this.$tab.navigateTo(
|
this.$tab.navigateTo(
|
||||||
@ -55,7 +59,7 @@
|
|||||||
},
|
},
|
||||||
goMyCoupon(index) {
|
goMyCoupon(index) {
|
||||||
this.$tab.navigateTo(
|
this.$tab.navigateTo(
|
||||||
`/pages/mine/coupon/my-coupon?index=${index}`
|
`/pages/mine/coupon/my-coupon?index=${index}&coupon=`+this.coupon
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -12,19 +12,19 @@
|
|||||||
</view>
|
</view>
|
||||||
<view style="width: 100%;" v-if="0==menuIndex">
|
<view style="width: 100%;" v-if="0==menuIndex">
|
||||||
<view class="coupon-list-box">
|
<view class="coupon-list-box">
|
||||||
<view class="top-text">剩余<text>0</text>张</view>
|
<view class="top-text">剩余<text>{{ coupon }}</text>张</view>
|
||||||
<view :class="['coupon-item-box',index==couponIndex?'click':'']" v-for="(item,index) in dataList"
|
<view :class="['coupon-item-box',index==couponIndex?'click':'']" v-for="(item,index) in dataList"
|
||||||
@click="chooseCoupon(index)">
|
@click="chooseCoupon(index)">
|
||||||
<view class="left-dom">
|
<view class="left-dom">
|
||||||
<image src="@/static/mine/coupon/coupon.png" mode="aspectFit"></image>
|
<image src="@/static/mine/coupon/coupon.png" mode="aspectFit"></image>
|
||||||
<uni-icons type="closeempty" color="#FC1F3E" size="14"></uni-icons>
|
<uni-icons type="closeempty" color="#FC1F3E" size="14"></uni-icons>
|
||||||
<view style="margin-left: 15rpx;">{{item.num}}张</view>
|
<view style="margin-left: 15rpx;">{{item.couponNum}}张</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="right-dom">
|
<view class="right-dom">
|
||||||
<text>¥</text>{{item.price}}
|
<text>¥</text>{{item.price}}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="button-dom" @click="buyFun()">购买</view>
|
<view class="button-dom" @click="toOrder()">购买</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="item-field" style="align-items: center;">
|
<view class="item-field" style="align-items: center;">
|
||||||
<view class="my-suggest-dom" @click="viewRichText()">
|
<view class="my-suggest-dom" @click="viewRichText()">
|
||||||
@ -39,16 +39,16 @@
|
|||||||
<view class="item-box" v-for="(item,index) in byList">
|
<view class="item-box" v-for="(item,index) in byList">
|
||||||
<view class="top-title-box">
|
<view class="top-title-box">
|
||||||
<view class="order-no">订单编号:{{item.orderNo}}</view>
|
<view class="order-no">订单编号:{{item.orderNo}}</view>
|
||||||
<view :class="['order-status',item.ifPay?'payed':'no-pay']">{{item.ifPay?'已支付':'未支付'}}
|
<view :class="['order-status',item.isPay==1?'payed':'no-pay']">{{item.isPay==1?'已支付':'未支付'}}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="detail-item">
|
<view class="detail-item">
|
||||||
<view class="left-dom">通告券</view>
|
<view class="left-dom">通告券</view>
|
||||||
<view class="right-dom">*{{item.num}} 张</view>
|
<view class="right-dom">*{{item.goodsNum}} 张</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="detail-item" style="border-bottom:1rpx solid #F4F4F4;padding-bottom: 25rpx;">
|
<view class="detail-item" style="border-bottom:1rpx solid #F4F4F4;padding-bottom: 25rpx;">
|
||||||
<view class="left-dom">金额</view>
|
<view class="left-dom">金额</view>
|
||||||
<view class="right-dom">{{item.price}} 元</view>
|
<view class="right-dom">{{item.goodsPrice}} 元</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="bottom-item">
|
<view class="bottom-item">
|
||||||
下单时间:{{item.createTime}}
|
下单时间:{{item.createTime}}
|
||||||
@ -66,10 +66,11 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import navigationBarVue from '@/components/navigation/navigationBar.vue';
|
import navigationBarVue from '@/components/navigation/navigationBar.vue';
|
||||||
import {
|
import {initCouponList} from '@/api/business/base.js'
|
||||||
toast,
|
import {saveOrder,getOrderList} from '@/api/business/member.js'
|
||||||
hasRights
|
import {toast} from '@/utils/common.js'
|
||||||
} from '@/utils/common.js'
|
import constant from '@/utils/constant';
|
||||||
|
import {getJSONData} from '@/utils/auth.js'
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
navigationBarVue
|
navigationBarVue
|
||||||
@ -79,48 +80,28 @@
|
|||||||
globalConfig: getApp().globalData.config,
|
globalConfig: getApp().globalData.config,
|
||||||
menus: ['通告券', '购买记录'],
|
menus: ['通告券', '购买记录'],
|
||||||
menuIndex: 0,
|
menuIndex: 0,
|
||||||
|
coupon:0,
|
||||||
//选中的通告券下标
|
//选中的通告券下标
|
||||||
couponIndex: 0,
|
couponIndex: 0,
|
||||||
queryParams: {
|
queryParams: {
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 10
|
pageSize: 10,
|
||||||
|
orderType:'02',
|
||||||
|
userId:null,
|
||||||
},
|
},
|
||||||
total: 0,
|
total: 0,
|
||||||
//下来刷新状态
|
//下来刷新状态
|
||||||
isTriggered: false,
|
isTriggered: false,
|
||||||
dataList: [{
|
dataList: [],
|
||||||
id: "3",
|
|
||||||
num: 5,
|
|
||||||
price: 20
|
|
||||||
}, {
|
|
||||||
id: "2",
|
|
||||||
num: 10,
|
|
||||||
price: 40
|
|
||||||
}, {
|
|
||||||
id: "1",
|
|
||||||
num: 20,
|
|
||||||
price: 80
|
|
||||||
}],
|
|
||||||
//购买记录
|
//购买记录
|
||||||
byList: [{
|
byList: []
|
||||||
id: "1",
|
|
||||||
orderNo: "111",
|
|
||||||
num: 20,
|
|
||||||
price: 80,
|
|
||||||
ifPay: true,
|
|
||||||
createTime: "2024-02-03 12:23:00"
|
|
||||||
}, {
|
|
||||||
id: "2",
|
|
||||||
orderNo: "111",
|
|
||||||
num: 10,
|
|
||||||
price: 40,
|
|
||||||
ifPay: false,
|
|
||||||
createTime: "2024-02-03 12:23:00"
|
|
||||||
}]
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad(option) {
|
onLoad(option) {
|
||||||
this.menuIndex = option.index
|
this.menuIndex = option.index
|
||||||
|
this.coupon = option.coupon
|
||||||
|
this.initCoupon();
|
||||||
|
this.initOrder()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
/**
|
/**
|
||||||
@ -132,6 +113,59 @@
|
|||||||
this.menuIndex = index
|
this.menuIndex = index
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**查询卡券*/
|
||||||
|
initCoupon(){
|
||||||
|
this.dataList = []
|
||||||
|
initCouponList().then(res=>{
|
||||||
|
this.dataList = res.data
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
/**初始化订单数据*/
|
||||||
|
initOrder(){
|
||||||
|
this.queryParams.userId = getJSONData(constant.userInfo).userId
|
||||||
|
getOrderList(this.queryParams).then(res=>{
|
||||||
|
this.isTriggered = false
|
||||||
|
if (res.code == 200) {
|
||||||
|
if (this.queryParams.pageNum == 1) {
|
||||||
|
this.byList = res.data.records
|
||||||
|
} else {
|
||||||
|
this.byList = this.byList.concat(res.data.records)
|
||||||
|
}
|
||||||
|
this.total = res.data.data.total
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
/**生成订单*/
|
||||||
|
toOrder(){
|
||||||
|
let data = {
|
||||||
|
userType:'01',
|
||||||
|
orderType:'02',
|
||||||
|
goodsId:this.dataList[this.couponIndex].id,
|
||||||
|
goodsNum:this.dataList[this.couponIndex].couponNum,
|
||||||
|
goodsPrice:this.dataList[this.couponIndex].price,
|
||||||
|
goodsCycle:'04'
|
||||||
|
}
|
||||||
|
saveOrder(data).then(res => {
|
||||||
|
if (res.code == 200) {
|
||||||
|
uni.showToast({
|
||||||
|
icon: 'success',
|
||||||
|
duration: 2000,
|
||||||
|
title: '保存成功'
|
||||||
|
});
|
||||||
|
uni.navigateBack()
|
||||||
|
}
|
||||||
|
}).catch((e) => {
|
||||||
|
uni.showToast({
|
||||||
|
icon: 'error',
|
||||||
|
duration: 2000,
|
||||||
|
title: e
|
||||||
|
});
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 选中的优惠券
|
* 选中的优惠券
|
||||||
* @param {Object} index
|
* @param {Object} index
|
||||||
@ -139,14 +173,15 @@
|
|||||||
chooseCoupon(index) {
|
chooseCoupon(index) {
|
||||||
this.couponIndex = index
|
this.couponIndex = index
|
||||||
},
|
},
|
||||||
buyFun() {
|
|
||||||
|
|
||||||
},
|
|
||||||
viewRichText() {
|
viewRichText() {
|
||||||
this.$tab.navigateTo(
|
this.$tab.navigateTo(
|
||||||
`/pages/common/richview/index?title=${this.globalConfig.appInfo.agreements[6].title}&code=${this.globalConfig.appInfo.agreements[6].code}`
|
`/pages/common/richview/index?title=${this.globalConfig.appInfo.agreements[6].title}&code=${this.globalConfig.appInfo.agreements[6].code}`
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 上滑加载数据
|
* 上滑加载数据
|
||||||
*/
|
*/
|
||||||
@ -158,6 +193,7 @@
|
|||||||
}
|
}
|
||||||
//页码+1,调用获取数据的方法获取第二页数据
|
//页码+1,调用获取数据的方法获取第二页数据
|
||||||
this.queryParams.pageNum++
|
this.queryParams.pageNum++
|
||||||
|
this.initOrder()
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* 下拉刷新数据
|
* 下拉刷新数据
|
||||||
@ -166,6 +202,7 @@
|
|||||||
this.isTriggered = true
|
this.isTriggered = true
|
||||||
this.queryParams.pageNum = 1
|
this.queryParams.pageNum = 1
|
||||||
this.total = 0
|
this.total = 0
|
||||||
|
this.initOrder()
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -77,14 +77,14 @@
|
|||||||
<!-- 发布通告 -->
|
<!-- 发布通告 -->
|
||||||
<view class="public-notice-box" v-if="'01'==localUserType">
|
<view class="public-notice-box" v-if="'01'==localUserType">
|
||||||
<view class="left-box">
|
<view class="left-box">
|
||||||
<view style="margin-bottom: 20rpx;">发布通告额度剩余3条</view>
|
<view style="margin-bottom: 20rpx;">发布通告额度剩余{{userInfo.coupon}}条</view>
|
||||||
<progress style="width: 90%;" border-radius="5" percent="40" activeColor="#FC1F3E"
|
<!-- <progress style="width: 90%;" border-radius="5" percent="40" activeColor="#FC1F3E"-->
|
||||||
backgroundColor="#DEDEDE" stroke-width="8" />
|
<!-- backgroundColor="#DEDEDE" stroke-width="8" />-->
|
||||||
</view>
|
|
||||||
<view class="right-box">
|
|
||||||
获取更多
|
|
||||||
<uni-icons type="right" color="#623109" size="12"></uni-icons>
|
|
||||||
</view>
|
</view>
|
||||||
|
<!-- <view class="right-box">-->
|
||||||
|
<!-- 获取更多-->
|
||||||
|
<!-- <uni-icons type="right" color="#623109" size="12"></uni-icons>-->
|
||||||
|
<!-- </view>-->
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- 个人信息和其他信息 -->
|
<!-- 个人信息和其他信息 -->
|
||||||
@ -170,12 +170,7 @@
|
|||||||
import tabBarVue from '@/components/tabbar/tabBar.vue'
|
import tabBarVue from '@/components/tabbar/tabBar.vue'
|
||||||
import storage from '@/utils/storage'
|
import storage from '@/utils/storage'
|
||||||
import constant from '@/utils/constant';
|
import constant from '@/utils/constant';
|
||||||
import {
|
import {changeUserType} from '@/utils/common.js'
|
||||||
changeUserType,
|
|
||||||
getUserType,
|
|
||||||
formatNumberWithUnits,
|
|
||||||
calculateTimeDifference
|
|
||||||
} from '@/utils/common.js'
|
|
||||||
import config from '@/config'
|
import config from '@/config'
|
||||||
import {
|
import {
|
||||||
getJSONData,
|
getJSONData,
|
||||||
@ -205,7 +200,9 @@
|
|||||||
globalConfig: getApp().globalData.config,
|
globalConfig: getApp().globalData.config,
|
||||||
//是否已开通会员
|
//是否已开通会员
|
||||||
ifHasCard: false,
|
ifHasCard: false,
|
||||||
userInfo: {},
|
userInfo: {
|
||||||
|
coupon:0
|
||||||
|
},
|
||||||
imageUrl: config.baseUrl,
|
imageUrl: config.baseUrl,
|
||||||
//公众号二维码
|
//公众号二维码
|
||||||
wechat_img: constant.wechat_img,
|
wechat_img: constant.wechat_img,
|
||||||
@ -243,6 +240,7 @@
|
|||||||
this.userInfo.tfansNum = res.data.tfansNum.toString()
|
this.userInfo.tfansNum = res.data.tfansNum.toString()
|
||||||
this.userInfo.pointsBalance = res.data.pointsBalance.toString()
|
this.userInfo.pointsBalance = res.data.pointsBalance.toString()
|
||||||
this.userInfo.report = res.data.report.toString()
|
this.userInfo.report = res.data.report.toString()
|
||||||
|
this.userInfo.coupon = res.data.coupon.toString()
|
||||||
this.userInfo.avatar = this.imageUrl + res.data.avatar
|
this.userInfo.avatar = this.imageUrl + res.data.avatar
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@ -281,7 +279,7 @@
|
|||||||
this.$tab.navigateTo('/pages/mine/auth/auth-choose')
|
this.$tab.navigateTo('/pages/mine/auth/auth-choose')
|
||||||
},
|
},
|
||||||
goCoupon() {
|
goCoupon() {
|
||||||
this.$tab.navigateTo('/pages/mine/coupon/coupon-list')
|
this.$tab.navigateTo('/pages/mine/coupon/coupon-list?userId='+this.userInfo.userId + '&coupon='+this.userInfo.coupon)
|
||||||
},
|
},
|
||||||
goHistory() {
|
goHistory() {
|
||||||
this.$tab.navigateTo('/pages/mine/history/history')
|
this.$tab.navigateTo('/pages/mine/history/history')
|
||||||
|
Loading…
Reference in New Issue
Block a user