Commit b393a075 by yixinjj

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

2 parents 28273b4a a9f46d15
......@@ -70,9 +70,11 @@ const imgToBase64 = (list, urlKey) => {
})
})
};
const updateMockData = (data, key) => {
const updateMockData = (dataList, keyList) => {
const mockData = uni.$storage.get('mock_data')
mockData[key] = data
keyList.map(key => {
mockData[key] = dataList[key]
})
setTimeout(() => {
uni.$storage.set("mock_data", mockData)
}, 1e3)
......
......@@ -11,16 +11,16 @@ const HOST = {
scrm: domain,
dj: djDomain,
merchant: merchantDomain,
ip: 'http://192.168.1.169:8292'
ip: "http://192.168.1.169:8292",
};
class Request {
get (params, returnAll = false, hostType) {
get(params, returnAll = false, hostType) {
return this.request("GET", params, returnAll, hostType);
}
post (params, returnAll = false, hostType) {
post(params, returnAll = false, hostType) {
return this.request("POST", params, returnAll, hostType);
}
fetch (method, data, returnAll = true, hostType) {
fetch(method, data, returnAll = true, hostType) {
return this.post(
{
method,
......@@ -30,28 +30,28 @@ class Request {
hostType
);
}
request (RequestMethods, params, returnAll, hostType = "dj") {
request(RequestMethods, params, returnAll, hostType = "dj") {
return new Promise((resolve, reject) => {
let _this = this
let _this = this;
uni.getNetworkType({
success (res) {
if (res.networkType == 'none') {
success(res) {
if (res.networkType == "none") {
uni.hideLoading();
uni.showToast({
title: '网络异常',
icon: "error",
});
reject('网络异常');
return
// uni.showToast({
// title: '网络异常',
// icon: "error",
// });
reject("网络异常");
return;
}
let header = RequestMethods === "POST"
? {
"content-type": "application/x-www-form-urlencoded",
}
: {
"Cache-Control": "no-cache",
};
let header =
RequestMethods === "POST"
? {
"content-type": "application/x-www-form-urlencoded",
}
: {
"Cache-Control": "no-cache",
};
let projectName = params.projectName;
if (!projectName) projectName = _this.getRopProject(params.method);
const path = pathEnum[projectName];
......@@ -63,13 +63,11 @@ class Request {
header,
dataType: "json",
responseType: "text",
success (response) {
success(response) {
/**业务代码 */
let {
data,
} = response
if (!data) return reject()
let { code, message } = data
let { data } = response;
if (!data) return reject();
let { code, message } = data;
if (returnAll) {
resolve(data);
return;
......@@ -83,7 +81,7 @@ class Request {
if (code == "0") {
resolve(data.data);
} else {
uni.hideLoading()
uni.hideLoading();
uni.showToast({
title: message || "系统异常",
icon: "none",
......@@ -91,27 +89,29 @@ class Request {
}
}
},
fail (error) {
fail(error) {
uni.hideLoading();
console.error(`${params.method}接口异常:`, error);
uni.showToast({
title:
typeof error == "string"
? error
: error.errMsg ? error.errMsg : JSON.stringify(error) || "系统异常",
: error.errMsg
? error.errMsg
: JSON.stringify(error) || "系统异常",
icon: "error",
});
reject(error);
},
complete () {
complete() {
uni.stopPullDownRefresh();
},
});
}
})
},
});
});
}
getData (params, hostType = "scrm") {
getData(params, hostType = "scrm") {
let projectName = params.projectName;
if (!projectName) projectName = this.getRopProject(params.method);
else delete params.projectName;
......@@ -143,11 +143,11 @@ class Request {
params.appKey = appKey;
return sign(params, secret, noSignAttr);
}
getRopProject (method) {
getRopProject(method) {
const projectName = method.split(".")[2];
return projectName;
}
uni_request ({
uni_request({
url,
method = "GET",
data = {},
......@@ -163,7 +163,7 @@ class Request {
header,
dataType,
responseType,
success (response) {
success(response) {
resolve(response.data);
},
});
......
......@@ -208,6 +208,7 @@ export default {
this.nothing = false
if(index == 0) {
this.changeIndex(this.dateIndex,true)
this.getRecordNum()
}else {
this.getRecordFail()
}
......
......@@ -115,7 +115,7 @@ export default {
return params;
},
//开始录音
async startAudio() {
startAudio: utils.throttle(async function () {
if (this.audioInfo.audioStatus == "start") return;
this.setAudioInfo({ audioList: [], audioStatus: "start" });
this.initTime();
......@@ -140,6 +140,9 @@ export default {
console.log(res);
},
});
setTimeout(() => {
uni.hideLoading();
}, 3000);
return;
}
const saveResult = await uni.saveFile({
......@@ -154,7 +157,7 @@ export default {
});
this.handleSave(saveResult[1].savedFilePath);
});
},
}, 300),
handleSave(file) {
const audioList = [...this.audioInfo.audioList, file];
if (file) {
......@@ -167,7 +170,9 @@ export default {
this.setBooks([]);
this.$store.dispatch("clearCustomerInfo");
this.setReceptionStatus(1);
this.setAudioInfo({ endReasonType: 0, audioStatus: "finish" });
setTimeout(() => {
this.setAudioInfo({ endReasonType: 0, audioStatus: "finish" });
}, 2000);
},
/**保存记录*/
async saveRecord() {
......@@ -216,11 +221,9 @@ export default {
let finish_timer = null;
this.setAudioInfo({ audioStatus: "end" });
//直接退出
if (!status) {
uni.showLoading({
mask: true,
});
}
uni.showLoading({
mask: true,
});
this.times = 0;
clearInterval(this.timer);
this.timer = null;
......
......@@ -2,22 +2,30 @@
<view class="layout">
<view class="title">{{ title }}</view>
<template v-if="list.length > 0">
<scroll-view class="record-box" scroll-y @scrolltolower="pageonReachBottom">
<scroll-view
class="record-box"
scroll-y
@scrolltolower="pageonReachBottom"
>
<view class="card-list">
<view class="card-item" v-for="item in list" :key="item.id">
<template>
<image
v-if="item.vdQuotationPaymentDoc && item.vdQuotationPaymentDoc.paymentDocUrl"
class="image-box"
:src="item.vdQuotationPaymentDoc.paymentDocUrl"
/>
<image
v-else
class="image-box"
src="https://img02.glsx.com.cn/weapp/resource/app-tape/media/common/pay.webp"
/>
<view class="gradient-overlay"></view>
</template>
<view
class="card-item"
v-for="item in list"
:key="item.id"
>
<template>
<image
v-if="item.vdQuotationPaymentDoc && item.vdQuotationPaymentDoc.paymentDocUrl"
class="image-box"
:src="item.vdQuotationPaymentDoc.paymentDocUrl"
/>
<image
v-else
class="image-box"
src="https://img02.glsx.com.cn/weapp/resource/app-tape/media/common/pay.webp"
/>
<view class="gradient-overlay"></view>
</template>
<view>
<!-- <view class="name">{{ nameHide(item.customerName) }}</view> -->
<view class="name">{{ item.id }}</view>
......@@ -36,21 +44,30 @@
</view>
<view class="card-info">
<view class="label">实收金额</view>
<view class="price"><view class="flag">¥</view>{{ accDiv(item.equityPrice) }}</view>
<view class="price">
<view class="flag">¥</view>{{ accDiv(item.equityPrice) }}
</view>
</view>
</view>
</view>
</view>
<view class="end-text" v-if="list.length > 0 && isEnd">我是一个有底线的人</view>
<view
class="end-text"
v-if="list.length > 0 && isEnd"
>我是一个有底线的人</view>
</scroll-view>
</template>
<template v-else>
<view class="no-data">
<glsx-image class="no-data-img" src="media/no-data.png" mode="scaleToFill" />
<glsx-image
class="no-data-img"
src="media/no-data.png"
mode="scaleToFill"
/>
<view class="no-data-text">暂无数据</view>
</view>
</template>
</view>
</template>
......@@ -59,13 +76,13 @@ import utils from '@/utils/utils';
import Record from "@/mixin/record";
export default {
name: 'History',
mixins:[Record],
mixins: [Record],
props: {
title: String,
madiaId: Number,
show: Boolean,
},
data() {
data () {
return {
isEnd: false,
shopMerchantId: '',
......@@ -80,12 +97,12 @@ export default {
immediate: true,
handler (newval) {
this.pageNum = 1
this.list = uni.$storage.get(`${this.shopMerchantId}-historyList`)
this.list = uni.getStorageSync(`${this.shopMerchantId}-historyList`)
}
},
watchCarModel: {
immediate: true,
handler(newval) {
handler (newval) {
console.log(newval)
if (this.madiaId == 4) {
// this.list = uni.$storage.get("historyList")
......@@ -115,33 +132,33 @@ export default {
init () {
const { shopMerchantId } = uni.$storage.get("userInfo");
this.shopMerchantId = shopMerchantId
this.getQuotationList(true);
if (this.pageNum == 1) this.getQuotationList();
},
async getQuotationList () {
const { goodsName, shopMerchantId, pageNum, pageSize } = this
this.getList('getQuotationList',{
merchantIds: shopMerchantId,
pageNum,
pageSize,
goodsName,
orderStatus: 3,
await this.getList('getQuotationList', {
merchantIds: shopMerchantId,
pageNum,
pageSize,
goodsName,
orderStatus: 3,
})
if (pageNum == 1) uni.setStorageSync(`${shopMerchantId}-historyList`, thisuni.onGetWifiList())
if (pageNum == 1) uni.setStorageSync(`${shopMerchantId}-historyList`, this.list)
},
pageonReachBottom() {
pageonReachBottom () {
let { pageNum, total, isEnd, pageSize } = this
if (!isEnd) isEnd = false
if (Math.ceil(total / pageSize) > pageNum) {
this.pageNum += 1
this.getQuotationList()
} else this.isEnd = true
if (!isEnd) isEnd = false
if (Math.ceil(total / pageSize) > pageNum) {
this.pageNum += 1
this.getQuotationList()
} else this.isEnd = true
},
// 脱敏
nameHide(name) {
nameHide (name) {
return name.substring(0, 1) + '*';
},
accDiv(val) {
return utils.accDiv(val, 100)
accDiv (val) {
return utils.accDiv(val || 0, 100)
},
}
}
......@@ -169,19 +186,18 @@ export default {
z-index: 2;
}
.record-box {
height: 100%;
padding-top: 244rpx;
}
.card-list {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 48rpx;
padding: 0 64rpx 48rpx;
.card-item {
background-color: #F7F9FF;
background-color: #f7f9ff;
border-radius: 32rpx;
height: 372rpx;
box-sizing: border-box;
......@@ -193,14 +209,14 @@ export default {
.name {
font-weight: 500;
font-size: 32rpx;
color: #292D33;
color: #292d33;
}
.goods-name {
margin-top: 12rpx;
margin-bottom: 16rpx;
font-weight: 500;
font-size: 32rpx;
color: #2C66F7;
color: #2c66f7;
}
.card-info {
display: flex;
......@@ -211,7 +227,7 @@ export default {
}
.label {
font-size: 24rpx;
color: #999EA8;
color: #999ea8;
width: 136rpx;
}
.value {
......@@ -223,7 +239,7 @@ export default {
align-items: baseline;
font-weight: 500;
font-size: 32rpx;
color: #22AC38;
color: #22ac38;
.flag {
font-size: 24rpx;
}
......@@ -239,18 +255,18 @@ export default {
z-index: -1;
}
.gradient-overlay {
z-index: -1;
position: absolute;
top: 0;
right: 0;
width: 252rpx;
height: 372rpx;
background: linear-gradient(
to left,
rgba(247, 249, 255, 0) 0%,
rgba(247, 249, 255, 1) 100%
);
}
z-index: -1;
position: absolute;
top: 0;
right: 0;
width: 252rpx;
height: 372rpx;
background: linear-gradient(
to left,
rgba(247, 249, 255, 0) 0%,
rgba(247, 249, 255, 1) 100%
);
}
}
}
}
......
......@@ -9,7 +9,10 @@
@backHome="backHome"
@changeTab="changeTab"
>
<view class="module-box" slot="module">
<view
class="module-box"
slot="module"
>
<template v-for="(i, index) in moduleList">
<view
:key="index"
......@@ -44,10 +47,13 @@
/>
</template>
<template slot="content">
<novice-guide @nextStep="nextStep" @back="back" />
<novice-guide
@nextStep="nextStep"
@back="back"
/>
</template>
</home-frame>
<!--
<!--
<cover-view class="webview-container">
<web-view
@message="handlerMessage"
......@@ -66,7 +72,7 @@ import HomeFrame from "@/components/HomeFrame/index.vue";
export default {
// mixins: [storge],
components: { HomeFrame, detail, NoviceGuide },
data() {
data () {
return {
moduleList: [],
toolList: [],
......@@ -77,7 +83,7 @@ export default {
recording: false,
};
},
onBackPress(options) {
onBackPress (options) {
if (options.from === "backbutton") {
// 物理返回按钮触发
// 阻止默认行为,即不执行页面返回
......@@ -87,13 +93,13 @@ export default {
// 其他情况允许正常返回
return false;
},
onLoad() {
onLoad () {
const mock_data = uni.$storage.get("mock_data") || {};
this.moduleList = mock_data.moduleList || [];
this.toolList = mock_data.toolList || [];
this.get_Vehicle_Sales_Data();
},
onShow() {
onShow () {
const userInfo = uni.$storage.get("userInfo");
if (!userInfo.shopMerchantId || !userInfo.shopMerchantName) {
uni.$storage.rm("userInfo");
......@@ -107,12 +113,12 @@ export default {
},
methods: {
...mapMutations("audio", ["setReceptionStatus"]),
init() {
init () {
this.getSoure();
this.findPayInfo();
},
/**获取车型&销售数据 */
get_Vehicle_Sales_Data() {
get_Vehicle_Sales_Data () {
const userInfo = uni.$storage.get("userInfo"),
storageCarBrandList = uni.$storage.get("carBrandList"),
storageEmployeeList = uni.$storage.get("employeeList"),
......@@ -165,8 +171,8 @@ export default {
});
},
// 查询素材
async getSoure() {
const { moduleList, toolList } = await uni.$api.systemApi.getMockData(
async getSoure () {
let { moduleList, toolList } = await uni.$api.systemApi.getMockData(
true
);
await moduleList.map(async (e) => {
......@@ -181,14 +187,21 @@ export default {
"url"
);
});
toolList = await uni.$api.systemApi.imgToBase64(
toolList,
"shortTitleUrl"
);
this.moduleList = moduleList;
this.toolList = toolList;
uni.$api.systemApi.updateMockData(moduleList, "moduleList");
this.toolList = toolList
uni.$api.systemApi.updateMockData({
moduleList,
toolList
}, ["moduleList", 'toolList']);
},
errorImg(index) {
errorImg (index) {
this.moduleList[index].showAlt = true;
},
async start() {
async start () {
const result = await this.$permision.requestAndroidPermission(
"android.permission.RECORD_AUDIO"
);
......@@ -206,21 +219,21 @@ export default {
this.recording = true;
},
toDetail(item) {
toDetail (item) {
this.chooseItem = item;
this.$refs.home.previewRef.open();
},
cancel() {
cancel () {
this.$refs.home.previewRef.close();
},
preview() {
preview () {
let { id } = this.chooseItem;
this.type = "preview";
this.id = id;
this.cancel();
},
// 完成接待
done(e) {
done (e) {
this.$refs.home.finishRef.close();
if (this.recording) this.$refs.home.stopAudio();
this.recording = false;
......@@ -230,14 +243,14 @@ export default {
this.setReceptionStatus(e);
}, 1500);
},
back() {
back () {
const detailRef = this.$refs.detail
if(detailRef.showPayPage) return detailRef.showPayPage = false
if (detailRef.showPayPage) return detailRef.showPayPage = false
if (!this.id) return uni.navigateBack();
if (this.type != "preview") return this.$refs.home.finishRef.open();
this.backHome();
},
backHome() {
backHome () {
if (this.recording) this.$refs.home.stopAudio(true);
this.$refs.home.finishRef.close();
this.id = "";
......@@ -246,22 +259,22 @@ export default {
this.init();
this.recording = false;
},
nextStep() {
nextStep () {
let { id } = this.moduleList[0];
this.type = "preview";
this.id = id;
},
clearHistory() {
clearHistory () {
this.$store.dispatch("clearCustomerInfo");
this.$store.dispatch("clearHistory");
this.$refs.home.setBooks([]);
},
openStep() {
openStep () {
this.$refs.home.finishRef.close();
this.$refs.detail.open();
},
// 查询门店支付配置
async findPayInfo() {
async findPayInfo () {
const { shopMerchantId } = uni.$storage.get("userInfo");
const data = await uni.$api.commonApi.findPayInfo({
merchantId: shopMerchantId,
......@@ -285,7 +298,7 @@ export default {
});
this.$store.dispatch("setPaymentType", paymentType);
},
changeTab(index) {
changeTab (index) {
this.tabIndex = index;
if (index == 0) this.init();
},
......

9.68 KB | W: | H:

7.69 KB | W: | H:

static/144.png
static/144.png
static/144.png
static/144.png
  • 2-up
  • Swipe
  • Onion skin

3.75 KB | W: | H:

3.08 KB | W: | H:

static/72.png
static/72.png
static/72.png
static/72.png
  • 2-up
  • Swipe
  • Onion skin

5.62 KB | W: | H:

4.48 KB | W: | H:

static/96.png
static/96.png
static/96.png
static/96.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -65,15 +65,29 @@ function debounce(fn, timer) {
}, timer);
};
}
var throttle = function (fn, delay) {
var timer = null;
// var throttle = function (fn, delay) {
// var timer = null;
// return function () {
// var context = this,
// args = arguments;
// clearTimeout(timer);
// timer = setTimeout(function () {
// fn.apply(context, args);
// }, delay);
// };
// };
var throttle = function (func, limit) {
let inThrottle;
return function () {
var context = this,
args = arguments;
clearTimeout(timer);
timer = setTimeout(function () {
fn.apply(context, args);
}, delay);
const context = this;
const args = arguments;
if (!inThrottle) {
func.apply(context, args);
inThrottle = true;
setTimeout(function () {
inThrottle = false;
}, limit);
}
};
};
//检查是否有网络
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!