添加图标和页面
@@ -2,17 +2,44 @@
|
||||
"pages": [
|
||||
"pages/index/index",
|
||||
"pages/agreement/agreement",
|
||||
"pages/my/my"
|
||||
"pages/my/my",
|
||||
"pages/processEntry/processEntry"
|
||||
],
|
||||
"window": {
|
||||
"navigationBarTextStyle": "black",
|
||||
"navigationBarTitleText": "Weixin",
|
||||
"navigationBarTitleText": "易宝赞管理系统普惠版",
|
||||
"navigationBarBackgroundColor": "#ffffff"
|
||||
},
|
||||
"componentFramework": "glass-easel",
|
||||
"lazyCodeLoading": "requiredComponents",
|
||||
"usingComponents": {
|
||||
"page-plugin": "pages/components/page-plugin"
|
||||
"page-plugin": "pages/components/page-plugin",
|
||||
"t-button": "tdesign-miniprogram/button/button"
|
||||
},
|
||||
"tabBar": {
|
||||
"color": "#333333",
|
||||
"selectedColor": "#0052d9",
|
||||
"borderStyle": "black",
|
||||
"list": [
|
||||
{
|
||||
"iconPath": "assets/home.png",
|
||||
"selectedIconPath": "assets/home2.png",
|
||||
"pagePath": "pages/index/index",
|
||||
"text": "首页"
|
||||
},
|
||||
{
|
||||
"iconPath": "assets/scan.png",
|
||||
"selectedIconPath": "assets/scan2.png",
|
||||
"pagePath": "pages/processEntry/processEntry",
|
||||
"text": "扫码"
|
||||
},
|
||||
{
|
||||
"iconPath": "assets/user.png",
|
||||
"selectedIconPath": "assets/user2.png",
|
||||
"pagePath": "pages/my/my",
|
||||
"text": "我的"
|
||||
}
|
||||
]
|
||||
},
|
||||
"resolveAlias": {
|
||||
"@/*": "/*"
|
||||
|
||||
@@ -1,3 +1,14 @@
|
||||
button.t-button {
|
||||
font-weight: normal;
|
||||
margin-left: 0;
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
view.t-input {
|
||||
flex: none;
|
||||
padding: 12px;
|
||||
}
|
||||
|
||||
view.t-popup__close {
|
||||
padding: 6px;
|
||||
}
|
||||
|
||||
BIN
miniprogram/assets/home.png
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
miniprogram/assets/home2.png
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
miniprogram/assets/qrcode.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
miniprogram/assets/qrcode2.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
miniprogram/assets/scan.png
Normal file
|
After Width: | Height: | Size: 897 B |
BIN
miniprogram/assets/scan2.png
Normal file
|
After Width: | Height: | Size: 911 B |
BIN
miniprogram/assets/user.png
Normal file
|
After Width: | Height: | Size: 2.2 KiB |
BIN
miniprogram/assets/user2.png
Normal file
|
After Width: | Height: | Size: 2.2 KiB |
@@ -4,7 +4,7 @@ var __DEFINE__ = function(modId, func, req) { var m = { exports: {}, _tempexport
|
||||
var __REQUIRE__ = function(modId, source) { if(!__MODS__[modId]) return require(source); if(!__MODS__[modId].status) { var m = __MODS__[modId].m; m._exports = m._tempexports; var desp = Object.getOwnPropertyDescriptor(m, "exports"); if (desp && desp.configurable) Object.defineProperty(m, "exports", { set: function (val) { if(typeof val === "object" && val !== m._exports) { m._exports.__proto__ = val.__proto__; Object.keys(val).forEach(function (k) { m._exports[k] = val[k]; }); } m._tempexports = val }, get: function () { return m._tempexports; } }); __MODS__[modId].status = 1; __MODS__[modId].func(__MODS__[modId].req, m, m.exports); } return __MODS__[modId].m.exports; };
|
||||
var __REQUIRE_WILDCARD__ = function(obj) { if(obj && obj.__esModule) { return obj; } else { var newObj = {}; if(obj != null) { for(var k in obj) { if (Object.prototype.hasOwnProperty.call(obj, k)) newObj[k] = obj[k]; } } newObj.default = obj; return newObj; } };
|
||||
var __REQUIRE_DEFAULT__ = function(obj) { return obj && obj.__esModule ? obj.default : obj; };
|
||||
__DEFINE__(1764126506373, function(require, module, exports) {
|
||||
__DEFINE__(1766730266201, function(require, module, exports) {
|
||||
/*
|
||||
* big.js v7.0.1
|
||||
* A small, fast, easy-to-use library for arbitrary-precision decimal arithmetic.
|
||||
@@ -1052,7 +1052,7 @@ __DEFINE__(1764126506373, function(require, module, exports) {
|
||||
})(this);
|
||||
|
||||
}, function(modId) {var map = {}; return __REQUIRE__(map[modId], modId); })
|
||||
return __REQUIRE__(1764126506373);
|
||||
return __REQUIRE__(1766730266201);
|
||||
})()
|
||||
//miniprogram-npm-outsideDeps=[]
|
||||
//# sourceMappingURL=index.js.map
|
||||
@@ -6,7 +6,7 @@
|
||||
</block>
|
||||
<block wx:else>
|
||||
<!-- <loading_plugin wx:if="{{loading}}" /> -->
|
||||
<view style="padding: 0 16px;height: 90vh;justify-content: center;display: flex;flex-direction: column;">
|
||||
<view style="padding: 0 16px;height: 100vh;justify-content: center;display: flex;flex-direction: column;">
|
||||
<view style="display: flex;justify-content: center;">
|
||||
<view style="width: 80px;height: 80px;overflow: hidden;border-radius: 80px;">
|
||||
<image style="width: 100%;height: 100%;object-fit: cover;" src="{{avatarUrl}}" mode="cover"></image>
|
||||
|
||||
6
miniprogram/pages/components/popup-plugin/index.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"t-popup": "tdesign-miniprogram/popup/popup"
|
||||
}
|
||||
}
|
||||
31
miniprogram/pages/components/popup-plugin/index.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
// pages/components/popup-plugin/index.ts
|
||||
Component({
|
||||
/**
|
||||
* 组件的属性列表
|
||||
*/
|
||||
properties: {
|
||||
visible: null,
|
||||
placement: null,
|
||||
title: null,
|
||||
},
|
||||
|
||||
/**
|
||||
* 组件的初始数据
|
||||
*/
|
||||
data: {},
|
||||
|
||||
/**
|
||||
* 组件的方法列表
|
||||
*/
|
||||
methods: {
|
||||
onVisibleChange(e: any) {
|
||||
console.log(e.detail.visible);
|
||||
this.setData({
|
||||
open: e.detail.visible,
|
||||
});
|
||||
if (!e.detail.visible) {
|
||||
this.triggerEvent("close");
|
||||
}
|
||||
},
|
||||
},
|
||||
});
|
||||
8
miniprogram/pages/components/popup-plugin/index.wxml
Normal file
@@ -0,0 +1,8 @@
|
||||
<t-popup visible="{{visible}}" bind:visible-change="onVisibleChange" placement="{{placement || 'bottom'}}" close-btn>
|
||||
<view style="border-bottom: 1px solid #ddd;">
|
||||
<view style="padding: 12px 12px;">{{title}}</view>
|
||||
</view>
|
||||
<view style="max-height: 70vh;overflow: auto;">
|
||||
<slot></slot>
|
||||
</view>
|
||||
</t-popup>
|
||||
1
miniprogram/pages/components/popup-plugin/index.wxss
Normal file
@@ -0,0 +1 @@
|
||||
|
||||
432
miniprogram/pages/processEntry/processEntry.js
Normal file
@@ -0,0 +1,432 @@
|
||||
import { loginStatus, post } from "@/utils/https";
|
||||
import { formatTime, getAuthInfo, getDataSet, isArray, toArray, toObject } from "@/utils/util";
|
||||
import { voiceRequest } from "@/utils/voiceUtil";
|
||||
|
||||
/** 拼接符号 */
|
||||
const ProcessCodeConcatSymbol = "&&";
|
||||
/** 撤回码标记 */
|
||||
const RecallCodeMarking = "-";
|
||||
|
||||
/**
|
||||
* 解析流程码
|
||||
* @param {string} value
|
||||
*/
|
||||
const parseQrCode = (value) => {
|
||||
value = `${value || ""}`;
|
||||
const obj = {
|
||||
/** 工序码 */
|
||||
code: value,
|
||||
/** 提成自定义字段 */
|
||||
key: "",
|
||||
/** - => 撤回码 */
|
||||
type: "",
|
||||
};
|
||||
if (value.includes(ProcessCodeConcatSymbol)) {
|
||||
obj.code = value.substring(0, value.indexOf(ProcessCodeConcatSymbol));
|
||||
obj.key = value.substring(value.indexOf(ProcessCodeConcatSymbol) + ProcessCodeConcatSymbol.length);
|
||||
}
|
||||
|
||||
if (obj.code.includes(RecallCodeMarking)) {
|
||||
obj.type = RecallCodeMarking;
|
||||
obj.code = obj.code.replace(RecallCodeMarking, "");
|
||||
}
|
||||
|
||||
return obj;
|
||||
};
|
||||
|
||||
Page({
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
action: "end",
|
||||
processCodeMsg: "",
|
||||
rel_order_no: "",
|
||||
process_code: "",
|
||||
logsList: [],
|
||||
show: false,
|
||||
orders: [],
|
||||
isLogin: false,
|
||||
isScanCode: false,
|
||||
voice: true,
|
||||
loading: true,
|
||||
authInfo: {},
|
||||
hideTabKeys: [],
|
||||
processItems: [],
|
||||
backFlag: false,
|
||||
selectedProcessCode: "",
|
||||
result: "",
|
||||
logType: "0",
|
||||
/** 默认提成 */
|
||||
defaultBonus: true,
|
||||
showDefaultBonus: false,
|
||||
defaultBonusConfig: {},
|
||||
defaultBonusConfigKeys: [],
|
||||
rel_order_no_temp: "",
|
||||
},
|
||||
handleLogin(e) {
|
||||
if (e.detail) {
|
||||
this.setData({ isLogin: true, authInfo: getAuthInfo() });
|
||||
this.init();
|
||||
} else {
|
||||
this.setData({ isLogin: false });
|
||||
}
|
||||
},
|
||||
backChange(e) {
|
||||
this.data.backFlag = e.detail;
|
||||
this.setData({ backFlag: e.detail });
|
||||
wx.setStorageSync("processBackFlag", e.detail ? 1 : 0);
|
||||
if (this.data.selectedProcessCode) {
|
||||
const { code, key } = parseQrCode(this.data.selectedProcessCode);
|
||||
this.data.selectedProcessCode = `${code}${e.detail ? RecallCodeMarking : ""}`;
|
||||
if (key) {
|
||||
this.data.selectedProcessCode += `${ProcessCodeConcatSymbol}${key}`;
|
||||
}
|
||||
}
|
||||
this.getProcessName();
|
||||
},
|
||||
getProcessName() {
|
||||
if (this.data.selectedProcessCode) {
|
||||
const { code, type } = parseQrCode(this.data.selectedProcessCode);
|
||||
for (const ell of this.data.processItems) {
|
||||
if (ell.code == code) {
|
||||
this.setData({
|
||||
processCodeMsg: `工序名称:${ell.name || ""}(${ell.code})`,
|
||||
selectedProcessCode: this.data.selectedProcessCode,
|
||||
process_code: this.data.selectedProcessCode,
|
||||
action: type ? "back" : "end",
|
||||
});
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
processItemTap(e) {
|
||||
this.data.selectedProcessCode = e.currentTarget.dataset.code + (this.data.backFlag ? "-" : "");
|
||||
wx.setStorageSync("selectedProcessCode", this.data.selectedProcessCode);
|
||||
this.setData({
|
||||
selectedProcessCode: this.data.selectedProcessCode,
|
||||
});
|
||||
this.getProcessName();
|
||||
},
|
||||
getExecProcess() {
|
||||
post("Orders/getExecProcess1").then((res) => {
|
||||
this.data.processItems = toArray(res.data);
|
||||
if (this.data.processItems.length == 1) {
|
||||
this.data.selectedProcessCode = this.data.processItems[0].code;
|
||||
this.getProcessName();
|
||||
} else {
|
||||
this.getProcessName();
|
||||
}
|
||||
this.setData({
|
||||
processItems: this.data.processItems,
|
||||
});
|
||||
});
|
||||
},
|
||||
init() {
|
||||
const companyInfo = toObject(wx.getStorageSync("company_info"));
|
||||
const code = wx.getStorageSync("selectedProcessCode") || "";
|
||||
this.data.selectedProcessCode = code;
|
||||
this.data.process_code = code;
|
||||
this.data.backFlag = wx.getStorageSync("processBackFlag") == 1;
|
||||
const logType = wx.getStorageSync("processEntry_logType");
|
||||
|
||||
this.setData({
|
||||
hideTabKeys: companyInfo.staff_type == 3 ? ["2"] : [],
|
||||
backFlag: this.data.backFlag,
|
||||
selectedProcessCode: code,
|
||||
process_code: code,
|
||||
logType: logType || 0,
|
||||
});
|
||||
this.getExecProcess();
|
||||
},
|
||||
voiceChange(event) {
|
||||
this.setData({
|
||||
voice: event.detail,
|
||||
});
|
||||
wx.setStorageSync("processEntryVoice", `${event.detail}`);
|
||||
},
|
||||
getVoice(msg, cacheVoice) {
|
||||
if (this.data.voice && msg) {
|
||||
voiceRequest(msg, cacheVoice);
|
||||
}
|
||||
},
|
||||
onLogTypeChange(e) {
|
||||
const data = getDataSet(e);
|
||||
this.setData({ logType: data.key });
|
||||
wx.setStorageSync("processEntry_logType", data.key);
|
||||
},
|
||||
scanCode() {
|
||||
this.data.isScanCode = true;
|
||||
wx.scanCode({
|
||||
onlyFromCamera: true,
|
||||
scanType: ["qrCode"],
|
||||
success: (res) => {
|
||||
console.log(res);
|
||||
const qrcode = res.result || "";
|
||||
if (qrcode) {
|
||||
if (qrcode.startsWith("DD") || qrcode.startsWith("LC")) {
|
||||
if (this.data.process_code) {
|
||||
this.data.rel_order_no = qrcode;
|
||||
this.setData({
|
||||
rel_order_no: qrcode,
|
||||
});
|
||||
this.processEnter();
|
||||
} else {
|
||||
wx.showToast({
|
||||
title: "请扫流程码",
|
||||
icon: "none",
|
||||
});
|
||||
}
|
||||
} else {
|
||||
const code = parseQrCode(qrcode);
|
||||
this.setData({
|
||||
action: code.type == RecallCodeMarking ? "back" : "end",
|
||||
rel_order_no: "",
|
||||
});
|
||||
this.getProcess(qrcode);
|
||||
}
|
||||
}
|
||||
this.setData({
|
||||
msg: JSON.stringify(res),
|
||||
});
|
||||
},
|
||||
complete: () => {
|
||||
this.data.isScanCode = false;
|
||||
},
|
||||
});
|
||||
},
|
||||
getProcess(real_code) {
|
||||
const code = parseQrCode(real_code);
|
||||
post("CompanyProcess/processChildList", {
|
||||
curr_page: 1,
|
||||
page_count: 1,
|
||||
real_code: code.code,
|
||||
})
|
||||
.then((res) => {
|
||||
const data = res.data;
|
||||
if (Array.isArray(res.data) && data.length) {
|
||||
this.setData({
|
||||
processCodeMsg: `工序名称:${data[0].name || ""}(${real_code})`,
|
||||
process_code: real_code,
|
||||
selectedProcessCode: real_code,
|
||||
});
|
||||
this.getVoice(`${data[0].name}工序`, true);
|
||||
wx.showToast({
|
||||
title: "请扫订单二维码",
|
||||
icon: "none",
|
||||
});
|
||||
} else {
|
||||
this.addMsg("未找到 " + real_code + " 工序");
|
||||
wx.showToast({
|
||||
title: "未找到该工序",
|
||||
icon: "error",
|
||||
});
|
||||
this.getVoice(`未找到工序`, true);
|
||||
}
|
||||
})
|
||||
.catch((res) => {
|
||||
this.addMsg("未找到 " + real_code + " 工序");
|
||||
wx.showToast({
|
||||
title: "未找到该工序",
|
||||
icon: "error",
|
||||
});
|
||||
});
|
||||
},
|
||||
processEnter() {
|
||||
if (this.data.rel_order_no && this.data.process_code) {
|
||||
this.data.rel_order_no_temp = this.data.rel_order_no;
|
||||
this.setProcess();
|
||||
}
|
||||
},
|
||||
LCProcessEnter(e) {
|
||||
const item = this.data.orders[e.currentTarget.dataset.index];
|
||||
this.data.rel_order_no_temp = item.rel_order_no;
|
||||
this.setProcess();
|
||||
},
|
||||
setProcess(other) {
|
||||
const code = parseQrCode(this.data.process_code);
|
||||
const obj = {};
|
||||
if (code.key) {
|
||||
obj[this.data.rel_order_no_temp] = code.key;
|
||||
}
|
||||
post("Orders/setProcess", {
|
||||
param: JSON.stringify({
|
||||
rel_order_no: this.data.rel_order_no_temp,
|
||||
process_code: code.code,
|
||||
action: this.data.action,
|
||||
if_scan: 1,
|
||||
same_process: this.data.rel_order_no_temp.startsWith("LC") ? 1 : undefined,
|
||||
// defaultBonus: getDefaultBonus() != "0",
|
||||
}),
|
||||
other: JSON.stringify({ ...other, ...obj }),
|
||||
})
|
||||
.then((res) => {
|
||||
if (res.bonus == 1) {
|
||||
const data = toObject(res.data);
|
||||
this.setData({
|
||||
defaultBonusConfig: data,
|
||||
defaultBonusConfigKeys: Object.keys(data),
|
||||
showDefaultBonus: true,
|
||||
});
|
||||
} else if (isArray(res.data) && res.data.length) {
|
||||
res.data.forEach((el) => {
|
||||
el.product_info_str = toArray(el.product_info)
|
||||
.map((ell) => {
|
||||
return `${ell.room_name || "未命名"}(${ell.goods_name || "未命名"})`;
|
||||
})
|
||||
.join(",");
|
||||
|
||||
el.sale_info_str = toArray(el.sale_info)
|
||||
.map((ell) => {
|
||||
return `${ell.goods_name}`;
|
||||
})
|
||||
.join(",");
|
||||
});
|
||||
|
||||
this.setData({
|
||||
show: true,
|
||||
orders: res.data,
|
||||
});
|
||||
} else {
|
||||
this.addMsg(res.err_msg);
|
||||
// this.getVoice(res.err_msg);
|
||||
this.getVoice("通过");
|
||||
this.setData({
|
||||
show: false,
|
||||
result: "success",
|
||||
showDefaultBonus: false,
|
||||
});
|
||||
wx.showToast({
|
||||
title: res.err_msg,
|
||||
icon: "none",
|
||||
});
|
||||
}
|
||||
})
|
||||
.catch((res) => {
|
||||
this.addMsg(res.err_msg);
|
||||
if (res.err_code == "244269") {
|
||||
this.setData({
|
||||
result: "success",
|
||||
});
|
||||
wx.showToast({
|
||||
title: res.err_msg,
|
||||
icon: "none",
|
||||
});
|
||||
this.getVoice("通过");
|
||||
} else {
|
||||
this.setData({
|
||||
result: "error",
|
||||
});
|
||||
this.getVoice(res.err_msg);
|
||||
}
|
||||
});
|
||||
},
|
||||
onSelectBonus(e) {
|
||||
const data = getDataSet(e);
|
||||
this.setProcess({ [data.order_no]: data.key });
|
||||
},
|
||||
closeDefaultBonusHandle() {
|
||||
this.setData({
|
||||
showDefaultBonus: false,
|
||||
});
|
||||
},
|
||||
// defaultBonusChange(e) {
|
||||
// this.setData({
|
||||
// defaultBonus: e.detail ? "1" : "0",
|
||||
// });
|
||||
// setDefaultBonus(e.detail ? "1" : "0");
|
||||
// },
|
||||
addMsg(msg) {
|
||||
const now = new Date();
|
||||
this.data.logsList.unshift({
|
||||
date: formatTime(now).substring(5),
|
||||
msg: msg || "",
|
||||
});
|
||||
if (this.data.logsList.length > 100) {
|
||||
this.data.logsList.length = 100;
|
||||
}
|
||||
this.setData({
|
||||
logsList: this.data.logsList,
|
||||
});
|
||||
},
|
||||
clearMsg() {
|
||||
this.setData({
|
||||
logsList: [],
|
||||
});
|
||||
},
|
||||
show() {
|
||||
this.setData({
|
||||
show: true,
|
||||
});
|
||||
},
|
||||
onClose() {
|
||||
this.setData({
|
||||
show: false,
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {
|
||||
this.setData({
|
||||
loading: true,
|
||||
voice: wx.getStorageSync("processEntryVoice") == "false" ? false : true,
|
||||
});
|
||||
loginStatus()
|
||||
.then((res) => {
|
||||
this.setData({
|
||||
isLogin: true,
|
||||
loading: false,
|
||||
authInfo: getAuthInfo(),
|
||||
});
|
||||
this.init();
|
||||
})
|
||||
.catch((err) => {
|
||||
this.setData({ isLogin: false, loading: false });
|
||||
console.log("调用登录状态请求失败", err);
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady() {},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow() {
|
||||
wx.hideHomeButton();
|
||||
this.setData({
|
||||
// defaultBonus: getDefaultBonus() != "0",
|
||||
});
|
||||
// if (!this.data.isScanCode) {
|
||||
// }
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide() {},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload() {},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh() {},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom() {},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
onShareAppMessage() {},
|
||||
});
|
||||
9
miniprogram/pages/processEntry/processEntry.json
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"navigationBarTitleText": "录入流程",
|
||||
"usingComponents": {
|
||||
"t-input": "tdesign-miniprogram/input/input",
|
||||
"t-checkbox": "tdesign-miniprogram/checkbox/checkbox",
|
||||
"t-icon": "tdesign-miniprogram/icon/icon",
|
||||
"popup-plugin": "/pages/components/popup-plugin/index"
|
||||
}
|
||||
}
|
||||
111
miniprogram/pages/processEntry/processEntry.wxml
Normal file
@@ -0,0 +1,111 @@
|
||||
<page-plugin is-login="{{isLogin}}" is-auth="{{authInfo['SF_ENTER_PROCESS']}}" loading="{{loading}}"
|
||||
bind:handleLogin="handleLogin" style="padding: 0;">
|
||||
<view class="container">
|
||||
<view style="display: flex;padding: 12px 12px 4px 12px;">
|
||||
<view style="display: flex;flex-shrink: 0;flex-direction: column;margin-right: 12px;align-items: flex-end;">
|
||||
<view style="margin-bottom: 4px;font-weight: bold;">工序:</view>
|
||||
<view>
|
||||
<t-checkbox style="padding: 0;" value="{{ backFlag }}" bind:change="backChange">撤回</t-checkbox>
|
||||
</view>
|
||||
</view>
|
||||
<view style="display: flex;flex-wrap: wrap;min-height: 44px;max-height: 88px;overflow: auto;flex: 1;">
|
||||
<view wx:if="{{processItems.length == 0}}"
|
||||
style="display: flex;justify-content: center;height: 100%;width: 100%;align-items: center;color: #999;">暂无工序
|
||||
</view>
|
||||
<block wx:for="{{processItems}}" wx:key="process_id">
|
||||
<view
|
||||
class="process-item {{item.code == selectedProcessCode || (item.code + '-') == selectedProcessCode ? 'active': ''}}"
|
||||
bind:tap="processItemTap" data-code="{{item.code}}">{{item.name}}</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
<t-input label="订单编号" value="{{rel_order_no}}" readonly placeholder="扫码流程编码, 订单编号" />
|
||||
<t-input label="流程编码" readonly value="{{process_code}}" />
|
||||
|
||||
|
||||
<view wx:if="{{processCodeMsg}}" style="padding: 8px 12px 0 12px;color: {{action == 'end'? '#52c41a': '#ff4d4f'}};">
|
||||
{{processCodeMsg}}
|
||||
</view>
|
||||
<view style="padding: 12px;padding-top: 0;">
|
||||
<view style="display: flex;justify-content: center;margin-top: 12px;align-items: center;column-gap: 16px;">
|
||||
<t-button theme="primary" bind:tap="scanCode" icon="qr">扫码</t-button>
|
||||
<t-button theme="primary" disabled="{{!(rel_order_no && process_code)}}" bind:tap="processEnter">录入流程</t-button>
|
||||
<!-- <view style="width: 16px;"></view> -->
|
||||
<!-- <van-checkbox value="{{voice}}" bind:change="voiceChange">语音播报</van-checkbox> -->
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="log-header">
|
||||
<!-- <text>扫码记录</text> -->
|
||||
<text bind:tap="addMsg2">扫码结果</text>
|
||||
<view>
|
||||
<t-button size="extra-small" theme="{{logType == '0' ? 'primary' :'default'}}" bind:tap="onLogTypeChange"
|
||||
data-key="0">图标</t-button>
|
||||
<t-button size="extra-small" theme="{{logType == '1' ? 'primary' :'default'}}" bind:tap="onLogTypeChange"
|
||||
data-key="1">记录</t-button>
|
||||
</view>
|
||||
<!-- <t-button size="extra-small" theme="primary" bind:tap="clearMsg">清空</t-button> -->
|
||||
</view>
|
||||
<view wx:if="{{logType == 0}}" class="log-box"
|
||||
style="display: flex;justify-content: center;align-items: center;font-size: 65vw;">
|
||||
<!-- <view wx:for="{{logsList}}" wx:for-item="item" wx:key="date" style="font-size: 14px;word-break: break-all;margin-bottom: 8px;width: 100%;align-items: flex-start;">
|
||||
{{item.date}}
|
||||
{{item.msg}}
|
||||
</view> -->
|
||||
<t-icon wx:if="{{result == 'success'}}" name="check" style="color: #07c160;" />
|
||||
<t-icon wx:elif="{{result == 'error'}}" name="close" style="color: #ee0a24;" />
|
||||
|
||||
</view>
|
||||
<view wx:else class="log-box">
|
||||
<view wx:for="{{logsList}}" wx:for-item="item" wx:key="date"
|
||||
style="word-break: break-all;margin-bottom: 8px;width: 100%;align-items: flex-start;">
|
||||
<text style="color: #666;margin-right: 4px;">{{item.date}}</text>
|
||||
{{item.msg}}
|
||||
</view>
|
||||
</view>
|
||||
<popup-plugin visible="{{ show }}" round bind:close="onClose" title="订单流程完成">
|
||||
<!-- <view wx:for="{{orders}}" wx:key="rel_order_no"
|
||||
style="border: 1rpx solid #ddd;border-radius: 4px;display: flex;flex-direction: column;margin-bottom: 12px;">
|
||||
<view style="padding: 8px;">
|
||||
<list-item label="流程单号" value="{{item.rel_order_no}}" />
|
||||
<list-item label="流程名称" value="{{item.p_process_name}}" />
|
||||
<list-item label="自定义名称" wx:if="{{item.process_custom_no}}" value="{{item.process_custom_no}}" />
|
||||
<list-item label="工序名称" value="{{item.c_process_name}}" />
|
||||
<list-item label="材料名称" wx:if="{{item.sale_info_str}}" value="{{item.sale_info_str}}" />
|
||||
<list-item wx:if="{{item.product_info_str}}" label="房柜名称" value="{{item.product_info_str}}" />
|
||||
<list-item label="状态" value="{{item.state== 2 ? '已完成' :''}}" />
|
||||
</view>
|
||||
<view style="display: flex;border-top: 1rpx solid #ddd;padding: 8px;justify-content: center;">
|
||||
<block wx:if="{{action == 'end'}}">
|
||||
<t-button size='small' type="primary" data-index="{{index}}" bind:tap="LCProcessEnter">完成</t-button>
|
||||
</block>
|
||||
<block wx:else>
|
||||
<t-button size='small' type="danger" data-index="{{index}}" bind:tap="LCProcessEnter">撤回</t-button>
|
||||
</block>
|
||||
</view>
|
||||
</view> -->
|
||||
</popup-plugin>
|
||||
|
||||
<!-- <popup-plugin show="{{ showDefaultBonus }}" bind:close="closeDefaultBonusHandle" title="选择提成配置">
|
||||
<view class="table">
|
||||
<view class="tr">
|
||||
<view class="th">自定义字段</view>
|
||||
<view class="th">提成编码</view>
|
||||
|
||||
<view class="th" style="width: 80px;">操作</view>
|
||||
</view>
|
||||
<block wx:for="{{defaultBonusConfigKeys}}" wx:key="index" wx:for-item="key">
|
||||
<view wx:for="{{defaultBonusConfig[key]}}" class="tr" wx:key="key">
|
||||
<view class="td">{{item.key}}</view>
|
||||
<view class="td">{{item.bonus_code}}</view>
|
||||
|
||||
<view class="td">
|
||||
<t-button size="small" type="primary" data-order_no="{{key}}" data-key="{{item.bonus_code}}"
|
||||
bind:tap="onSelectBonus">选择</t-button>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</popup-plugin> -->
|
||||
</view>
|
||||
</page-plugin>
|
||||
50
miniprogram/pages/processEntry/processEntry.wxss
Normal file
@@ -0,0 +1,50 @@
|
||||
.log-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding: 8px 12px;
|
||||
border: 1rpx solid #ddd;
|
||||
align-items: center;
|
||||
margin-left: 12px;
|
||||
margin-right: 12px;
|
||||
}
|
||||
|
||||
.log-box {
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
overflow: auto;
|
||||
padding: 12px 12px 12px 12px;
|
||||
border: 1rpx solid #ddd;
|
||||
margin-left: 12px;
|
||||
margin-right: 12px;
|
||||
/* margin-bottom: calc(constant(safe-area-inset-bottom) + 12px); */
|
||||
/*兼容 IOS<11.2*/
|
||||
/* margin-bottom: calc(env(safe-area-inset-bottom) + 12px); */
|
||||
margin-bottom: 12px;
|
||||
border-top: none;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: calc(100vh - 50px);
|
||||
/* height: calc(100vh - 50px - env(safe-area-inset-bottom)); */
|
||||
}
|
||||
|
||||
.process-item {
|
||||
height: 34px;
|
||||
padding: 0 8px;
|
||||
border: 1rpx solid #ddd;
|
||||
border-radius: 4px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-right: 8px;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.process-item.active {
|
||||
background: #1989fa;
|
||||
border-color: #1989fa;
|
||||
color: #fff;
|
||||
}
|
||||
@@ -8,7 +8,7 @@ export const defaultAvatarUrl =
|
||||
"https://mmbiz.qpic.cn/mmbiz/icTdbqWNOwNRna42FI242Lcia07jQodd2FJGIYQfG0LAJGFxM4FbnQP6yfMxBgJ0F3YRqJCJ1aPAK2dQagdusBZg/0";
|
||||
|
||||
export const base = {
|
||||
appletName: "易宝赞数据化管理系统",
|
||||
appletName: "易宝赞管理系统普惠版",
|
||||
apiHost:
|
||||
wx.getAccountInfoSync().miniProgram.envVersion == "release"
|
||||
? "https://ebaozan.com/api/"
|
||||
|
||||
75
miniprogram/utils/voiceUtil.js
Normal file
@@ -0,0 +1,75 @@
|
||||
import { post, urlAddBaseUrl } from "./https";
|
||||
|
||||
const playVoice = (src, text) => {
|
||||
const innerAudioContext = wx.createInnerAudioContext({
|
||||
useWebAudioImplement: true,
|
||||
});
|
||||
innerAudioContext.src = src;
|
||||
innerAudioContext.play();
|
||||
innerAudioContext.onError(() => {
|
||||
innerAudioContext.destroy();
|
||||
console.log("Audio Error");
|
||||
// wx.removeStorageSync(text);
|
||||
});
|
||||
innerAudioContext.onEnded(() => {
|
||||
innerAudioContext.destroy();
|
||||
console.log("Audio End");
|
||||
});
|
||||
};
|
||||
|
||||
export const voiceRequest = (text, cacheVoice) => {
|
||||
// if (cacheVoice) {
|
||||
// const data = wx.getStorageSync(text);
|
||||
// console.log(data);
|
||||
// if (data) {
|
||||
// console.log("有 base64");
|
||||
// const fs = wx.getFileSystemManager();
|
||||
// //随机定义路径名称
|
||||
// var times = new Date().getTime();
|
||||
// var codeimg = wx.env.USER_DATA_PATH + "/" + times + ".mp3";
|
||||
// //将base64图片写入
|
||||
// fs.writeFile({
|
||||
// filePath: codeimg,
|
||||
// data: data,
|
||||
// encoding: "base64",
|
||||
// success: (res) => {
|
||||
// console.log(res);
|
||||
// playVoice(codeimg, text);
|
||||
// },
|
||||
// fail: (res) => {
|
||||
// console.log(res);
|
||||
// },
|
||||
// });
|
||||
// return;
|
||||
// }
|
||||
// }
|
||||
post(
|
||||
"/Tools/voice",
|
||||
{
|
||||
txt: text,
|
||||
per: 3,
|
||||
spd: 5,
|
||||
pit: 5,
|
||||
vol: 9,
|
||||
},
|
||||
{ showLoading: false }
|
||||
).then((res) => {
|
||||
if (res.err_code == 0) {
|
||||
playVoice(urlAddBaseUrl(res.data), text);
|
||||
// if (cacheVoice) {
|
||||
// wx.request({
|
||||
// url: urlAddBaseUrl(res.data),
|
||||
// responseType: "arraybuffer",
|
||||
// success(res) {
|
||||
// const base64 = base64js.fromByteArray(new Uint8Array(res.data));
|
||||
// try {
|
||||
// wx.setStorageSync(text, base64);
|
||||
// } catch (_) {
|
||||
// console.log("缓存错误");
|
||||
// }
|
||||
// },
|
||||
// });
|
||||
// }
|
||||
}
|
||||
});
|
||||
};
|
||||