2023-3-17
消息通知
This commit is contained in:
@@ -1,16 +1,20 @@
|
|||||||
{ // launch.json 配置了启动调试时相关设置,configurations下节点名称可为 app-plus/h5/mp-weixin/mp-baidu/mp-alipay/mp-qq/mp-toutiao/mp-360/
|
{
|
||||||
// launchtype项可配置值为local或remote, local代表前端连本地云函数,remote代表前端连云端云函数
|
// launch.json 配置了启动调试时相关设置,configurations下节点名称可为 app-plus/h5/mp-weixin/mp-baidu/mp-alipay/mp-qq/mp-toutiao/mp-360/
|
||||||
"version": "0.0",
|
// launchtype项可配置值为local或remote, local代表前端连本地云函数,remote代表前端连云端云函数
|
||||||
"configurations": [{
|
"version" : "0.0",
|
||||||
"app-plus" :
|
"configurations" : [
|
||||||
{
|
{
|
||||||
"launchtype" : "local"
|
"app-plus" : {
|
||||||
},
|
"launchtype" : "local"
|
||||||
"default" :
|
},
|
||||||
{
|
"default" : {
|
||||||
"launchtype" : "local"
|
"launchtype" : "local"
|
||||||
},
|
},
|
||||||
"type" : "uniCloud"
|
"type" : "uniCloud"
|
||||||
}
|
},
|
||||||
|
{
|
||||||
|
"playground" : "custom",
|
||||||
|
"type" : "uni-app:app-android"
|
||||||
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
<script>
|
<script>
|
||||||
|
import index from '@/store/index.js';
|
||||||
import Api from '@/common/api';
|
import Api from '@/common/api';
|
||||||
// #ifdef APP-PLUS
|
// #ifdef APP-PLUS
|
||||||
import APPUpdate from "plugins/APPUpdate/index.js";
|
import APPUpdate from "plugins/APPUpdate/index.js";
|
||||||
@@ -54,6 +55,7 @@
|
|||||||
getCid() {
|
getCid() {
|
||||||
// #ifdef APP-PLUS
|
// #ifdef APP-PLUS
|
||||||
var t1_time = 0;
|
var t1_time = 0;
|
||||||
|
let that = this;
|
||||||
var t1 = setInterval(function() {
|
var t1 = setInterval(function() {
|
||||||
var cid = plus.push.getClientInfo().clientid;
|
var cid = plus.push.getClientInfo().clientid;
|
||||||
console.log(cid != undefined, cid != "undefined", cid)
|
console.log(cid != undefined, cid != "undefined", cid)
|
||||||
@@ -61,43 +63,99 @@
|
|||||||
if (cid != null || cid != "null") {
|
if (cid != null || cid != "null") {
|
||||||
uni.setStorageSync('cid', cid);
|
uni.setStorageSync('cid', cid);
|
||||||
clearInterval(t1);
|
clearInterval(t1);
|
||||||
|
that.pushCid();
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}, 130);
|
}, 130);
|
||||||
// #endif
|
// #endif
|
||||||
},
|
},
|
||||||
|
async pushCid() {
|
||||||
|
console.log('pushCid1111111>>>>>')
|
||||||
|
let params = {
|
||||||
|
cid: uni.getStorageSync('cid')
|
||||||
|
};
|
||||||
|
console.log("pushCid>>>>", params);
|
||||||
|
let data = await Api.apiCall('post', Api.index.pushCid, params);
|
||||||
|
console.log('pushCid22222222>>>>>', data)
|
||||||
|
},
|
||||||
// 监听通知信息
|
// 监听通知信息
|
||||||
handlePush() {
|
handlePush() {
|
||||||
|
let that = this;
|
||||||
// #ifdef APP-PLUS
|
// #ifdef APP-PLUS
|
||||||
const _handlePush = function(message) {
|
const _handlePush = function(message) {
|
||||||
|
|
||||||
console.log("message>>>>>>>>>>", message)
|
console.log("message>>>>>>>>>>", message)
|
||||||
uni.setStorageSync('message', message);
|
console.log("payload>>>>>>>>>>", message.payload.code)
|
||||||
获取自定义信息
|
// uni.setStorageSync('message', message);
|
||||||
let payload = message.payload;
|
//获取自定义信息
|
||||||
|
// let payload = message.payload;
|
||||||
// uni.switchTab({
|
// console.log("payload>>>>>>>>>>", payload.code)
|
||||||
// url: `${payload.path}`
|
if ("系统消息" == message.payload.code) {
|
||||||
// })
|
// 系统消息
|
||||||
|
console.log("系统消息>>>>>>>>>>", message.payload.code)
|
||||||
// uni.navigateTo({
|
that.goToMessageDetail(message.payload)
|
||||||
// url: '/pages/index/messageDetail',
|
} else {
|
||||||
// // 版本2.8.9+ 支持
|
// 非系统消息
|
||||||
// success: (res) => {
|
|
||||||
// // 和上面其实没差什么,但是这种方式是可以的 这里不是$emit
|
if (that.hasLogin) {
|
||||||
// res.eventChannel.emit('sendTestValue', {
|
// 登录状态
|
||||||
// info: item
|
console.log("登录状态>>>>>>>>>>", message.payload.code)
|
||||||
// })
|
that.goToMessageDetail(message.payload)
|
||||||
// }
|
} else {
|
||||||
// });
|
|
||||||
|
// 非登录状态
|
||||||
|
console.log("非登录状态>>>>>>>>>>", message.payload.code)
|
||||||
|
// uni.navigateTo({
|
||||||
|
// url: "/pages/public/login"
|
||||||
|
// });
|
||||||
|
uni.showToast({
|
||||||
|
title: '请先登录',
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
|
||||||
|
uni.switchTab({
|
||||||
|
url: '/pages/index/messageList'
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 事件处理
|
// 事件处理
|
||||||
plus.push.addEventListener('click', _handlePush)
|
|
||||||
|
// 从系统消息中心点击消息启动应用事件
|
||||||
|
// plus.push.addEventListener('click', _handlePush)
|
||||||
|
// 应用从推送服务器接收到推送消息事件
|
||||||
plus.push.addEventListener('receive', _handlePush)
|
plus.push.addEventListener('receive', _handlePush)
|
||||||
// #endif
|
// #endif
|
||||||
},
|
},
|
||||||
|
|
||||||
|
goToMessageDetail(payload) {
|
||||||
|
|
||||||
|
let item = {
|
||||||
|
params: payload.params,
|
||||||
|
code: payload.code,
|
||||||
|
ctime: payload.ctime,
|
||||||
|
content: payload.content,
|
||||||
|
}
|
||||||
|
console.log("goToMessageDetail>>>>>>>>>>", item)
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pages/index/messageDetail',
|
||||||
|
// 版本2.8.9+ 支持
|
||||||
|
success: (res) => {
|
||||||
|
// 和上面其实没差什么,但是这种方式是可以的 这里不是$emit
|
||||||
|
res.eventChannel.emit('sendTestValue', {
|
||||||
|
info: item
|
||||||
|
})
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
onLaunch: function() {
|
onLaunch: function() {
|
||||||
// uni.removeStorageSync('userInfo');
|
// uni.removeStorageSync('userInfo');
|
||||||
@@ -108,14 +166,14 @@
|
|||||||
console.log('App onLaunch>>>', userInfo)
|
console.log('App onLaunch>>>', userInfo)
|
||||||
console.log('App onLaunch>>>', token)
|
console.log('App onLaunch>>>', token)
|
||||||
if (token) {
|
if (token) {
|
||||||
|
index.state.hasLogin = true
|
||||||
//更新登陆状态
|
//更新登陆状态
|
||||||
uni.getStorage({
|
uni.getStorage({
|
||||||
key: 'userInfo',
|
key: 'userInfo',
|
||||||
success: (res) => {
|
data: userInfo
|
||||||
console.log('App onLaunch>>', res)
|
|
||||||
this.login(res.data);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
console.log('hasLogin>>>', index.state.hasLogin)
|
||||||
}
|
}
|
||||||
|
|
||||||
let isWeiXin = this.$common.isWeiXinBrowser()
|
let isWeiXin = this.$common.isWeiXinBrowser()
|
||||||
@@ -135,7 +193,7 @@
|
|||||||
|
|
||||||
this.handlePush();
|
this.handlePush();
|
||||||
this.getCid();
|
this.getCid();
|
||||||
console.log('App onLaunch111111111111>>>', token)
|
// console.log('App onLaunch111111111111>>>', token)
|
||||||
// let sss = {
|
// let sss = {
|
||||||
// "url": "http://mall.yyundong.com/portalapi/api/appVersion/versioninfo",
|
// "url": "http://mall.yyundong.com/portalapi/api/appVersion/versioninfo",
|
||||||
// "resolve": {
|
// "resolve": {
|
||||||
|
|||||||
@@ -2,8 +2,8 @@ import store from '../store/index';
|
|||||||
export default {
|
export default {
|
||||||
// qq 237524947 wx15d4269d3210863d
|
// qq 237524947 wx15d4269d3210863d
|
||||||
// BASEURI: 'http://192.168.3.9:8083/api/',
|
// BASEURI: 'http://192.168.3.9:8083/api/',
|
||||||
BASEURI: 'http://mall.yyundong.com/portalapi/api/',
|
// BASEURI: 'http://mall.yyundong.com/portalapi/api/',
|
||||||
// BASEURI: 'http://192.168.31.52:8083/api/',
|
BASEURI: 'http://192.168.3.116:8083/api/',
|
||||||
ADMINURI: 'http://mall.yyundong.com/adminapi/',
|
ADMINURI: 'http://mall.yyundong.com/adminapi/',
|
||||||
ESURI: 'http://www.yyundong.com:8081/',
|
ESURI: 'http://www.yyundong.com:8081/',
|
||||||
h5Appid: 'wxb4660f37187c0b8e', // h5微信登录的appId 暂时测试用
|
h5Appid: 'wxb4660f37187c0b8e', // h5微信登录的appId 暂时测试用
|
||||||
@@ -55,6 +55,7 @@ export default {
|
|||||||
storeCommentList: 'single/store/storeComment/list', // 商户评论
|
storeCommentList: 'single/store/storeComment/list', // 商户评论
|
||||||
noticeList: 'single/home/notice/list',
|
noticeList: 'single/home/notice/list',
|
||||||
noticeDetail: 'single/home/notice/detail',
|
noticeDetail: 'single/home/notice/detail',
|
||||||
|
pushCid: 'single/home/pushCid',// 保存cid
|
||||||
},
|
},
|
||||||
member: {
|
member: {
|
||||||
applyMember: 'single/user/applyMember', // 会员升级等级
|
applyMember: 'single/user/applyMember', // 会员升级等级
|
||||||
|
|||||||
@@ -56,7 +56,8 @@
|
|||||||
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>",
|
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.BLUETOOTH\"/>",
|
"<uses-permission android:name=\"android.permission.BLUETOOTH\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.BLUETOOTH_ADMIN\"/>"
|
"<uses-permission android:name=\"android.permission.BLUETOOTH_ADMIN\"/>"
|
||||||
]
|
],
|
||||||
|
"abiFilters" : [ "armeabi-v7a", "arm64-v8a", "x86" ]
|
||||||
},
|
},
|
||||||
"ios" : {
|
"ios" : {
|
||||||
"dSYMs" : false
|
"dSYMs" : false
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<view v-for="(item, index) in goodsList" :key="index" class="goods-item">
|
<view v-for="(item, index) in goodsList" :key="index" class="goods-item">
|
||||||
<view class="listcard" @click="navToDetailPage(item)">
|
<view class="listcard" @click="navToDetailPage(item)">
|
||||||
<view class="listcard-image">
|
<view class="listcard-image">
|
||||||
<image :src="item.code=='交易物流'?pic1:pic2" mode="aspectFill"></image>
|
<image :src="typeUrl(item)" mode="aspectFill"></image>
|
||||||
</view>
|
</view>
|
||||||
<view class="listcard-content">
|
<view class="listcard-content">
|
||||||
<view class="listcard-content_title">
|
<view class="listcard-content_title">
|
||||||
@@ -33,6 +33,7 @@
|
|||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pic1: "http://mall.yyundong.com/wl.png",
|
pic1: "http://mall.yyundong.com/wl.png",
|
||||||
pic2: "http://mall.yyundong.com/tx.png",
|
pic2: "http://mall.yyundong.com/tx.png",
|
||||||
|
pic3: "http://mall.yyundong.com/tz.png",
|
||||||
goodsList: [
|
goodsList: [
|
||||||
// {
|
// {
|
||||||
// title: "交易物流",
|
// title: "交易物流",
|
||||||
@@ -70,7 +71,7 @@
|
|||||||
},
|
},
|
||||||
//下拉刷新
|
//下拉刷新
|
||||||
onPullDownRefresh() {
|
onPullDownRefresh() {
|
||||||
this.pageNum = this.pageNum + 1;
|
this.pageNum = 1;
|
||||||
this.loadData('refresh');
|
this.loadData('refresh');
|
||||||
},
|
},
|
||||||
//加载更多
|
//加载更多
|
||||||
@@ -85,6 +86,14 @@
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
typeUrl(item) {
|
||||||
|
if ("交易物流" == item.code)
|
||||||
|
return this.pic1
|
||||||
|
if ("云链助手" == item.code)
|
||||||
|
return this.pic2
|
||||||
|
if ("系统消息" == item.code)
|
||||||
|
return this.pic3
|
||||||
|
},
|
||||||
//加载商品 ,带下拉刷新和上滑加载
|
//加载商品 ,带下拉刷新和上滑加载
|
||||||
async loadData(type = 'add', loading) {
|
async loadData(type = 'add', loading) {
|
||||||
//没有更多直接返回
|
//没有更多直接返回
|
||||||
@@ -96,7 +105,9 @@
|
|||||||
} else {
|
} else {
|
||||||
this.loadingType = 'more';
|
this.loadingType = 'more';
|
||||||
}
|
}
|
||||||
let params = {};
|
let params = {
|
||||||
|
// pageNum: this.pageNum
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
let list = await Api.apiCall('get', Api.member.mesList, params);
|
let list = await Api.apiCall('get', Api.member.mesList, params);
|
||||||
|
|||||||
@@ -525,6 +525,7 @@
|
|||||||
authCode: this.code,
|
authCode: this.code,
|
||||||
cid: uni.getStorageSync('cid')
|
cid: uni.getStorageSync('cid')
|
||||||
};
|
};
|
||||||
|
console.log("params>>>>", params);
|
||||||
let data = await Api.apiCall('post', Api.index.loginByCode, params);
|
let data = await Api.apiCall('post', Api.index.loginByCode, params);
|
||||||
//this.logining = false;
|
//this.logining = false;
|
||||||
if (data) {
|
if (data) {
|
||||||
@@ -552,7 +553,7 @@
|
|||||||
password: this.password,
|
password: this.password,
|
||||||
cid: uni.getStorageSync('cid')
|
cid: uni.getStorageSync('cid')
|
||||||
};
|
};
|
||||||
console.log("params>>>>",params);
|
console.log("params>>>>", params);
|
||||||
let data = await Api.apiCall('post', Api.index.login, params);
|
let data = await Api.apiCall('post', Api.index.login, params);
|
||||||
if (data) {
|
if (data) {
|
||||||
console.log(data);
|
console.log(data);
|
||||||
|
|||||||
@@ -82,7 +82,9 @@
|
|||||||
if (e.confirm) {
|
if (e.confirm) {
|
||||||
this.logout();
|
this.logout();
|
||||||
this.$db.del('token');
|
this.$db.del('token');
|
||||||
Api.apiCall('post', Api.index.logout, {});
|
Api.apiCall('post', Api.index.logout, {
|
||||||
|
cid: uni.getStorageSync('cid')
|
||||||
|
});
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
uni.navigateBack();
|
uni.navigateBack();
|
||||||
uni.removeStorageSync('userInfo');
|
uni.removeStorageSync('userInfo');
|
||||||
|
|||||||
@@ -252,11 +252,13 @@
|
|||||||
};
|
};
|
||||||
let data = await Api.apiCall('get', Api.goods.goodsDetail, params);
|
let data = await Api.apiCall('get', Api.goods.goodsDetail, params);
|
||||||
this.logining = false;
|
this.logining = false;
|
||||||
|
|
||||||
if (data) {
|
if (data) {
|
||||||
let detailData = data.goods;
|
let detailData = data.goods;
|
||||||
let goods = detailData.goods;
|
let goods = detailData.goods;
|
||||||
this.goods = goods;
|
this.goods = goods;
|
||||||
|
console.log("goods》》》》》",goods)
|
||||||
|
console.log("goods.price》》》》》",goods.price)
|
||||||
this.favorite = data.favorite;
|
this.favorite = data.favorite;
|
||||||
this.typeGoodsList = detailData.typeGoodsList;
|
this.typeGoodsList = detailData.typeGoodsList;
|
||||||
var subImages = goods.albumPics;
|
var subImages = goods.albumPics;
|
||||||
@@ -316,41 +318,41 @@
|
|||||||
this.couponList = couponList1;
|
this.couponList = couponList1;
|
||||||
}
|
}
|
||||||
|
|
||||||
//规格 默认选中第一条
|
// //规格 默认选中第一条
|
||||||
if (this.specList) {
|
// if (this.specList) {
|
||||||
var specs = '';
|
// var specs = '';
|
||||||
this.specList.forEach(item => {
|
// this.specList.forEach(item => {
|
||||||
for (let cItem of this.specChildList) {
|
// for (let cItem of this.specChildList) {
|
||||||
if (cItem.pid === item.id) {
|
// if (cItem.pid === item.id) {
|
||||||
this.$set(cItem, 'selected', true);
|
// this.$set(cItem, 'selected', true);
|
||||||
this.specSelected.push(cItem);
|
// this.specSelected.push(cItem);
|
||||||
specs = cItem.name + ',' + specs;
|
// specs = cItem.name + ',' + specs;
|
||||||
break; //forEach不能使用break
|
// break; //forEach不能使用break
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
let valuesA = specs.substr(0, specs.length - 1).split(',');
|
// let valuesA = specs.substr(0, specs.length - 1).split(',');
|
||||||
|
|
||||||
this.skuList.forEach(item => {
|
// this.skuList.forEach(item => {
|
||||||
if (valuesA.length == 1 && item.sp1 == valuesA[0]) {
|
// if (valuesA.length == 1 && item.sp1 == valuesA[0]) {
|
||||||
this.sku = item;
|
// this.sku = item;
|
||||||
}
|
// }
|
||||||
if (valuesA.length == 2 && item.sp2 == valuesA[0] && item.sp1 == valuesA[1]) {
|
// if (valuesA.length == 2 && item.sp2 == valuesA[0] && item.sp1 == valuesA[1]) {
|
||||||
this.sku = item;
|
// this.sku = item;
|
||||||
}
|
// }
|
||||||
if (valuesA.length == 3 && item.sp3 == valuesA[0] && item.sp2 == valuesA[1] && item.sp1 ==
|
// if (valuesA.length == 3 && item.sp3 == valuesA[0] && item.sp2 == valuesA[1] && item.sp1 ==
|
||||||
valuesA[2]) {
|
// valuesA[2]) {
|
||||||
this.sku = item;
|
// this.sku = item;
|
||||||
}
|
// }
|
||||||
if (!this.sku.pic) {
|
// if (!this.sku.pic) {
|
||||||
this.sku.pic = this.goods.pic;
|
// this.sku.pic = this.goods.pic;
|
||||||
}
|
// }
|
||||||
if (!this.sku.stock) {
|
// if (!this.sku.stock) {
|
||||||
this.sku.stock = 0;
|
// this.sku.stock = 0;
|
||||||
}
|
// }
|
||||||
this.goods.price = this.sku.price;
|
// this.goods.price = this.sku.price;
|
||||||
});
|
// });
|
||||||
}
|
// }
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapState(['hasLogin', 'userInfo'])
|
...mapState(['hasLogin', 'userInfo'])
|
||||||
|
|||||||
@@ -169,7 +169,7 @@
|
|||||||
let _this = this;
|
let _this = this;
|
||||||
// 验证是否已进行验证码操作
|
// 验证是否已进行验证码操作
|
||||||
if (this.verifTime == 0) {
|
if (this.verifTime == 0) {
|
||||||
if (!/^1[1234567890]\d{9}$/.test(this.phone)) {
|
if (!/^1[3456789]\d{9}$/.test(this.phone)) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '电话号码有误,请重新输入',
|
title: '电话号码有误,请重新输入',
|
||||||
icon: 'none'
|
icon: 'none'
|
||||||
|
|||||||
Reference in New Issue
Block a user