update 更新进件信息
This commit is contained in:
parent
6a185803c5
commit
ea9f0fe7ee
@ -4,23 +4,24 @@
|
||||
"version" : "0.0",
|
||||
"configurations" : [
|
||||
{
|
||||
"app-plus" :
|
||||
{
|
||||
"launchtype" : "local"
|
||||
},
|
||||
"default" :
|
||||
{
|
||||
"launchtype" : "local"
|
||||
},
|
||||
"mp-weixin" :
|
||||
{
|
||||
"launchtype" : "local"
|
||||
},
|
||||
"type" : "uniCloud"
|
||||
"app-plus" : {
|
||||
"launchtype" : "local"
|
||||
},
|
||||
"default" : {
|
||||
"launchtype" : "local"
|
||||
},
|
||||
"mp-weixin" : {
|
||||
"launchtype" : "local"
|
||||
},
|
||||
"type" : "uniCloud"
|
||||
},
|
||||
{
|
||||
"playground" : "standard",
|
||||
"type" : "uni-app:app-android"
|
||||
},
|
||||
{
|
||||
"playground" : "standard",
|
||||
"type" : "uni-app:app-ios"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@ -3,6 +3,7 @@
|
||||
import APPUpdate, { getCurrentNo } from "@/config/appUpdate";
|
||||
// #endif
|
||||
import { mapState, mapActions } from "vuex";
|
||||
import GtPush from "@/utils/gtpush-min.js";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
@ -21,6 +22,39 @@ export default {
|
||||
this.onAPPUpdate();
|
||||
}
|
||||
|
||||
// plus.push.addEventListener("click", function (msg) {
|
||||
// if (permision.isIOS) {
|
||||
// console.log("ios:click收到" + JSON.parse(JSON.stringify(msg)).payload);
|
||||
// var obj = JSON.parse(JSON.stringify(msg)).payload;
|
||||
// that.toPushMessagePage(obj.data ? obj.data : obj);
|
||||
// } else {
|
||||
// console.log("安卓:click收到" + JSON.parse(JSON.stringify(msg)));
|
||||
// var obj = JSON.parse(JSON.stringify(msg)).payload;
|
||||
// that.toPushMessagePage(obj.data ? obj.data : obj);
|
||||
// }
|
||||
// });
|
||||
// plus.push.addEventListener("receive", (message) => {
|
||||
// console.log("receive收到");
|
||||
// //收到透传消息,执行该事件
|
||||
// let payload = message.payload; //自定义内容获取
|
||||
// let text = message.payload.text;
|
||||
|
||||
// if (permision.isIOS) {
|
||||
// console.log("ios:receive收到");
|
||||
// let payload = message.payload; //自定义内容获取
|
||||
// let text = message.content;
|
||||
// that.createLocalMessage(text, payload);
|
||||
// } else {
|
||||
// console.log("安卓收到");
|
||||
// that.toPushMessagePage(payload);
|
||||
// }
|
||||
// });
|
||||
|
||||
this.initAppOrderPush();
|
||||
// #endif
|
||||
|
||||
// #ifdef H5
|
||||
this.initH5OrderPush();
|
||||
// #endif
|
||||
},
|
||||
computed: {
|
||||
@ -40,6 +74,124 @@ export default {
|
||||
onAPPUpdate() {
|
||||
APPUpdate(this.version);
|
||||
},
|
||||
getCidAsync() {
|
||||
return new Promise(function (resolve, reject) {
|
||||
// 获取客户端推送信息
|
||||
plus.push.getClientInfoAsync(
|
||||
function (clientInfo) {
|
||||
// 获取CID
|
||||
var cid = clientInfo.clientid;
|
||||
// 调用resolve方法返回CID
|
||||
resolve(cid);
|
||||
},
|
||||
function (error) {
|
||||
// 获取CID失败,调用reject方法返回错误信息
|
||||
reject(error);
|
||||
}
|
||||
);
|
||||
});
|
||||
},
|
||||
|
||||
initH5OrderPush() {
|
||||
let _this = this;
|
||||
GtPush.setDebugMode(true);
|
||||
GtPush.init({
|
||||
appid: "KXgzOaKSzd5HG3p9IPaVa8",
|
||||
onClientId: (res) => {
|
||||
console.log("onClientId = " + res.cid);
|
||||
_this.cid = res.cid;
|
||||
},
|
||||
onlineState: (res) => {
|
||||
console.log("onlineState = " + res.online);
|
||||
_this.online = res.online;
|
||||
},
|
||||
onPushMsg: (res) => {
|
||||
console.log("onPushMsg = " + res.message);
|
||||
debugger;
|
||||
_this.messages += "onPushMsg: " + res.message + "\n";
|
||||
},
|
||||
onError: (res) => {
|
||||
_this.messages += "onError: " + res.error + "\n";
|
||||
},
|
||||
});
|
||||
},
|
||||
async initAppOrderPush() {
|
||||
var pinf = plus.push.getClientInfo();
|
||||
var cid = pinf.clientid; //客户端标识
|
||||
|
||||
console.log("当前机子CID:", cid);
|
||||
|
||||
plus.push.getClientInfoAsync((info) => {
|
||||
let cid = info["clientid"];
|
||||
console.log("当前机子CID:", cid);
|
||||
});
|
||||
|
||||
let res = await this.getCidAsync();
|
||||
console.log("getCidAsync", res);
|
||||
|
||||
uni.setClipboardData({
|
||||
data: cid, // 需要复制的内容
|
||||
success: () => {
|
||||
// 成功提示框显示 1 秒钟
|
||||
uni.showToast({
|
||||
title: "复制成功",
|
||||
icon: "success",
|
||||
duration: 1000,
|
||||
});
|
||||
},
|
||||
fail: () => {
|
||||
// 失败提示框显示 1 秒钟
|
||||
uni.showToast({
|
||||
title: "复制失败,请重试",
|
||||
icon: "none",
|
||||
duration: 1000,
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
uni.showToast({
|
||||
title: cid,
|
||||
icon: "success",
|
||||
duration: 20000,
|
||||
});
|
||||
|
||||
const _self = this;
|
||||
//监听系统通知栏消息点击事件
|
||||
plus.push.addEventListener(
|
||||
"click",
|
||||
function (message) {
|
||||
//处理点击消息的业务逻辑代码
|
||||
console.log(message);
|
||||
plus.nativeUI.toast("click:" + JSON.stringify(message));
|
||||
//plus.nativeUI.toast('push click');
|
||||
_self._handlePush(message);
|
||||
uni.showToast({
|
||||
title: message,
|
||||
icon: "none",
|
||||
duration: 1000,
|
||||
});
|
||||
},
|
||||
false
|
||||
);
|
||||
|
||||
//监听接收透传消息事件
|
||||
plus.push.addEventListener(
|
||||
"receive",
|
||||
function (message) {
|
||||
console.log(message);
|
||||
plus.nativeUI.toast("receive:" + JSON.stringify(message));
|
||||
//处理透传消息的业务逻辑代码
|
||||
//plus.nativeUI.toast('push receive');
|
||||
_self._handlePush(message);
|
||||
uni.showToast({
|
||||
title: message,
|
||||
icon: "none",
|
||||
duration: 1000,
|
||||
});
|
||||
},
|
||||
false
|
||||
);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
@ -63,20 +63,3 @@ export function GetOrderList(params) {
|
||||
// }).catch(e => reject(console.warn(e)))
|
||||
// })
|
||||
// }
|
||||
|
||||
/**
|
||||
* 获取订单个推
|
||||
* @author Seven
|
||||
* @data 2025-3-28
|
||||
* @param channel
|
||||
* @returns { cid:f9da7081a7951cff6d7f1d4e2d2f270b }
|
||||
* @see https://mall.gpxscs.cn/api/mobile/account/login/push/testcase
|
||||
*/
|
||||
|
||||
export function GetOrderPush(params) {
|
||||
return http({
|
||||
url: "/account/login/push/testcase",
|
||||
method: "post",
|
||||
data: params,
|
||||
});
|
||||
}
|
||||
|
||||
@ -5,8 +5,6 @@ import uView from "@/uni_modules/uview-ui";
|
||||
import "./uni.promisify.adaptor";
|
||||
import tui from "./utils/httpRequest";
|
||||
import Socket from "./utils/socket.js";
|
||||
// import Utils from './utils/http'
|
||||
// import "@/static/font/iconfont.css"
|
||||
|
||||
Vue.use(uView);
|
||||
|
||||
|
||||
@ -23,7 +23,8 @@
|
||||
"Camera" : {},
|
||||
"Record" : {},
|
||||
"VideoPlayer" : {},
|
||||
"UIWebview" : {}
|
||||
"UIWebview" : {},
|
||||
"Push" : {}
|
||||
},
|
||||
/* 应用发布信息 */
|
||||
"distribute" : {
|
||||
@ -63,7 +64,23 @@
|
||||
/* SDK配置 */
|
||||
"sdkConfigs" : {
|
||||
"maps" : {},
|
||||
"push" : {}
|
||||
"push" : {
|
||||
"unipush" : {
|
||||
"offline" : true,
|
||||
"fcm" : {},
|
||||
"honor" : {},
|
||||
"meizu" : {},
|
||||
"mi" : {},
|
||||
"vivo" : {},
|
||||
"oppo" : {},
|
||||
"hms" : {}
|
||||
},
|
||||
"igexin" : {
|
||||
"appid" : "KXgzOaKSzd5HG3p9IPaVa8",
|
||||
"appkey" : "neXXX9r1Tc7gMxN2PIcHA1",
|
||||
"appsecret" : "aQQys9eufd8KHH1Y0kfQm6"
|
||||
}
|
||||
}
|
||||
},
|
||||
"icons" : {
|
||||
"android" : {
|
||||
@ -96,6 +113,9 @@
|
||||
"spotlight@3x" : "unpackage/res/icons/120x120.png"
|
||||
}
|
||||
}
|
||||
},
|
||||
"splashscreen" : {
|
||||
"androidStyle" : "common"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@ -59,6 +59,12 @@
|
||||
"navigationBarTitleText": "填写地区信息"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/audit/contractSigning",
|
||||
"style": {
|
||||
"navigationBarTitleText": "合同签署"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/agreement/agreement",
|
||||
"style": {
|
||||
|
||||
@ -53,7 +53,13 @@
|
||||
拒绝原因:{{ auditInfo.approval_remark }}
|
||||
</view>
|
||||
</view>
|
||||
<view class="" v-if="[3, 5].includes(auditInfo.approval_status)">
|
||||
<view
|
||||
class=""
|
||||
v-if="
|
||||
[3, 5].includes(auditInfo.approval_status) &&
|
||||
!auditInfo.lkl_ec_result_url
|
||||
"
|
||||
>
|
||||
<view class="img-await"></view>
|
||||
<view class="tips">审核中,1-7个工作日内答复,请耐心等待</view>
|
||||
</view>
|
||||
@ -61,6 +67,30 @@
|
||||
<view class="img-no-audit"></view>
|
||||
<view class="tips">暂无申请记录!</view>
|
||||
</view>
|
||||
<view
|
||||
class=""
|
||||
v-if="auditInfo.has_ec_signed == 2 && auditInfo.lkl_ec_result_url"
|
||||
>
|
||||
<view class="img-pass-audit"></view>
|
||||
<view class="tips">申请通过:请在24小时内签署合同,过期会失效!</view>
|
||||
</view>
|
||||
<view
|
||||
class=""
|
||||
v-if="auditInfo.has_apply_mer == 1 && auditInfo.has_ec_signed == 1"
|
||||
>
|
||||
<view class="img-pass-audit"></view>
|
||||
<view class="tips">店铺初始化中,请耐心等待。</view>
|
||||
</view>
|
||||
<view
|
||||
class=""
|
||||
v-if="
|
||||
(auditInfo.has_ec_signed == 1 && auditInfo.has_apply_mer == 2) ||
|
||||
auditInfo.approval_status == 21
|
||||
"
|
||||
>
|
||||
<view class="img"></view>
|
||||
<view class="tips">进件失败,需要管理员处理</view>
|
||||
</view>
|
||||
<view class="time" v-if="auditInfo.approval_status != 4">
|
||||
申请时间:{{ auditInfo.created_at }}
|
||||
</view>
|
||||
@ -215,7 +245,7 @@
|
||||
></u-datetime-picker>
|
||||
<view
|
||||
class="contract-content"
|
||||
v-if="auditInfo.has_ec_signed == 2 && auditInfo.has_apply_mer == 1"
|
||||
v-if="auditInfo.has_ec_signed == 2 && auditInfo.lkl_ec_result_url"
|
||||
>
|
||||
<view class="contract-tips">您还没有签署,请签署</view>
|
||||
<u-button class="btn-submit" @click="skipuContract">立即签署</u-button>
|
||||
@ -373,6 +403,7 @@ export default {
|
||||
approval_remark: "",
|
||||
approval_invalid_col: [],
|
||||
};
|
||||
this.auditInfo.has_apply_mer = 2;
|
||||
|
||||
if (!res.data) {
|
||||
this.showLoading = false;
|
||||
@ -669,8 +700,14 @@ export default {
|
||||
let validity = ocr.validity.split("-");
|
||||
this.startTime = validity[0];
|
||||
this.endTime = validity[1];
|
||||
this.form.individual_id_period_begin = this.startTime;
|
||||
this.form.individual_id_period_end = this.endTime;
|
||||
this.form.individual_id_period_begin = this.startTime.replace(
|
||||
/\./g,
|
||||
"-"
|
||||
);
|
||||
this.form.individual_id_period_end = this.endTime.replace(
|
||||
/\./g,
|
||||
"-"
|
||||
);
|
||||
}
|
||||
break;
|
||||
// 银行
|
||||
@ -1042,7 +1079,11 @@ export default {
|
||||
}
|
||||
}
|
||||
},
|
||||
skipuContract() {},
|
||||
skipuContract() {
|
||||
uni.navigateTo({
|
||||
url: `/pages/audit/contractSigning?url=${this.auditInfo.lkl_ec_result_url}`,
|
||||
});
|
||||
},
|
||||
loginOut() {
|
||||
this.$store.dispatch("user/LoginOut");
|
||||
},
|
||||
@ -1104,6 +1145,16 @@ export default {
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
|
||||
.img-pass-audit {
|
||||
margin: 0 auto;
|
||||
margin-top: 17%;
|
||||
margin-bottom: 20%;
|
||||
width: 400rpx;
|
||||
height: 400rpx;
|
||||
background-image: url("../../static/pass.png");
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
|
||||
.tips {
|
||||
margin-bottom: 24rpx;
|
||||
text-align: center;
|
||||
|
||||
56
java-mall-app-shop-admin/pages/audit/contractSigning.vue
Normal file
56
java-mall-app-shop-admin/pages/audit/contractSigning.vue
Normal file
@ -0,0 +1,56 @@
|
||||
<template>
|
||||
<view class="contractSigning-container">
|
||||
<web-view
|
||||
:src="contractUrl"
|
||||
@onPageStarted="onPageStarted"
|
||||
@onPageFinished="onPageFinished"
|
||||
/>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import favoriteLoading from "@/components/favorite-loading/favorite-loading.vue";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
contractUrl: "",
|
||||
|
||||
time: null,
|
||||
};
|
||||
},
|
||||
onLoad(options) {
|
||||
if (options) {
|
||||
clearTimeout(this.time);
|
||||
|
||||
uni.showLoading({
|
||||
title: "合同页加载中...",
|
||||
mask: true,
|
||||
});
|
||||
|
||||
this.showLoading = true;
|
||||
|
||||
this.contractUrl = options.url;
|
||||
|
||||
setTimeout(() => {
|
||||
uni.hideLoading();
|
||||
}, 4000);
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onPageStarted() {
|
||||
debugger;
|
||||
},
|
||||
onPageFinished() {
|
||||
debugger;
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.contractSigning-container {
|
||||
.loading {
|
||||
margin: 70% auto;
|
||||
display: flex;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@ -103,6 +103,8 @@
|
||||
:width="'100%'"
|
||||
:height="154"
|
||||
:upload-text="''"
|
||||
:maxSize="8 * 1024 * 1024"
|
||||
@oversize="overSize"
|
||||
></u-upload>
|
||||
</u-form-item>
|
||||
<u-form-item label="环境图" prop="environment_image">
|
||||
@ -116,6 +118,8 @@
|
||||
:width="'100%'"
|
||||
:height="154"
|
||||
:upload-text="''"
|
||||
:maxSize="8 * 1024 * 1024"
|
||||
@oversize="overSize"
|
||||
></u-upload>
|
||||
</u-form-item>
|
||||
</u-form>
|
||||
@ -222,6 +226,9 @@ export default {
|
||||
pageBack() {
|
||||
uni.navigateBack();
|
||||
},
|
||||
overSize(e) {
|
||||
uni.$u.toast("上传图片大小不能超过8MB!");
|
||||
},
|
||||
async afterRead1(e) {
|
||||
const item = e.file;
|
||||
const imgUrl = item.url;
|
||||
|
||||
@ -53,6 +53,8 @@
|
||||
:max-count="1"
|
||||
width="125"
|
||||
height="88"
|
||||
:maxSize="8 * 1024 * 1024"
|
||||
@oversize="overSize"
|
||||
uploadText="点击上传营业执照"
|
||||
></u-upload>
|
||||
</u-form-item>
|
||||
@ -128,6 +130,8 @@
|
||||
"
|
||||
:fileList="form.specialLicenseFiles"
|
||||
:max-count="5"
|
||||
:maxSize="8 * 1024 * 1024"
|
||||
@oversize="overSize"
|
||||
width="125"
|
||||
height="88"
|
||||
></u-upload>
|
||||
@ -160,6 +164,8 @@
|
||||
width="180"
|
||||
height="110"
|
||||
uploadIcon=""
|
||||
:maxSize="8 * 1024 * 1024"
|
||||
@oversize="overSize"
|
||||
></u-upload>
|
||||
<u-upload
|
||||
:class="fileList4.length == 0 ? 'shop2-5-upload' : ''"
|
||||
@ -171,6 +177,8 @@
|
||||
width="180"
|
||||
height="110"
|
||||
uploadIcon=""
|
||||
:maxSize="8 * 1024 * 1024"
|
||||
@oversize="overSize"
|
||||
></u-upload>
|
||||
</view>
|
||||
<u-form
|
||||
@ -272,6 +280,8 @@
|
||||
height="110"
|
||||
:upload-text="''"
|
||||
uploadIcon=""
|
||||
:maxSize="8 * 1024 * 1024"
|
||||
@oversize="overSize"
|
||||
></u-upload>
|
||||
<u-upload
|
||||
:class="fileList6.length == 0 ? 'shop2-5-upload' : ''"
|
||||
@ -284,6 +294,8 @@
|
||||
height="110"
|
||||
:upload-text="''"
|
||||
uploadIcon=""
|
||||
:maxSize="8 * 1024 * 1024"
|
||||
@oversize="overSize"
|
||||
></u-upload>
|
||||
</view>
|
||||
<u-form
|
||||
@ -517,6 +529,8 @@ export default {
|
||||
legal_person_id_addr: "", // 身份证地址
|
||||
legal_person_id_period_begin: "", //身份证开始有效日期
|
||||
legal_person_id_period_end: "", // 身份证截止日期
|
||||
biz_license_period_begin: "",
|
||||
biz_license_period_end: "9999-12-31",
|
||||
businessLicenseFiles: [],
|
||||
specialLicenseFiles: [],
|
||||
},
|
||||
@ -694,7 +708,10 @@ export default {
|
||||
pageBack() {
|
||||
uni.navigateBack();
|
||||
},
|
||||
getOcrText(filePath, file, type) {
|
||||
overSize(e) {
|
||||
uni.$u.toast("上传图片大小不能超过8MB!");
|
||||
},
|
||||
async getOcrText(filePath, file, type) {
|
||||
return new Promise(async (resolve, reject) => {
|
||||
const batchNoRes = await batchNoApi(filePath, file, type);
|
||||
const batchNo = batchNoRes.batchNo;
|
||||
@ -716,6 +733,7 @@ export default {
|
||||
});
|
||||
|
||||
const imgOcrRes = await imgOcrResultApi(formDataStr);
|
||||
|
||||
clearTimeout(this.orcTimeout);
|
||||
resolve(imgOcrRes?.data);
|
||||
}, 1000);
|
||||
@ -792,6 +810,10 @@ export default {
|
||||
this.form.legal_person_name = ocr.bizLicenseOwnerName;
|
||||
this.form.biz_license_number = ocr.bizLicenseCreditCode;
|
||||
this.form.biz_license_content = ocr.bizLicenseScope || "";
|
||||
this.form.biz_license_period_begin = ocr.bizLicenseStartTime
|
||||
.replace(/年|月|日/g, "-")
|
||||
.replace(/-$/g, "")
|
||||
.replace(/-+/g, "-");
|
||||
console.log("BUSINESS_LICENCE", ocr);
|
||||
break;
|
||||
case "licenseNumber":
|
||||
@ -818,9 +840,14 @@ export default {
|
||||
let validity = ocr.validity.split("-");
|
||||
this.startTime = validity[0];
|
||||
this.endTime = validity[1];
|
||||
|
||||
this.form.legal_person_id_period_begin = this.startTime;
|
||||
this.form.legal_person_id_period_end = this.endTime;
|
||||
this.form.legal_person_id_period_begin = this.startTime.replace(
|
||||
/\./g,
|
||||
"-"
|
||||
);
|
||||
this.form.legal_person_id_period_end = this.endTime.replace(
|
||||
/\./g,
|
||||
"-"
|
||||
);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
@ -72,6 +72,8 @@ export default {
|
||||
height: 240rpx;
|
||||
margin: 50% auto;
|
||||
margin-bottom: 32rpx;
|
||||
border-radius: 12rpx;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.app-name {
|
||||
|
||||
@ -26,12 +26,14 @@ export default {
|
||||
<style lang="scss">
|
||||
.versions-container {
|
||||
.logo-content {
|
||||
background-image: url("../../static/logo-2.png");
|
||||
background-size: 100% 100%;
|
||||
width: 228rpx;
|
||||
height: 228rpx;
|
||||
margin: 50% auto;
|
||||
margin-bottom: 32rpx;
|
||||
width: 228rpx;
|
||||
height: 228rpx;
|
||||
background-size: 100% 100%;
|
||||
background-image: url("../../static/logo-2.png");
|
||||
border-radius: 12rpx;
|
||||
overflow: hidden;
|
||||
}
|
||||
.versions-content {
|
||||
text-align: center;
|
||||
|
||||
@ -895,7 +895,7 @@ export default {
|
||||
},
|
||||
},
|
||||
shopNmae: "",
|
||||
logoUrl: "",
|
||||
logoUrl: "@/static/xiaofa-logo.png",
|
||||
sfStatus: [
|
||||
{
|
||||
id: 1,
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 52 KiB After Width: | Height: | Size: 16 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 52 KiB After Width: | Height: | Size: 16 KiB |
@ -1,16 +1,17 @@
|
||||
import Vue from 'vue'
|
||||
import Vuex from 'vuex'
|
||||
import user from './modules/user'
|
||||
import account from './modules/account'
|
||||
|
||||
Vue.use(Vuex)
|
||||
|
||||
import Vue from 'vue';
|
||||
import Vuex from 'vuex';
|
||||
import user from './modules/user';
|
||||
import account from './modules/account';
|
||||
import order from './modules/order';
|
||||
|
||||
Vue.use(Vuex);
|
||||
|
||||
const store = new Vuex.Store({
|
||||
modules:{
|
||||
modules: {
|
||||
user,
|
||||
account
|
||||
}
|
||||
})
|
||||
account,
|
||||
order,
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
export default store
|
||||
export default store;
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
import { GetOrderPush } from "../../api/user";
|
||||
import { GetOrderPush } from '../../api/order';
|
||||
import GtPush from '@/utils/gtpush-min.js';
|
||||
|
||||
const defaultState = () => {
|
||||
return {
|
||||
@ -12,11 +13,49 @@ const getters = {};
|
||||
|
||||
const mutations = {};
|
||||
|
||||
const getClient = () => {
|
||||
// #ifdef APP-PLUS
|
||||
let clientInfo = plus.push.getClientInfo(); //获取 clientID
|
||||
uni.setStorageSync('clientid', clientInfo.clientid);
|
||||
return clientInfo.clientid;
|
||||
console.log(clientInfo);
|
||||
// #endif
|
||||
};
|
||||
|
||||
const actions = {
|
||||
async getOrderPush() {
|
||||
let res = await GetOrderPush();
|
||||
if (res && res.status) {
|
||||
debugger;
|
||||
async intOrderPush({ dispatch }) {
|
||||
GtPush.init({
|
||||
appid: 'KXgzOaKSzd5HG3p9IPaVa8',
|
||||
onClientId: (res) => {
|
||||
let params = {
|
||||
cid: res.cid,
|
||||
message: '测试',
|
||||
};
|
||||
|
||||
dispatch('getOrderPush', params);
|
||||
console.log('onClientId = ' + res.cid);
|
||||
},
|
||||
onlineState: (res) => {
|
||||
console.log('onlineState = ' + res.online);
|
||||
},
|
||||
onPushMsg: (res) => {
|
||||
console.log('onPushMsg = ' + res.message);
|
||||
},
|
||||
onError: (res) => {
|
||||
console.log('error', +res.message);
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
async getOrderPush({ dispatch }, params) {
|
||||
// #ifdef APP-PLUS
|
||||
let clientid = getClient();
|
||||
// #endif
|
||||
|
||||
let res = await GetOrderPush(params);
|
||||
|
||||
if (res && res.second) {
|
||||
console.log('OrderPush', res);
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
88
java-mall-app-shop-admin/utils/gtpush-min.js
vendored
Normal file
88
java-mall-app-shop-admin/utils/gtpush-min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
67
java-mall-app-shop-admin/utils/push.js
Normal file
67
java-mall-app-shop-admin/utils/push.js
Normal file
@ -0,0 +1,67 @@
|
||||
export default {
|
||||
init: () => {
|
||||
// #ifdef APP-PLUS
|
||||
plus.push.setAutoNotification(true); //设置通知栏显示通知 //必须设置
|
||||
plus.push.addEventListener("click", function(msg) {
|
||||
plus.push.clear(); //清空通知栏
|
||||
pushHandle(msg) //处理方法
|
||||
}, false);
|
||||
// 监听在线消息事件
|
||||
plus.push.addEventListener("receive", function(msg) {
|
||||
if (plus.os.name=='iOS') { //由于IOS 必须要创建本地消息 所以做这个判断
|
||||
if (msg.payload&& msg.payload!=null&&msg.type=='receive') {
|
||||
console.log(msg);
|
||||
// {"title": "xxx","content": "xxx","payload": "xxx"} 符合这种 才会自动创建消息 文档地址https://ask.dcloud.net.cn/article/35622
|
||||
plus.push.createMessage(msg.payload.content,JSON.stringify(msg.payload)) //创建本地消息
|
||||
}
|
||||
}
|
||||
if (plus.os.name=='Android') {
|
||||
if(!msg.title||!msg.content||!msg.payload){ // 不符合自动创建消息的情况
|
||||
//这里根据你消息字段来创建消息
|
||||
// plus.push.createMessage(msg.payload.content,JSON.stringify(msg.payload)) //创建本地消息
|
||||
}else{
|
||||
//符合自动创建消息
|
||||
pushHandle(msg)
|
||||
}
|
||||
}
|
||||
|
||||
}, false);
|
||||
// #endif
|
||||
},
|
||||
|
||||
getClient: (callback) => {
|
||||
// #ifdef APP-PLUS
|
||||
let clientInfo = plus.push.getClientInfo(); //获取 clientID
|
||||
uni.setStorageSync('clientid', clientInfo.clientid)
|
||||
console.log(clientInfo);
|
||||
// #endif
|
||||
|
||||
},
|
||||
|
||||
}
|
||||
const pushHandle = (msg) => {
|
||||
if (typeof (msg.payload )=='string') { //如果是字符串,表示是ios创建的 要转换一下
|
||||
msg.payload=JSON.parse(msg.payload )
|
||||
}
|
||||
if(!msg) return false;
|
||||
plus.runtime.setBadgeNumber(0); //清除app角标
|
||||
|
||||
//下面的代码根据自己业务来写 这里可以写跳转业务代码
|
||||
//跳转到tab
|
||||
if (msg.payload.pathType == '1') {
|
||||
uni.switchTab({
|
||||
url: msg.payload.url
|
||||
})
|
||||
}
|
||||
//跳转到详情
|
||||
if (msg.payload.pathType == 0) {
|
||||
let url = msg.payload.url
|
||||
if (msg.payload.args) {
|
||||
url = url + '?listId=' + msg.payload.args
|
||||
}
|
||||
console.log(url);
|
||||
uni.navigateTo({
|
||||
url: url
|
||||
})
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user