Commit de3771bd by 前端

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

2 parents 39f0c8c4 1c84093d
......@@ -23,14 +23,6 @@ export default {
});
},
onShow: async function () {
const userInfo = uni.$storage.get("userInfo") || {};
if (!userInfo.shopMerchantId || !userInfo.shopMerchantName) {
uni.$storage.rm("userInfo");
uni.$storage.rm("sessionId");
uni.reLaunch({
url: "/pages/common/login",
});
}
const systemInfo = await uni.$api.systemApi.getMockData();
if (systemInfo.isCheckedUpdate) {
checkUpdate();
......
......@@ -34,18 +34,18 @@ module.exports = {
/**选择帐号登陆 */
selectAccountLogin (data) {
data.projectName = "boutique";
return http.fetch(
"dj.api.smartcarlife.workWechat.selectAccountLogin",
data
);
return http.post({
method: "dj.api.smartcarlife.workWechat.selectAccountLogin",
...data,
});
},
// 选择4s店和场景
selectMerchantScene (data) {
data.projectName = "boutique";
return http.fetch(
"dj.api.smartcarlife.selectMerchantScene",
data
);
return http.post({
method: "dj.api.smartcarlife.selectMerchantScene",
...data,
});
},
// 获取园区店开通的场景入口
getYqMerchantSceneConfigAPI (data) {
......
No preview for this file type
......@@ -49,7 +49,8 @@ export default {
data () {
return {
carlist: [],
selectItem: {}
selectItem: {},
clickFlga: false
}
},
watch: {
......@@ -81,6 +82,9 @@ export default {
this.$refs.carBrandListVisible.open()
},
selectCar (e) {
let { clickFlga } = this
if (clickFlga) return
this.clickFlga = true
uni.showLoading()
const customerInfo = this.$store.state.user.customerInfo
customerInfo.carBrand = e.name
......@@ -99,7 +103,11 @@ export default {
uni.hideLoading()
this.carlist = res
this.$refs.carBoxVisible.open()
}).catch(() => uni.hideLoading())
this.clickFlga = false
}).catch(() => {
this.clickFlga = false
uni.hideLoading()
})
},
handleSelect (item) {
this.$refs.carBoxVisible.close();
......
......@@ -39,6 +39,7 @@
class="input"
:placeholder="i.placeholder"
:disabled="customerType == 0"
@input="inputCustomer"
/>
</template>
<template v-else>
......@@ -298,6 +299,9 @@ export default {
this.setReceptionStatus(receptionStatus);
this.$emit('submit', receptionStatus)
},
inputCustomer () {
this.$store.dispatch('setCustomerInfo', this.formData)
},
handleSelect (item, popkey) {
this.$refs[popkey].close();
if (popkey == "employeeBoxVisible") {
......
......@@ -85,11 +85,20 @@
</view>
</view>
</template>
<image
<view
class="start"
src="../../assets/images/home/start.webp"
@click="$emit('start')"
/>
>
<image
class="start-btn"
src="../../assets/images/home/start.gif"
/>
<image
class="start-border"
src="../../assets/images/home/start-border.png"
/>
</view>
<!-- <view class="start">
<view class="start-btn"></view>
</view> -->
......@@ -199,7 +208,7 @@ export default {
};
},
mounted () {
let userInfo = uni.$storage.get("userInfo")
const userInfo = uni.$storage.get("userInfo") || {};
this.userInfo = userInfo
setInterval(() => {
this.dateKey = Date.now();
......@@ -223,6 +232,7 @@ export default {
},
methods: {
changeIndex (index) {
if (this.tabIndex == index) return
this.tabIndex = index;
this.$emit("changeTab", index)
},
......@@ -544,64 +554,28 @@ export default {
transform: translateY(calc(100% - 20px)) translateX(0);
}
}
/* 动态计算动画时长以匹配长宽比 */
.start[data-long="true"] {
--duration: calc(12s * (var(--width) / var(--height)));
}
.start[data-long="false"] {
--duration: 6s; /* 或者任何适合短边动画时长 */
}
.start {
// border-radius: 48rpx;
// border: 4rpx solid #fff;
// box-sizing: border-box;
// position: relative;
// overflow: hidden;
&::after {
content: "";
position: absolute;
width: 20rpx;
height: 20rpx;
background-color: white; /* 光环内部的颜色,可以根据需要调整 */
border-radius: 50%; /* 如果希望是圆形光环,则设置为50%以形成圆形 */
box-shadow: 0 0 40rpx 40rpx rgba(255, 255, 255, 0.5),
/* 外发光,白色半透明 */ 0 0 30px 30px rgba(255, 255, 255, 0.3); /* 可以叠加多层以增强效果 */
animation: moveAround var(--duration) ease-in-out infinite;
}
&-btn {
position: absolute;
width: calc(100% - 24rpx);
height: calc(100% - 24rpx);
background-image: linear-gradient(to bottom, #48a6ff 0%, #2c66f7 100%);
border-radius: 48rpx;
width: calc(100% - 64rpx);
height: calc(100% - 64rpx);
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
vertical-align: top;
}
&-border {
position: absolute;
width: 100%;
height: 100%;
left: 0;
top: 0;
vertical-align: top;
}
width: calc(100% - 64rpx);
height: 336rpx;
vertical-align: top;
// display: flex;
// justify-content: center;
// align-items: center;
// // background-image: linear-gradient(90deg, #48a6ff 0%, #2c66f7 100%);
// border-radius: 40rpx;
// transition: all 0.15s;
// background-image: linear-gradient(90deg, #48d7ff, #445dff, #48d7ff);
// background-size: 200% 100%;
// animation: shine 4s linear infinite forwards;
.icon-start {
width: 72rpx;
height: 72rpx;
margin-right: 20rpx;
}
.start-text {
font-weight: 600;
font-size: 48rpx;
color: #ffffff;
line-height: 44rpx;
}
position: relative;
}
.hover-class {
transform: scale(0.98);
......
......@@ -135,6 +135,8 @@ export default {
opacity: 0;
position: relative;
background: rgba(255, 255, 255, 0.6);
visibility: hidden;
height: 0;
&::after {
position: absolute;
content: "";
......@@ -181,6 +183,8 @@ export default {
opacity: 1;
padding-bottom: 16rpx;
animation: scale-up-top-right 0.4s;
visibility: visible;
height: auto;
}
@keyframes scale-up-top-right {
0% {
......
......@@ -16,12 +16,14 @@ import GlsxImage from "./components/GlsxImage";
import MessageBox from "./components/MessageBox/index";
import wnCanvas from "./components/Canvas/wn-canvas";
import UpdateBox from "./components/UpdateBox";
import utils from "./utils/utils";
Vue.component("GlsxImage", GlsxImage);
Vue.component("MessageBox", MessageBox);
Vue.component("wnCanvas", wnCanvas);
Vue.component("UpdateBox", UpdateBox);
uni.$api = api;
uni.$storage = new Storage();
uni.$throttle = utils.throttle
Vue.config.productionTip = false;
App.mpType = "app";
Vue.prototype.$ossDomain = config.OSS_DOMAIN;
......
......@@ -54,6 +54,15 @@ export default {
// });
},
onShow() {
const userInfo = uni.$storage.get("userInfo") || {};
if (!userInfo.shopMerchantId || !userInfo.shopMerchantName) {
uni.$storage.rm("userInfo");
uni.$storage.rm("sessionId");
uni.reLaunch({
url: "/pages/common/login",
});
return
}
// console.log(utils.requestAndroidPermission());
},
methods: {
......
......@@ -41,7 +41,7 @@
<script type='text/ecmascript-6'>
export default {
name: '',
name: 'CustomerType',
data () {
return {
typeList: [
......@@ -67,10 +67,11 @@ export default {
this.$refs.customer.close();
this.$emit('cancel')
},
choose (index) {
choose: uni.$throttle(function (index) {
this.$emit('choose', index)
this.$refs.customer.close();
}
}, 200)
}
}
</script>
......
......@@ -7,17 +7,22 @@
class="qrPopup"
>
<view class="box">
<view
class="icon-close-box flex"
@click="close"
>
<uni-icons
class="icon-close"
type="closeempty"
:size="16"
color="#1A1A1A"
></uni-icons>
</view>
<template v-if="count > 0">
<view class="icon-close-box count">{{count}}</view>
</template>
<template v-else>
<view
class="icon-close-box flex"
@click="close"
>
<uni-icons
class="icon-close"
type="closeempty"
:size="16"
color="#1A1A1A"
></uni-icons>
</view>
</template>
<view class="content flex">
<view class="title flex">
<view class="sprite-icon icon-scan"></view>
......@@ -52,6 +57,7 @@ export default {
},
data () {
return {
count: 4
}
},
mounted () {
......@@ -59,11 +65,21 @@ export default {
methods: {
open () {
this.$refs.qr.open();
this.count = 3
this.countDown()
},
close () {
this.$refs.qr.close();
this.$emit('close')
},
countDown(){
setTimeout(() => {
if(this.count > 0){
this.count--
this.countDown()
}
}, 1000)
}
}
}
</script>
......@@ -84,6 +100,9 @@ export default {
top: 0;
right: 0;
}
.count{
color: #999999;
}
.content {
flex-direction: column;
......@@ -92,7 +111,7 @@ export default {
font-weight: 500;
font-size: 32rpx;
color: #333333;
.sprite-icon{
.sprite-icon {
margin-right: 12rpx;
}
}
......
......@@ -245,7 +245,8 @@ export default {
couponId: '',
carInfo: {},
QRURL: '',
showDetail: false
showDetail: false,
clickFlag: false
},
couponErrorTips: '',
refreshKey: Date.now()
......@@ -302,6 +303,7 @@ export default {
return b.createdDate - a.createdDate
})[0])
})
console.log(arr)
let item = arr.find(e => e.couponType == 1),
item2 = arr.find(e => e.couponType == 18)
if (!this.pageParams.couponId) {
......@@ -353,10 +355,14 @@ export default {
},
async createCoupon () {
try {
const { pageParams: { couponId, carInfo }, customerInfo } = this, {
const { pageParams: { clickFlag, couponId, carInfo }, customerInfo } = this, {
shopMerchantId } = uni.$storage.get("userInfo"),
validateStatus = await this.validate()
validateStatus = await this.validate(),
checkCouponAmount = await this.checkCouponAmount(couponId, [shopMerchantId])
if (!checkCouponAmount.length) throw '该门店礼券已使用完,请联系管理员配置。'
if (!validateStatus) return
if (clickFlag) return
this.pageParams.clickFlag = true
uni.showLoading()
let { staffName, salesUuid } = customerInfo,
scene = `id=${couponId}&userId=${salesUuid}&employName=${staffName}&merchantId=${shopMerchantId}&customerName=${customerInfo.customerName}&customerPhone=${customerInfo.phoneNumber}`,
......@@ -373,17 +379,20 @@ export default {
data,
message
} = await uni.$api.commonApi.createQrcode(params)
uni.hideLoading()
if (code == 0) {
if (data) {
this.pageParams.QRURL = data
this.checkCustomerReceivedStatus(dayjs().format("YYYY-MM-DD HH:mm:ss"))
this.$refs.qrbox.open()
uni.hideLoading()
this.pageParams.clickFlag = false
}
else throw '生成小程序码失败,请重试!'
} else throw message
} catch (error) {
uni.hideLoading()
if (error) {
this.pageParams.clickFlag = false
this.couponErrorTips = error
this.$refs.couponTips.open()
}
......@@ -399,6 +408,8 @@ export default {
if (phoneNumber && !phoneRex.test(phoneNumber)) throw '请输入正确的手机号'
if (!couponId) throw '请选择礼券类型'
} catch (error) {
this.pageParams.clickFlag = false
uni.hideLoading()
uni.showToast({
title: error,
icon: 'none',
......@@ -408,6 +419,7 @@ export default {
return flag
},
checkCustomerReceivedStatus (receiveCouponStartTime) {
if(this.pageParams.qrTimer) return
try {
this.pageParams.received = false
this.pageParams.qrTimer = setInterval(async () => {
......@@ -449,6 +461,13 @@ export default {
},
resetFocusIndex () {
this.focusIndex = -1
},
async checkCouponAmount (merchantCouponId, merchantIdList) {
const { list } = await uni.$api.boutiqueApi.findCouponList({
merchantCouponId,
merchantIdList
})
return list || []
}
}
}
......
......@@ -66,7 +66,6 @@ import { mapMutations } from "vuex";
import invitation from "./invitation.vue";
import Case from "./case.vue";
import history from "./history.vue";
import utils from "@/utils/utils";
export default {
components: {
ToolBox,
......@@ -101,7 +100,7 @@ export default {
watchStatus () {
return this.$store.state.user.historyStatus;
},
toolList(){
toolList () {
return JSON.parse(JSON.stringify(this.media)).sort(function (a, b) {
return a.shortSort - b.shortSort
})
......@@ -149,7 +148,17 @@ export default {
this.$emit("update:id", Number(id));
},
/**回店客户 */
reception ({ item }) {
async reception ({ item }) {
const result = await this.$permision.requestAndroidPermission(
"android.permission.RECORD_AUDIO"
);
if (result !== 1) {
uni.showToast({
title: "为了记录语音通话,请打开录音权限",
icon: "none",
});
return
}
this.$store.dispatch('setCustomerInfo', {
customerName: item.customerName,
carModel: item.carSeriesName,
......
......@@ -187,11 +187,12 @@ export default {
title: "为了记录语音通话,请打开录音权限",
icon: "none",
});
return;
return false
}
if (before) this.clearHistory();
this.startAudio();
this.recording = true
return true
},
jumpPage (id) {
this.id = id ? id : this.moduleList[0].id
......@@ -205,10 +206,11 @@ export default {
this.$refs.home.finishRef.close();
this.$refs.detail.open();
},
chooseCustomerType (index) {
const { moduleList } = this
async chooseCustomerType (index) {
const { moduleList } = this,
flag = await this.start()
if (!flag) return
this.customerType = index
this.start()
if (index == 0) {
const { id } = moduleList[moduleList.length - 1]
this.jumpPage(id)
......
......@@ -117,26 +117,40 @@ export default {
}
},
},
watch: {
watchStatus: {
handler () {
this.init()
},
immediate: true
},
show () {
this.$refs.receptionTips?.close()
this.getRecordList()
}
},
methods: {
init() {
this.customerNameOrPhone = '';
this.isSearch = false
this.pageNum = 1
this.flag = false
this.getRecordList()
init () {
this.customerNameOrPhone = '';
this.isSearch = false
this.pageNum = 1
this.flag = false
},
//已预约的并且预约时间小于当前时间的,显示超时未到店,否则显示已预约
formatInvite(val) {
if(val.inviteStatus == 2 && new Date().getTime() > new Date(val.inviteDate).getTime()) {
return 5
}
return val.inviteStatus
formatInvite (val) {
if (val.inviteStatus == 2 && new Date().getTime() > new Date(val.inviteDate).getTime()) {
return 5
}
return val.inviteStatus
},
formatTime(val,key) {
if(key == 'customerPhone') {
return val.slice(0, 3) + " " + val.slice(3, 7) + " " + val.slice(7)
}
return dayjs(val).format("YYYY-MM-DD HH:mm:ss")
formatTime (val, key) {
if (key == 'customerPhone') {
return val.slice(0, 3) + " " + val.slice(3, 7) + " " + val.slice(7)
}
return dayjs(val).format("YYYY-MM-DD HH:mm:ss")
},
//下拉分页
pageonReachBottom () {
......@@ -151,15 +165,15 @@ export default {
this.customerNameOrPhone = e.detail.value
if (this.customerNameOrPhone == '')
this.isSearch = false
this.pageNum = 1
this.flag = false
this.getRecordList()
this.pageNum = 1
this.flag = false
this.getRecordList()
},
focus () {
this.isSearch = true
},
handleClear() {
this.init()
handleClear () {
this.init()
},
getRecordList () {
const { pageNum, pageSize, customerNameOrPhone } = this,
......@@ -176,11 +190,11 @@ export default {
this.chooseItem = item
this.$refs.receptionTips.open()
},
jumpPage () {
jumpPage: uni.$throttle(function () {
this.$emit('reception', {
item: this.chooseItem
})
}
}, 200)
},
}
</script>
......
......@@ -74,7 +74,7 @@ export default {
uni.$storage.set('sessionId', sessionId);
this.loginUserInfoList = loginUserInfoList
this.copyLoginUserInfoList = loginUserInfoList
if(autoLogin) this.chooseAccount(loginUserInfoList[0])
if (autoLogin) this.chooseAccount(loginUserInfoList[0])
} else uni.showToast({
title: message,
icon: 'none',
......@@ -117,14 +117,13 @@ export default {
if (this.requestFlag) return
this.requestFlag = true
uni.showLoading()
uni.$api.userApi.selectAccountLogin({ id }).then(res => {
uni.$api.userApi.selectAccountLogin({ id }).then(data => {
uni.hideLoading()
this.requestFlag = false
let { data, message } = res,
[userInfo] = data.loginUserInfoList
let [userInfo] = data.loginUserInfoList
if (data && userInfo) this.get4SStoreList(userInfo)
else uni.showToast({
title: message,
title: '获取4S店列表失败',
icon: 'none',
})
})
......
......@@ -80,13 +80,12 @@ export default {
if (userInfo?.isSuper) this.jump(userInfo)
else {
try {
const { message, data, code } = await uni.$api.userApi.selectMerchantScene({
const data = await uni.$api.userApi.selectMerchantScene({
merchantId: userInfo.shopMerchantId,
merchantName: userInfo.shopMerchantName,
sceneType
})
if (code == 0) this.jump(userInfo, data)
else throw message
if (data) this.jump(userInfo, data)
} catch (error) {
uni.showToast({
title: error,
......
......@@ -254,6 +254,7 @@ export default {
this.pageNum = 1
this.dateIndex = index
this.getReceptionList()
this.getReceptionStatistics(0)
},
pageonReachBottom () {
let { pageNum, total, nothing, pageSize } = this
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!