From 9a9e940fb079015e8a71c7c646652992900844f7 Mon Sep 17 00:00:00 2001
From: guoxing <1369478551@qq.com>
Date: Thu, 16 Mar 2023 18:07:28 +0800
Subject: [PATCH] 2023-1-16
---
mallplusui-uniapp-app/App.vue | 93 +++++++++++++++++++-
mallplusui-uniapp-app/common/api.js | 4 +-
mallplusui-uniapp-app/manifest.json | 21 ++++-
mallplusui-uniapp-app/pages/index/user.vue | 14 ++-
mallplusui-uniapp-app/pages/order/order.vue | 2 +-
mallplusui-uniapp-app/pages/public/login.vue | 7 +-
mallplusui-uniapp-app/pages/public/reg.vue | 3 +-
7 files changed, 129 insertions(+), 15 deletions(-)
diff --git a/mallplusui-uniapp-app/App.vue b/mallplusui-uniapp-app/App.vue
index 1ff1310..1025e3a 100644
--- a/mallplusui-uniapp-app/App.vue
+++ b/mallplusui-uniapp-app/App.vue
@@ -43,12 +43,61 @@
this.$db.set('areaGoodsList', list)
},
async sysInfoMethod() {
+ console.log('sysInfo11111111>>>>>')
let params = {};
let list = await Api.apiCall('get', Api.index.sysInfo, params);
- console.log('sysInfo>>>>>', sysInfo)
+ console.log('sysInfo222222222>>>>>', sysInfo)
this.$db.set('sysInfo', list)
},
+ // 获取CID
+ getCid() {
+ // #ifdef APP-PLUS
+ var t1_time = 0;
+ var t1 = setInterval(function() {
+ var cid = plus.push.getClientInfo().clientid;
+ console.log(cid != undefined, cid != "undefined", cid)
+ console.log("cid>>>>>>>>>>", cid)
+ if (cid != null || cid != "null") {
+ uni.setStorageSync('cid', cid);
+ clearInterval(t1);
+ return
+ }
+ }, 130);
+ // #endif
+ },
+ // 监听通知信息
+ handlePush() {
+ // #ifdef APP-PLUS
+ const _handlePush = function(message) {
+
+ console.log("message>>>>>>>>>>", message)
+ uni.setStorageSync('message', message);
+ 获取自定义信息
+ let payload = message.payload;
+
+ // uni.switchTab({
+ // url: `${payload.path}`
+ // })
+
+ // uni.navigateTo({
+ // url: '/pages/index/messageDetail',
+ // // 版本2.8.9+ 支持
+ // success: (res) => {
+ // // 和上面其实没差什么,但是这种方式是可以的 这里不是$emit
+ // res.eventChannel.emit('sendTestValue', {
+ // info: item
+ // })
+ // }
+ // });
+
+ }
+ // 事件处理
+ plus.push.addEventListener('click', _handlePush)
+ plus.push.addEventListener('receive', _handlePush)
+ // #endif
+ },
+
},
onLaunch: function() {
// uni.removeStorageSync('userInfo');
@@ -56,8 +105,8 @@
console.log('App onLaunch')
let userInfo = uni.getStorageSync('userInfo') || '';
let token = uni.getStorageSync('token') || '';
- console.log('App onLaunch>>>',userInfo)
- console.log('App onLaunch>>>',token)
+ console.log('App onLaunch>>>', userInfo)
+ console.log('App onLaunch>>>', token)
if (token) {
//更新登陆状态
uni.getStorage({
@@ -83,6 +132,44 @@
// icon: "none"
// });
// #endif
+
+ this.handlePush();
+ this.getCid();
+ console.log('App onLaunch111111111111>>>', token)
+ // let sss = {
+ // "url": "http://mall.yyundong.com/portalapi/api/appVersion/versioninfo",
+ // "resolve": {
+ // "data": {
+ // "code": 200,
+ // "data": "{\"id\":null,\"appName\":null,\"versionCode\":1010,\"versionName\":\"1.0.1.0\",\"downloadUrl\":\"http://mall.yyundong.com/apks/mall-1010.apk\",\"versionInfo\":\"BUG修复。\",\"isAlpha\":null,\"fileName\":\"mall-1010.apk\",\"forceUpdate\":false}"
+ // },
+ // "statusCode": 200,
+ // "header": {
+ // "X-XSS-Protection": "1; mode=block",
+ // "Connection": "keep-alive",
+ // "Content-Length": "268",
+ // "X-Content-Type-Options": "nosniff",
+ // "Cache-Control": "no-cache, no-store, max-age=0, must-revalidate",
+ // "Date": "Thu, 16 Mar 2023 05:48:35 GMT",
+ // "Expires": "0",
+ // "X-Frame-Options": "DENY",
+ // "Content-Type": "application/json;charset=UTF-8",
+ // "Server": "nginx/1.20.2",
+ // "Pragma": "no-cache"
+ // },
+ // "errMsg": "request:ok",
+ // "cookies": []
+ // },
+ // "header": {
+ // "Content-Type": "application/json;charset=UTF-8"
+ // },
+ // "data": {
+ // "version": "1010",
+ // "type": 1101
+ // },
+ // "method": "GET"
+ // }
+ // uni.setStorageSync('message', sss);
},
onShow: function() {
console.log('App Show')
diff --git a/mallplusui-uniapp-app/common/api.js b/mallplusui-uniapp-app/common/api.js
index 83150a2..839d658 100644
--- a/mallplusui-uniapp-app/common/api.js
+++ b/mallplusui-uniapp-app/common/api.js
@@ -1,8 +1,8 @@
import store from '../store/index';
export default {
// qq 237524947 wx15d4269d3210863d
- BASEURI: 'http://192.168.3.9:8083/api/',
- // BASEURI: 'http://mall.yyundong.com/portalapi/api/',
+ // BASEURI: 'http://192.168.3.9:8083/api/',
+ BASEURI: 'http://mall.yyundong.com/portalapi/api/',
// BASEURI: 'http://192.168.31.52:8083/api/',
ADMINURI: 'http://mall.yyundong.com/adminapi/',
ESURI: 'http://www.yyundong.com:8081/',
diff --git a/mallplusui-uniapp-app/manifest.json b/mallplusui-uniapp-app/manifest.json
index e81909a..aa14b43 100644
--- a/mallplusui-uniapp-app/manifest.json
+++ b/mallplusui-uniapp-app/manifest.json
@@ -2,8 +2,8 @@
"name" : "汇融云链",
"appid" : "__UNI__FB2C9C4",
"description" : "",
- "versionName" : "1.0.1.0",
- "versionCode" : 1010,
+ "versionName" : "1.0.1.1",
+ "versionCode" : 1011,
"transformPx" : false,
"app-plus" : {
"usingComponents" : true,
@@ -21,7 +21,8 @@
"iBeacon" : {},
"Maps" : {},
"Camera" : {},
- "Barcode" : {}
+ "Barcode" : {},
+ "Push" : {}
},
"distribute" : {
"android" : {
@@ -81,7 +82,19 @@
"__platform__" : [ "android" ]
}
},
- "push" : {},
+ "push" : {
+ "unipush" : {
+ "icons" : {
+ "small" : {
+ "ldpi" : "static/logo.png",
+ "mdpi" : "static/logo.png",
+ "hdpi" : "static/logo.png",
+ "xhdpi" : "static/logo.png",
+ "xxhdpi" : "static/logo.png"
+ }
+ }
+ }
+ },
"maps" : {
"amap" : {
"appkey_ios" : "8f3a475e0c7c2136efe071f94efb1cae",
diff --git a/mallplusui-uniapp-app/pages/index/user.vue b/mallplusui-uniapp-app/pages/index/user.vue
index 6d6e787..0db6a8e 100644
--- a/mallplusui-uniapp-app/pages/index/user.vue
+++ b/mallplusui-uniapp-app/pages/index/user.vue
@@ -130,7 +130,7 @@
mode="aspectFill">
+ @eventClick="navTo('../../pages/order/order?status=0')" >
+
+
+
@@ -206,6 +209,8 @@
},
data() {
return {
+ push: "11111111111",
+ cid: "",
inputShow: false,
feild: undefined,
inputContent: '',
@@ -236,6 +241,11 @@
this.viewList = []
this.listCollect = 0
this.getData();
+ let cids = uni.getStorageSync('cid')
+ let message = uni.getStorageSync('message')
+ this.cid = cids
+ this.push = message
+
},
// #ifndef MP
@@ -351,7 +361,7 @@
// });
// this.listCollect = orderList.length
// }
-
+
}
},
upData() {
diff --git a/mallplusui-uniapp-app/pages/order/order.vue b/mallplusui-uniapp-app/pages/order/order.vue
index d1b83aa..0d604f6 100644
--- a/mallplusui-uniapp-app/pages/order/order.vue
+++ b/mallplusui-uniapp-app/pages/order/order.vue
@@ -126,7 +126,7 @@
},
{
status: 3,
- text: '已发货',
+ text: '待收货',
loadingType: 'more',
orderList: []
},
diff --git a/mallplusui-uniapp-app/pages/public/login.vue b/mallplusui-uniapp-app/pages/public/login.vue
index 491944e..2cc89ae 100644
--- a/mallplusui-uniapp-app/pages/public/login.vue
+++ b/mallplusui-uniapp-app/pages/public/login.vue
@@ -522,7 +522,8 @@
// return;
let params = {
phone: this.phone,
- authCode: this.code
+ authCode: this.code,
+ cid: uni.getStorageSync('cid')
};
let data = await Api.apiCall('post', Api.index.loginByCode, params);
//this.logining = false;
@@ -548,8 +549,10 @@
}
let params = {
phone: this.phone,
- password: this.password
+ password: this.password,
+ cid: uni.getStorageSync('cid')
};
+ console.log("params>>>>",params);
let data = await Api.apiCall('post', Api.index.login, params);
if (data) {
console.log(data);
diff --git a/mallplusui-uniapp-app/pages/public/reg.vue b/mallplusui-uniapp-app/pages/public/reg.vue
index 8eabb6a..57fef0d 100644
--- a/mallplusui-uniapp-app/pages/public/reg.vue
+++ b/mallplusui-uniapp-app/pages/public/reg.vue
@@ -173,7 +173,8 @@
let params2 = {
phone: this.phone,
- password: this.password
+ password: this.password,
+ cid: uni.getStorageSync('cid')
};
let data2 = await Api.apiCall('post', Api.index.login, params2);
//this.logining = false;