Commit 5bbe555c by 前端

Merge branch 'v1.0.5' of http://192.168.3.233:8090/glsx/gl_tape into v1.0.5

2 parents c6621814 f6bb913d
......@@ -2,7 +2,7 @@ import http from "../request/http";
module.exports = {
/**获取APP更新 */
findSoureList(data) {
findSoureList (data) {
return http.post({
method: "dj.api.smartcarlife.recepiton.soure.findSoureList",
projectName: "boutique",
......@@ -10,22 +10,22 @@ module.exports = {
});
},
/** 查询可发放礼券-分页查询商户券列表 */
findCouponList(data) {
findCouponList (data) {
return http.post(
{
method: "dj.api.smartcarlife.merchantCoupon.pageForZYApp",
projectName: "boutique",
onlyUsable: true,
currentPage: 1,
pageSize: 99999,
...data,
},
false,
"ip"
}
);
},
/**查询用户是否领券 */
findCustomerReceivedStatus(data) {
findCustomerReceivedStatus (data) {
return http.post({
method: "dj.api.smartcarlife.customerCoupon.page",
method: "dj.api.smartcarlife.customerCoupon.pageForZYApp",
projectName: "boutique",
...data,
currentPage: 1,
......@@ -33,7 +33,7 @@ module.exports = {
});
},
/**历史成交客户 */
historyDealOrderPage(data) {
historyDealOrderPage (data) {
return http.post({
method: "dj.api.smartcarlife.order.historyDealOrder.page",
projectName: "boutique",
......@@ -41,7 +41,7 @@ module.exports = {
});
},
/**客户邀约记录 */
customerInviteRecordPage(data) {
customerInviteRecordPage (data) {
return http.post({
method: "dj.api.smartcarlife.customerInviteRecord.page",
projectName: "boutique",
......
......@@ -68,10 +68,7 @@ class Request {
let {
data,
} = response
if (!data) return uni.showToast({
title: "接口异常",
icon: "none",
});
if (!data) return reject()
let { code, message } = data
if (returnAll) {
resolve(data);
......
.sprite-icon {
background-image: url(@/assets/images/sprite.png);
background-size: 1070rpx 876rpx;
}
.icon-arrow-right {
width: 32rpx;
height: 32rpx;
background-position: -1032rpx -60rpx;
}
.icon-back {
width: 128rpx;
height: 50rpx;
background-position: -942rpx 0rpx;
}
.icon-change-account {
width: 32rpx;
height: 32rpx;
background-position: -1032rpx -102rpx;
}
.icon-customer-1 {
width: 400rpx;
height: 400rpx;
background-position: 0rpx 0rpx;
}
.icon-customer-2 {
width: 400rpx;
height: 400rpx;
background-position: -410rpx 0rpx;
}
.icon-face-error-active {
width: 96rpx;
height: 96rpx;
background-position: -820rpx -610rpx;
}
.icon-face-error {
width: 96rpx;
height: 96rpx;
background-position: 0rpx -780rpx;
}
.icon-face-success-active {
width: 96rpx;
height: 96rpx;
background-position: -106rpx -780rpx;
}
.icon-face-success {
width: 96rpx;
height: 96rpx;
background-position: -212rpx -780rpx;
}
.icon-feedback {
width: 32rpx;
height: 32rpx;
background-position: -1032rpx -150rpx;
}
.icon-first-nav {
width: 464rpx;
height: 176rpx;
background-position: 0rpx -410rpx;
}
.icon-home-active {
width: 80rpx;
height: 80rpx;
background-position: -942rpx -60rpx;
}
.icon-home {
width: 80rpx;
height: 80rpx;
background-position: -942rpx -150rpx;
}
.icon-icon-addr {
width: 32rpx;
height: 32rpx;
background-position: -1032rpx -192rpx;
}
.icon-icon-avatar {
width: 112rpx;
height: 112rpx;
background-position: -820rpx 0rpx;
}
.icon-icon-female {
width: 32rpx;
height: 32rpx;
background-position: -1032rpx -240rpx;
}
.icon-icon-handshake {
width: 72rpx;
height: 72rpx;
background-position: -942rpx -420rpx;
}
.icon-icon-male {
width: 32rpx;
height: 32rpx;
background-position: -1032rpx -282rpx;
}
.icon-icon-shop {
width: 32rpx;
height: 32rpx;
background-position: -1032rpx -330rpx;
}
.icon-icon-upload {
width: 128rpx;
height: 128rpx;
background-position: -644rpx -410rpx;
}
.icon-icon-weixin {
width: 32rpx;
height: 32rpx;
background-position: -1032rpx -372rpx;
}
.icon-kf-0 {
width: 32rpx;
height: 32rpx;
background-position: -1016rpx -576rpx;
}
.icon-kf-1 {
width: 32rpx;
height: 32rpx;
background-position: -1012rpx -650rpx;
}
.icon-kf-2 {
width: 32rpx;
height: 32rpx;
background-position: -1012rpx -720rpx;
}
.icon-kf-3 {
width: 32rpx;
height: 32rpx;
background-position: -1012rpx -790rpx;
}
.icon-logo {
width: 160rpx;
height: 160rpx;
background-position: -474rpx -410rpx;
}
.icon-new-addr {
width: 32rpx;
height: 32rpx;
background-position: -820rpx -716rpx;
}
.icon-new-avatar {
width: 96rpx;
height: 96rpx;
background-position: -318rpx -780rpx;
}
.icon-new-feedback {
width: 64rpx;
height: 64rpx;
background-position: -942rpx -502rpx;
}
.icon-new-home-active {
width: 112rpx;
height: 112rpx;
background-position: -820rpx -122rpx;
}
.icon-new-home {
width: 112rpx;
height: 112rpx;
background-position: -820rpx -244rpx;
}
.icon-new-record-active {
width: 112rpx;
height: 112rpx;
background-position: -820rpx -366rpx;
}
.icon-new-record {
width: 112rpx;
height: 112rpx;
background-position: -820rpx -488rpx;
}
.icon-new-setting {
width: 64rpx;
height: 64rpx;
background-position: -942rpx -576rpx;
}
.icon-pen-active {
width: 120rpx;
height: 120rpx;
background-position: -490rpx -596rpx;
}
.icon-pen {
width: 120rpx;
height: 120rpx;
background-position: -620rpx -596rpx;
}
.icon-qw {
width: 48rpx;
height: 48rpx;
background-position: -1016rpx -502rpx;
}
.icon-record-active {
width: 80rpx;
height: 80rpx;
background-position: -942rpx -240rpx;
}
.icon-record {
width: 80rpx;
height: 80rpx;
background-position: -942rpx -330rpx;
}
.icon-scene-0 {
width: 96rpx;
height: 96rpx;
background-position: -424rpx -780rpx;
}
.icon-scene-1 {
width: 96rpx;
height: 96rpx;
background-position: -530rpx -780rpx;
}
.icon-search {
width: 40rpx;
height: 40rpx;
background-position: -1024rpx -420rpx;
}
.icon-second-nav {
width: 480rpx;
height: 128rpx;
background-position: 0rpx -596rpx;
}
.icon-setting {
width: 32rpx;
height: 32rpx;
background-position: -862rpx -716rpx;
}
.icon-store {
width: 96rpx;
height: 96rpx;
background-position: -636rpx -780rpx;
}
.icon-tool-file {
width: 60rpx;
height: 60rpx;
background-position: -942rpx -650rpx;
}
.icon-tool-finish {
width: 60rpx;
height: 60rpx;
background-position: -942rpx -720rpx;
}
.icon-tool-pay {
width: 60rpx;
height: 60rpx;
background-position: -942rpx -790rpx;
}
.icon-customer-1 {
width: 400rpx;
height: 400rpx;
background-position: 0rpx 0rpx;
}
.icon-customer-2 {
width: 400rpx;
height: 400rpx;
background-position: -410rpx 0rpx;
}
.icon-aito {
width: 320rpx;
height: 36rpx;
background-position: 0rpx -734rpx;
}
.icon-qr-success {
width: 96rpx;
height: 96rpx;
background-position: -742rpx -780rpx;
}
.sprite-icon { background-image: url(@/assets/images/sprite.png);background-size: 1070rpx 876rpx;}
.icon-aito { width: 320rpx; height: 36rpx; background-position: 0rpx -734rpx;}
.icon-arrow-right { width: 32rpx; height: 32rpx; background-position: -1032rpx -60rpx;}
.icon-back { width: 128rpx; height: 50rpx; background-position: -942rpx 0rpx;}
.icon-change-account { width: 32rpx; height: 32rpx; background-position: -1032rpx -102rpx;}
.icon-customer-1 { width: 400rpx; height: 400rpx; background-position: 0rpx 0rpx;}
.icon-customer-2 { width: 400rpx; height: 400rpx; background-position: -410rpx 0rpx;}
.icon-face-error-active { width: 96rpx; height: 96rpx; background-position: -820rpx -610rpx;}
.icon-face-error { width: 96rpx; height: 96rpx; background-position: 0rpx -780rpx;}
.icon-face-success-active { width: 96rpx; height: 96rpx; background-position: -106rpx -780rpx;}
.icon-face-success { width: 96rpx; height: 96rpx; background-position: -212rpx -780rpx;}
.icon-feedback { width: 32rpx; height: 32rpx; background-position: -1032rpx -150rpx;}
.icon-first-nav { width: 464rpx; height: 176rpx; background-position: 0rpx -410rpx;}
.icon-home-active { width: 80rpx; height: 80rpx; background-position: -942rpx -60rpx;}
.icon-home { width: 80rpx; height: 80rpx; background-position: -942rpx -150rpx;}
.icon-icon-addr { width: 32rpx; height: 32rpx; background-position: -1032rpx -192rpx;}
.icon-icon-avatar { width: 112rpx; height: 112rpx; background-position: -820rpx 0rpx;}
.icon-icon-female { width: 32rpx; height: 32rpx; background-position: -1032rpx -240rpx;}
.icon-icon-handshake { width: 72rpx; height: 72rpx; background-position: -942rpx -420rpx;}
.icon-icon-male { width: 32rpx; height: 32rpx; background-position: -1032rpx -282rpx;}
.icon-icon-shop { width: 32rpx; height: 32rpx; background-position: -1032rpx -330rpx;}
.icon-icon-upload { width: 128rpx; height: 128rpx; background-position: -644rpx -410rpx;}
.icon-icon-weixin { width: 32rpx; height: 32rpx; background-position: -1032rpx -372rpx;}
.icon-kf-0 { width: 32rpx; height: 32rpx; background-position: -1016rpx -576rpx;}
.icon-kf-1 { width: 32rpx; height: 32rpx; background-position: -1012rpx -650rpx;}
.icon-kf-2 { width: 32rpx; height: 32rpx; background-position: -1012rpx -720rpx;}
.icon-kf-3 { width: 32rpx; height: 32rpx; background-position: -1012rpx -790rpx;}
.icon-logo { width: 160rpx; height: 160rpx; background-position: -474rpx -410rpx;}
.icon-new-addr { width: 32rpx; height: 32rpx; background-position: -820rpx -716rpx;}
.icon-new-avatar { width: 96rpx; height: 96rpx; background-position: -318rpx -780rpx;}
.icon-new-feedback { width: 64rpx; height: 64rpx; background-position: -942rpx -502rpx;}
.icon-new-home-active { width: 112rpx; height: 112rpx; background-position: -820rpx -122rpx;}
.icon-new-home { width: 112rpx; height: 112rpx; background-position: -820rpx -244rpx;}
.icon-new-record-active { width: 112rpx; height: 112rpx; background-position: -820rpx -366rpx;}
.icon-new-record { width: 112rpx; height: 112rpx; background-position: -820rpx -488rpx;}
.icon-new-setting { width: 64rpx; height: 64rpx; background-position: -942rpx -576rpx;}
.icon-pen-active { width: 120rpx; height: 120rpx; background-position: -490rpx -596rpx;}
.icon-pen { width: 120rpx; height: 120rpx; background-position: -620rpx -596rpx;}
.icon-qr-success { width: 96rpx; height: 96rpx; background-position: -424rpx -780rpx;}
.icon-qw { width: 48rpx; height: 48rpx; background-position: -1016rpx -502rpx;}
.icon-record-active { width: 80rpx; height: 80rpx; background-position: -942rpx -240rpx;}
.icon-record { width: 80rpx; height: 80rpx; background-position: -942rpx -330rpx;}
.icon-scene-0 { width: 96rpx; height: 96rpx; background-position: -530rpx -780rpx;}
.icon-scene-1 { width: 96rpx; height: 96rpx; background-position: -636rpx -780rpx;}
.icon-search { width: 40rpx; height: 40rpx; background-position: -1024rpx -420rpx;}
.icon-second-nav { width: 480rpx; height: 128rpx; background-position: 0rpx -596rpx;}
.icon-setting { width: 32rpx; height: 32rpx; background-position: -862rpx -716rpx;}
.icon-store { width: 96rpx; height: 96rpx; background-position: -742rpx -780rpx;}
.icon-tool-file { width: 60rpx; height: 60rpx; background-position: -942rpx -650rpx;}
.icon-tool-finish { width: 60rpx; height: 60rpx; background-position: -942rpx -720rpx;}
.icon-tool-pay { width: 60rpx; height: 60rpx; background-position: -942rpx -790rpx;}
\ No newline at end of file

937 KB | W: | H:

937 KB | W: | H:

assets/images/sprite.png
assets/images/sprite.png
assets/images/sprite.png
assets/images/sprite.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -41,6 +41,7 @@
v-if="isFooter"
>
<view
v-if="showCancelBtn"
class="tips-btn close"
@click="cancel()"
>{{
......@@ -106,7 +107,11 @@ export default {
default: "取消",
},
maxHeight: Number,
back: Boolean
back: Boolean,
showCancelBtn: {
type: Boolean,
default: true,
}
},
methods: {
close () {
......
......@@ -9,7 +9,7 @@
<view class="box">
<view
class="icon-close-box flex"
@click="$refs.qr.close()"
@click="close"
>
<uni-icons
class="icon-close"
......
......@@ -107,7 +107,7 @@
<view class="select-box">
<view
class="select-item"
:class="{ checked: couponId == item.id }"
:class="{ checked: pageParams.couponId == item.id }"
@click="chooseCoupon(item)"
v-for="(item, index) in couponList"
:key="index"
......@@ -116,10 +116,16 @@
</view>
</view>
</MessageBox>
<MessageBox
ref="couponTips"
content="该门店礼券已使用完,请联系管理员配置。"
:showCancelBtn="false"
confirmBtnText="知道了"
></MessageBox>
<qr-box
:url="QRURL"
:url="pageParams.QRURL"
ref="qrbox"
:received="received"
:received="pageParams.received"
@close="closeQr"
/>
</view>
......@@ -174,11 +180,13 @@ export default {
couponList: [],
couponTypeName: '',
focusIndex: -1,
couponId: '',
carInfo: {},
QRURL: '',
received: false,
qrTimer: null
pageParams: {
qrTimer: null,
received: false,
couponId: '',
carInfo: {},
QRURL: '',
}
}
},
watch: {
......@@ -190,6 +198,13 @@ export default {
},
show (n) {
if (n && this.customerType == 1) this.init()
},
watchStatus: {
immediate: true,
handler (newval) {
this.pageParams = this.$options.data.call(this).pageParams
this.resetFocusIndex()
}
}
},
computed: {
......@@ -203,8 +218,6 @@ export default {
methods: {
init () {
this.qrTimer = null
this.resetFocusIndex()
this.findCouponList()
},
async findCouponList () {
......@@ -212,12 +225,28 @@ export default {
{ shopMerchantId } = userInfo,
{ list } = await uni.$api.boutiqueApi.findCouponList({
merchantIdList: [shopMerchantId]
})
}),
arr = []
if (list && list.length) {
let item = list.find(e => e.couponType == 1)
if (item && !this.couponId) this.chooseCoupon(item)
}
this.couponList = list || []
let couponTypeList = Array.from(new Set([...list.map((e) => e.couponType)]))
couponTypeList.map((i) => {
let item = []
list.map((e) => {
if (i == e.couponType) item.push(e)
})
if (item.length) arr.push(item.sort(function (a, b) {
return b.createdDate - a.createdDate
})[0])
})
let item = arr.find(e => e.couponType == 1),
item2 = arr.find(e => e.couponType == 18)
if (!this.pageParams.couponId) {
if (item) this.chooseCoupon(item) //默认填入类型为「太阳膜」类型
else if (item2) this.chooseCoupon(item) //次选填入「精品」类型
else this.chooseCoupon(arr[0]) // 无此两种类型情况默认带入任意类型礼券
}
} else this.$refs.couponTips.open()
this.couponList = arr
},
inputCustomer () {
this.$store.dispatch('setCustomerInfo', this.customerInfo)
......@@ -230,7 +259,7 @@ export default {
} else {
this.$refs.carBrandListVisible.close()
this.customerInfo.carModel = item.name
this.carInfo = item
this.pageParams.carInfo = item
}
this.resetFocusIndex()
this.$store.dispatch('setCustomerInfo', this.customerInfo)
......@@ -247,7 +276,7 @@ export default {
this.closeQr()
},
chooseCoupon (item) {
this.couponId = item.id
this.pageParams.couponId = item.id
this.couponTypeName = item.couponTypeName
this.$refs.couponBoxVisible.close()
},
......@@ -256,7 +285,7 @@ export default {
},
async createCoupon () {
try {
const { couponId, customerInfo, carInfo } = this
const { pageParams: { couponId, carInfo }, customerInfo } = this
await this.validate()
uni.showLoading()
const {
......@@ -281,13 +310,12 @@ export default {
uni.hideLoading()
if (code == 0) {
if (data) {
this.QRURL = data
this.pageParams.QRURL = data
this.checkCustomerReceivedStatus(dayjs().format("YYYY-MM-DD HH:mm:ss"))
this.$refs.qrbox.open()
}
else throw '生成小程序码失败,请重试!'
} else throw message
console.log(data)
} catch (error) {
console.log(error)
uni.showToast({
......@@ -298,7 +326,7 @@ export default {
},
async validate () {
const { customerName, phoneNumber, carModel, staffName } = this.customerInfo,
{ couponId } = this
{ couponId } = this.pageParams
// 检查车主姓名
if (!customerName) throw '请输入车主姓名'
// 检查车主手机
......@@ -312,26 +340,33 @@ export default {
if (!couponId) throw '请选择礼券类型'
},
checkCustomerReceivedStatus (receiveCouponStartTime) {
this.qrTimer = setInterval(async () => {
const { couponId, customerInfo } = this,
res = await uni.$api.boutiqueApi.findCustomerReceivedStatus({
merchantCouponId: couponId,
customerPhone: customerInfo.phoneNumber,
receiveCouponStartTime
})
if (res.total) {
this.received = true
this.closeQr()
setTimeout(() => {
this.$refs.qrbox.close()
}, 3e3)
}
}, 1e3)
try {
this.pageParams.received = false
this.pageParams.qrTimer = setInterval(async () => {
const { pageParams: { couponId }, customerInfo } = this,
res = await uni.$api.boutiqueApi.findCustomerReceivedStatus({
merchantCouponId: couponId,
customerPhone: customerInfo.phoneNumber,
receiveCouponStartTime
})
if (res && res.total) {
this.pageParams.received = true
this.closeQr()
setTimeout(() => {
this.$refs.qrbox.close()
}, 3e3)
}
}, 1e3)
} catch (error) {
if (error) uni.showToast({
title: error,
icon: "none",
});
}
},
closeQr () {
console.log(this.qrTimer)
clearInterval(this.qrTimer)
this.qrTimer = null
clearInterval(this.pageParams.qrTimer)
this.pageParams.qrTimer = null
},
resetFocusIndex () {
......
......@@ -169,16 +169,16 @@ export default {
this.init();
},
async start () {
// const result = await this.$permision.requestAndroidPermission(
// "android.permission.RECORD_AUDIO"
// );
// if (result !== 1) {
// uni.showToast({
// title: "为了记录语音通话,请打开录音权限",
// icon: "none",
// });
// return;
// }
const result = await this.$permision.requestAndroidPermission(
"android.permission.RECORD_AUDIO"
);
if (result !== 1) {
uni.showToast({
title: "为了记录语音通话,请打开录音权限",
icon: "none",
});
return;
}
this.$refs.customerTypeRef.open()
this.startAudio();
},
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!