首次提交

This commit is contained in:
duan
2024-06-06 11:49:50 +08:00
parent de480ef0a3
commit c5ebf34d7e
274 changed files with 58048 additions and 1 deletions

2
.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
.hbuilderx
unpackage

339
App.vue Normal file
View File

@@ -0,0 +1,339 @@
<script>
export default {
data() {
return {
}
},
onLaunch: function() {
setInterval(d => { //定时器,定时去调取聊天未读消息
console.log(uni.getStorageSync('shopToken'),'初始化')
let shopToken = uni.getStorageSync('shopToken')
if (shopToken) {
let shopId = uni.getStorageSync('shopId')
let data={
shopId:shopId
}
this.$Request.get('/shop/ordersChat/selectShopAllUnreadCount',data).then(res => {
if (res.code === 0) {
// let chatCount = res.data
let messageCount = res.data
uni.setStorageSync('messageCount', messageCount)
let num = messageCount
if (num == 0) {
uni.removeTabBarBadge({
index: 2
})
return;
}
uni.setTabBarBadge({
index: 2,
text: num + ""
})
}
});
}
}, 3000);
//#ifdef APP-PLUS
// APP检测更新 具体打包流程可以参考https://ask.dcloud.net.cn/article/35667
plus.screen.lockOrientation('portrait-primary'); //竖屏正方向锁定
//获取是否热更新过
const updated = uni.getStorageSync('updated'); // 尝试读取storage
let that = this;
if (updated.completed === true) {
// 如果上次刚更新过
// 删除安装包及安装记录
console.log('安装记录被删除,更新成功');
uni.removeSavedFile({
filePath: updated.packgePath,
success: res => {
uni.removeStorageSync('updated');
}
});
} else if (updated.completed === false) {
uni.removeStorageSync('updated');
plus.runtime.install(updated.packgePath, {
force: true
});
uni.setStorage({
key: 'updated',
data: {
completed: true,
packgePath: updated.packgePath
},
success: res => {
console.log('成功安装上次的更新,应用需要重启才能继续完成');
}
});
uni.showModal({
title: '温馨提示',
content: '应用将重启以完成更新',
showCancel: false,
complete: () => {
plus.runtime.restart();
}
});
} else {
//获取当前系统版本信息
plus.runtime.getProperty(plus.runtime.appid, widgetInfo => {
//请求后台接口 解析数据 对比版本
// let data = {
// classify: 1
// }
that.$Request.getT('/app/user/selectNewApp').then(res => {
res = res.data[2];
if (res.wgtUrl && widgetInfo.version < res.version) {
let downloadLink = '';
let androidLink = res.androidWgtUrl;
let iosLink = res.iosWgtUrl;
let ready = false;
//校验是是不是热更新
if (res.wgtUrl.match(RegExp(/.wgt/))) {
// 判断系统类型
if (plus.os.name.toLowerCase() === 'android') {
console.log('安卓系统');
if (androidLink && androidLink !== '#') {
// 我这里默认#也是没有地址,请根据业务自行修改
console.log('发现下载地址');
// 安卓:创建下载任务
if (androidLink.match(RegExp(/.wgt/))) {
console.log('确认wgt热更新包');
downloadLink = androidLink;
ready = true;
} else {
console.log('安卓推荐.wgt强制更新.apk的强制更新请您自行修改程序');
}
} else {
console.log('下载地址是空的,无法继续');
}
} else {
console.log('苹果系统');
if (iosLink && iosLink !== '#') {
// 我这里默认#也是没有地址,请根据业务自行修改
console.log('发现下载地址');
// 苹果(A)进行热更新如果iosLink是wgt更新包的下载地址判断文件名中是否含有.wgt
if (iosLink.match(RegExp(/.wgt/))) {
console.log('确认wgt热更新包');
downloadLink = iosLink;
ready = true;
} else {
console.log('苹果只支持.wgt强制更新');
}
} else {
console.log('下载地址是空的,无法继续');
}
}
if (ready) {
console.log('任务开始');
let downloadTask = uni.downloadFile({
url: downloadLink,
success: res => {
if (res.statusCode === 200) {
// 保存下载的安装包
console.log('保存安装包');
uni.saveFile({
tempFilePath: res.tempFilePath,
success: res => {
const packgePath = res
.savedFilePath;
// 保存更新记录到stroage下次启动app时安装更新
uni.setStorage({
key: 'updated',
data: {
completed: false,
packgePath: packgePath
},
success: () => {
console
.log(
'成功保存记录'
);
}
});
// 任务完成,关闭下载任务
console.log(
'任务完成,关闭下载任务,下一次启动应用时将安装更新'
);
downloadTask.abort();
downloadTask = null;
}
});
}
}
});
} else {
console.log('下载地址未准备,无法开启下载任务');
}
} else {
//不是热更新是在线更新 校验是否强制升级
if (res.method == 'true') {
uni.showModal({
showCancel: false,
confirmText: '立即更新',
title: '发现新版本',
content: res.des,
success: res => {
if (res.confirm) {
that.$queue.showLoading('下载中...');
if (uni.getSystemInfoSync().platform ==
'android') {
uni.downloadFile({
url: androidLink,
success: downloadResult => {
if (downloadResult
.statusCode ===
200) {
plus.runtime
.install(
downloadResult
.tempFilePath, {
force: false
},
d => {
console
.log(
'install success...'
);
plus.runtime
.restart();
},
e => {
console
.error(
'install fail...'
);
}
);
}
}
});
}
if (uni.getSystemInfoSync().platform ==
'ios') {
plus.runtime.openURL(iosLink, function(
res) {});
}
} else if (res.cancel) {
console.log('取消');
}
}
});
} else {
uni.showModal({
title: '发现新版本',
confirmText: '立即更新',
cancelText: '下次更新',
content: res.des,
success: res => {
if (res.confirm) {
that.$queue.showLoading('下载中...');
if (uni.getSystemInfoSync().platform ==
'android') {
uni.downloadFile({
url: androidLink,
success: downloadResult => {
if (downloadResult
.statusCode ===
200) {
plus.runtime
.install(
downloadResult
.tempFilePath, {
force: false
},
d => {
console
.log(
'install success...'
);
plus.runtime
.restart();
},
e => {
console
.error(
'install fail...'
);
}
);
}
}
});
}
if (uni.getSystemInfoSync().platform ==
'ios') {
plus.runtime.openURL(iosLink, function(
res) {});
}
} else if (res.cancel) {
console.log('取消');
}
}
});
}
}
}
});
});
}
//#endif
},
onShow: function() {
console.log('App Show')
this.$Request.get('/app/common/type/307').then(res => {
if (res.code == 0) {
// #ifdef MP-WEIXIN
this.$queue.setData('XCXIsSelect', res.data.value);
// #endif
// #ifndef MP-WEIXIN
this.$queue.setData('XCXIsSelect', '是');
// #endif
}
});
// this.$Request.get('/app/common/type/323').then(res => {
// if (res.code == 0) {
// // #ifdef MP-WEIXIN
// this.$queue.setData('XCXIsSelect', res.data.value);
// // #endif
// // #ifndef MP-WEIXIN
// this.$queue.setData('XCXIsSelect', '是');
// // #endif
// }
// });
// #ifdef APP-PLUS
if (uni.getSystemInfoSync().platform == 'android') {
let clientid = plus.push.getClientInfo().clientid;
let userId = this.$queue.getData('userId');
if (userId) {
this.$Request.postT('/user/updateShopClientId?clientId=' + clientid).then(
res => {});
}
}
//#endif
},
methods: {
},
onHide: function() {
console.log('App Hide')
},
}
</script>
<style lang="scss">
/*每个页面公共css */
@import "uview-ui/index.scss";
@import 'components/colorui/main.css';
@import 'components/colorui/icon.css';
</style>

View File

@@ -1 +0,0 @@
#tcwm-uniapp-shop

87
common/cache.js Normal file
View File

@@ -0,0 +1,87 @@
/**
* 缓存数据优化
* var cache = require('utils/cache.js');
* import cache from '../cache'
* 使用方法 【
* 一、设置缓存
* string cache.put('k', 'string你好啊');
* json cache.put('k', { "b": "3" }, 2);
* array cache.put('k', [1, 2, 3]);
* boolean cache.put('k', true);
* 二、读取缓存
* 默认值 cache.get('k')
* string cache.get('k', '你好')
* json cache.get('k', { "a": "1" })
* 三、移除/清理
* 移除: cache.remove('k');
* 清理cache.clear();
* 】
* @type {String}
*/
var postfix = '_mallStore'; // 缓存前缀
/**
* 设置缓存
* @param {[type]} k [键名]
* @param {[type]} v [键值]
* @param {[type]} t [时间、单位秒]
*/
function put(k, v, t) {
uni.setStorageSync(k, v)
var seconds = parseInt(t);
if (seconds > 0) {
var timestamp = Date.parse(new Date());
timestamp = timestamp / 1000 + seconds;
uni.setStorageSync(k + postfix, timestamp + "")
} else {
uni.removeStorageSync(k + postfix)
}
}
/**
* 获取缓存
* @param {[type]} k [键名]
* @param {[type]} def [获取为空时默认]
*/
function get(k, def) {
var deadtime = parseInt(uni.getStorageSync(k + postfix))
if (deadtime) {
if (parseInt(deadtime) < Date.parse(new Date()) / 1000) {
if (def) {
return def;
} else {
return false;
}
}
}
var res = uni.getStorageSync(k);
if (res) {
return res;
} else {
if (def == undefined || def == "") {
def = false;
}
return def;
}
}
function remove(k) {
uni.removeStorageSync(k);
uni.removeStorageSync(k + postfix);
}
/**
* 清理所有缓存
* @return {[type]} [description]
*/
function clear() {
uni.clearStorageSync();
}
module.exports = {
put: put,
get: get,
remove: remove,
clear: clear,
}

18
common/config.js Normal file
View File

@@ -0,0 +1,18 @@
const ROOTPATHA = "https://tcwm.xianmaxiong.com/sqx_fast";
const ROOTPATH = "https://tcwm.xianmaxiong.com/sqx_fast";
const ROOTPATH1 = "https://tcwm.xianmaxiong.com/sqx_fast";
const ROOTPATH2 = "wss://tcwm.xianmaxiong.com/wss/websocket/"; //联系客服
const ROOTPATH3 = "wss://tcwm.xianmaxiong.com/wss/ordersChat/"; //聊天
// const ROOTPATHA = "http://192.168.0.132:8171/sqx_fast";
// const ROOTPATH = "http://192.168.0.132:8171/sqx_fast";
// const ROOTPATH1 = "http://192.168.0.132:8171/sqx_fast";
// const ROOTPATH2 = "ws://192.168.0.128:8171/sqx_fast/websocket/"; //联系客服
// const ROOTPATH3 = "ws://192.168.0.128:8171/sqx_fast/ordersChat/"; //聊天
module.exports = {
APIHOST: ROOTPATH,
APIHOST1: ROOTPATH1,
WSHOST: ROOTPATH2,
WSHOST1: ROOTPATH3,
APIHOSTA: ROOTPATHA,
};

559
common/httpRequest.js Normal file
View File

@@ -0,0 +1,559 @@
import configdata from './config'
import cache from './cache'
module.exports = {
config: function(name) {
var info = null;
if (name) {
var name2 = name.split("."); //字符分割
if (name2.length > 1) {
info = configdata[name2[0]][name2[1]] || null;
} else {
info = configdata[name] || null;
}
if (info == null) {
let web_config = cache.get("web_config");
if (web_config) {
if (name2.length > 1) {
info = web_config[name2[0]][name2[1]] || null;
} else {
info = web_config[name] || null;
}
}
}
}
return info;
},
post: function(url, data, header) {
header = header || "application/x-www-form-urlencoded";
url = this.config("APIHOST") + url;
let token = uni.getStorageSync("shopToken");
// let token = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIxMzMwIiwiaWF0IjoxNjQzMTAyNTcyLCJleHAiOjE2NDU2OTQ1NzJ9.UJhS7Nmj495d-CfCNm9VTenuwxV0z4J8Vl9CAlftXt89zrmQtebXDLmS8f25l8He_dnTUxAfjlKVWSsyYnKs6A'
return new Promise((succ, error) => {
uni.request({
url: url,
data: data,
method: "POST",
header: {
"content-type": header,
"token": token
},
success: function(result) {
if (result.data.code == 401 && token) {
uni.removeStorageSync("token")
uni.removeStorageSync("userId")
uni.removeStorageSync("phone")
uni.removeStorageSync("openid")
uni.removeStorageSync("userName")
uni.removeStorageSync("relation")
uni.removeStorageSync("relation_id")
uni.removeStorageSync("isInvitation")
uni.removeStorageSync("zhiFuBao")
uni.removeStorageSync("zhiFuBaoName")
uni.showModal({
title: '提示',
content: '用户信息失效,请重新登录!',
showCancel: false, // 是否显示取消按钮,默认为 true // 是否显示取消按钮,默认为 true
success: function(res) {
if (res.confirm) {
uni.redirectTo({
url: '/pages/my/loginphone'
})
}
}
});
}
succ.call(self, result.data)
},
fail: function(e) {
error.call(self, e)
}
})
})
},
postT: function(url, data, header) {
header = header || "application/x-www-form-urlencoded";
url = this.config("APIHOST1") + url;
let token = uni.getStorageSync("shopToken");
if (token) {
return new Promise((succ, error) => {
uni.request({
url: url,
data: data,
method: "POST",
header: {
"content-type": header,
"token": token
},
success: function(result) {
if (result.data.code == 401 && token) {
uni.removeStorageSync("token")
uni.removeStorageSync("userId")
uni.removeStorageSync("phone")
uni.removeStorageSync("openid")
uni.removeStorageSync("userName")
uni.removeStorageSync("relation")
uni.removeStorageSync("relation_id")
uni.removeStorageSync("isInvitation")
uni.removeStorageSync("zhiFuBao")
uni.removeStorageSync("zhiFuBaoName")
uni.showModal({
title: '提示',
content: '用户信息失效,请重新登录!',
showCancel: false, // 是否显示取消按钮,默认为 true
success: function(res) {
if (res.confirm) {
uni.redirectTo({
url: '/pages/my/loginphone'
})
}
}
});
}
succ.call(self, result.data)
},
fail: function(e) {
error.call(self, e)
}
})
})
} else {
return new Promise((succ, error) => {
uni.request({
url: url,
data: data,
method: "POST",
header: {
"content-type": header,
},
success: function(result) {
succ.call(self, result.data)
},
fail: function(e) {
error.call(self, e)
}
})
})
}
},
postJson: function(url, data, header) {
header = header || "application/json";
url = this.config("APIHOST1") + url;
let token = uni.getStorageSync("shopToken");
if (token) {
return new Promise((succ, error) => {
uni.request({
url: url,
data: data,
method: "POST",
header: {
"content-type": header,
"token": token
},
success: function(result) {
if (result.data.code == 401 && token) {
uni.removeStorageSync("token")
uni.removeStorageSync("userId")
uni.removeStorageSync("phone")
uni.removeStorageSync("openid")
uni.removeStorageSync("userName")
uni.removeStorageSync("relation")
uni.removeStorageSync("relation_id")
uni.removeStorageSync("isInvitation")
uni.removeStorageSync("zhiFuBao")
uni.removeStorageSync("zhiFuBaoName")
uni.showModal({
title: '提示',
content: '用户信息失效,请重新登录!',
showCancel: false, // 是否显示取消按钮,默认为 true
success: function(res) {
if (res.confirm) {
uni.redirectTo({
url: '/pages/my/loginphone'
})
}
}
});
}
succ.call(self, result.data)
},
fail: function(e) {
error.call(self, e)
}
})
})
} else {
return new Promise((succ, error) => {
uni.request({
url: url,
data: data,
method: "POST",
header: {
"content-type": header,
},
success: function(result) {
succ.call(self, result.data)
},
fail: function(e) {
error.call(self, e)
}
})
})
}
},
getT: function(url, data, header) {
header = header || "application/x-www-form-urlencoded";
url = this.config("APIHOST1") + url;
let token = uni.getStorageSync("shopToken");
if (token) {
return new Promise((succ, error) => {
uni.request({
url: url,
data: data,
method: "GET",
header: {
"content-type": header,
"token": token
},
success: function(result) {
if (result.data.code == 401 && token) {
uni.removeStorageSync("token")
uni.removeStorageSync("userId")
uni.removeStorageSync("phone")
uni.removeStorageSync("openid")
uni.removeStorageSync("userName")
uni.removeStorageSync("relation")
uni.removeStorageSync("relation_id")
uni.removeStorageSync("isInvitation")
uni.removeStorageSync("zhiFuBao")
uni.removeStorageSync("zhiFuBaoName")
uni.showModal({
title: '提示',
content: '用户信息失效,请重新登录!',
showCancel: false, // 是否显示取消按钮,默认为 true
success: function(res) {
if (res.confirm) {
uni.redirectTo({
url: '/pages/my/loginphone'
})
}
}
});
}
succ.call(self, result.data)
},
fail: function(e) {
error.call(self, e)
}
})
})
} else {
return new Promise((succ, error) => {
uni.request({
url: url,
data: data,
method: "GET",
header: {
"content-type": header
},
success: function(result) {
succ.call(self, result.data)
},
fail: function(e) {
error.call(self, e)
}
})
})
}
},
get: function(url, data, header) {
header = header || "application/x-www-form-urlencoded";
url = this.config("APIHOST") + url;
let token = uni.getStorageSync("shopToken");
return new Promise((succ, error) => {
uni.request({
url: url,
data: data,
method: "GET",
header: {
"content-type": header,
"token": token
},
success: function(result) {
if (result.data.code == 401 && token) {
uni.removeStorageSync("token")
uni.removeStorageSync("userId")
uni.removeStorageSync("phone")
uni.removeStorageSync("openid")
uni.removeStorageSync("userName")
uni.removeStorageSync("relation")
uni.removeStorageSync("relation_id")
uni.removeStorageSync("isInvitation")
uni.removeStorageSync("zhiFuBao")
uni.removeStorageSync("zhiFuBaoName")
uni.showModal({
title: '提示',
content: '用户信息失效,请重新登录!',
showCancel: false, // 是否显示取消按钮,默认为 true
success: function(res) {
if (res.confirm) {
uni.redirectTo({
url: '/pages/my/loginphone'
})
}
}
});
}
succ.call(self, result.data)
},
fail: function(e) {
error.call(self, e)
}
})
})
},
getMsg: function(url, data, header) {
header = header || "application/x-www-form-urlencoded";
url = this.config("APIHOST2") + url;
let token = uni.getStorageSync("shopToken");
return new Promise((succ, error) => {
uni.request({
url: url,
data: data,
method: "GET",
header: {
"content-type": header,
"token": token
},
success: function(result) {
if (result.data.code == 401 && token) {
uni.removeStorageSync("token")
uni.removeStorageSync("userId")
uni.removeStorageSync("phone")
uni.removeStorageSync("openid")
uni.removeStorageSync("userName")
uni.removeStorageSync("relation")
uni.removeStorageSync("relation_id")
uni.removeStorageSync("isInvitation")
uni.removeStorageSync("zhiFuBao")
uni.removeStorageSync("zhiFuBaoName")
uni.showModal({
title: '提示',
content: '用户信息失效,请重新登录!',
showCancel: false, // 是否显示取消按钮,默认为 true
success: function(res) {
if (res.confirm) {
uni.redirectTo({
url: '/pages/my/loginphone'
})
}
}
});
}
succ.call(self, result.data)
},
fail: function(e) {
error.call(self, e)
}
})
})
},
// 家政
getJ: function(url, data, header) {
header = header || "application/x-www-form-urlencoded";
url = this.config("APIHOSTJ") + url;
let token = uni.getStorageSync("shopToken");
return new Promise((succ, error) => {
uni.request({
url: url,
data: data,
method: "GET",
header: {
"content-type": header,
"token": token
},
success: function(result) {
succ.call(self, result.data)
},
fail: function(e) {
error.call(self, e)
}
})
})
},
// 商户接口
getA: function(url, data, header) {
header = header || "application/x-www-form-urlencoded";
url = this.config("APIHOSTA") + url;
let token = uni.getStorageSync("shopToken");
// let token =uni.getStorageSync("shopToken")?uni.getStorageSync("shopToken"):'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIxMzMwIiwiaWF0IjoxNjQzMTAyNTcyLCJleHAiOjE2NDU2OTQ1NzJ9.UJhS7Nmj495d-CfCNm9VTenuwxV0z4J8Vl9CAlftXt89zrmQtebXDLmS8f25l8He_dnTUxAfjlKVWSsyYnKs6A'
return new Promise((succ, error) => {
uni.request({
url: url,
data: data,
method: "GET",
header: {
"content-type": header,
"token": token
},
success: function(result) {
if (result.data.code == 401 && token) {
uni.removeStorageSync("shopToken")
uni.removeStorageSync("token")
uni.removeStorageSync("userId")
uni.removeStorageSync("phone")
uni.removeStorageSync("openid")
uni.removeStorageSync("userName")
uni.removeStorageSync("relation")
uni.removeStorageSync("relation_id")
uni.removeStorageSync("isInvitation")
uni.removeStorageSync("zhiFuBao")
uni.removeStorageSync("zhiFuBaoName")
uni.showModal({
title: '提示',
content: '用户信息失效,请重新登录!',
showCancel: false, // 是否显示取消按钮,默认为 true // 是否显示取消按钮,默认为 true
success: function(res) {
if (res.confirm) {
uni.redirectTo({
url: '/pages/my/loginphone'
})
}
}
});
}
succ.call(self, result.data)
},
fail: function(e) {
error.call(self, e)
}
})
})
},
postA: function(url, data, header) {
header = header || "application/x-www-form-urlencoded";
url = this.config("APIHOSTA") + url;
let token = uni.getStorageSync("shopToken");
return new Promise((succ, error) => {
uni.request({
url: url,
data: data,
method: "POST",
header: {
"content-type": header,
"token": token
},
success: function(result) {
if (result.data.code == 401 && token) {
uni.removeStorageSync("shopToken")
uni.removeStorageSync("token")
uni.removeStorageSync("userId")
uni.removeStorageSync("phone")
uni.removeStorageSync("openid")
uni.removeStorageSync("userName")
uni.removeStorageSync("relation")
uni.removeStorageSync("relation_id")
uni.removeStorageSync("isInvitation")
uni.removeStorageSync("zhiFuBao")
uni.removeStorageSync("zhiFuBaoName")
uni.showModal({
title: '提示',
content: '用户信息失效,请重新登录!',
showCancel: false, // 是否显示取消按钮,默认为 true // 是否显示取消按钮,默认为 true // 是否显示取消按钮,默认为 true
success: function(res) {
if (res.confirm) {
uni.redirectTo({
url: '/pages/my/loginphone'
})
}
}
});
}
succ.call(self, result.data)
},
fail: function(e) {
error.call(self, e)
}
})
})
},
postJsonA: function(url, data, header) {
header = header || "application/json";
url = this.config("APIHOSTA") + url;
let token = uni.getStorageSync("shopToken");
// let token =uni.getStorageSync("shopToken")?uni.getStorageSync("shopToken"):'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIxMzMwIiwiaWF0IjoxNjQzMTAyNTcyLCJleHAiOjE2NDU2OTQ1NzJ9.UJhS7Nmj495d-CfCNm9VTenuwxV0z4J8Vl9CAlftXt89zrmQtebXDLmS8f25l8He_dnTUxAfjlKVWSsyYnKs6A'
if (token) {
return new Promise((succ, error) => {
uni.request({
url: url,
data: data,
method: "POST",
header: {
"content-type": header,
"token": token
},
success: function(result) {
if (result.data.code == 401 && token) {
uni.removeStorageSync("shopToken")
uni.removeStorageSync("token")
uni.removeStorageSync("userId")
uni.removeStorageSync("phone")
uni.removeStorageSync("openid")
uni.removeStorageSync("userName")
uni.removeStorageSync("relation")
uni.removeStorageSync("relation_id")
uni.removeStorageSync("isInvitation")
uni.removeStorageSync("zhiFuBao")
uni.removeStorageSync("zhiFuBaoName")
uni.showModal({
title: '提示',
content: '用户信息失效,请重新登录!',
showCancel: false, // 是否显示取消按钮,默认为 true // 是否显示取消按钮,默认为 true // 是否显示取消按钮,默认为 true
success: function(res) {
if (res.confirm) {
uni.redirectTo({
url: '/pages/my/loginphone'
})
}
}
});
}
succ.call(self, result.data)
},
fail: function(e) {
error.call(self, e)
}
})
})
} else {
return new Promise((succ, error) => {
uni.request({
url: url,
data: data,
method: "POST",
header: {
"content-type": header,
},
success: function(result) {
succ.call(self, result.data)
},
fail: function(e) {
error.call(self, e)
}
})
})
}
},
}

190
common/queue.js Normal file
View File

@@ -0,0 +1,190 @@
/**
*
* @author maxd
* @date 2019.8.1
*/
module.exports = {
getUUID () {
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, c => {
return (c === 'x' ? (Math.random() * 16 | 0) : ('r&0x3' | '0x8')).toString(16)
})
},
//微信的appId
getWxAppid() {
return 'wx41da4b0848b8baae'
},
//全局邀请码
getInvitation() {
return uni.getStorageSync("publicRelation")
},
//获取APP下载地址
getAppDownUrl() {
return uni.getStorageSync("appurl")
},
//全局域名 部分html中需要单独替换 需要修改config中的网络请求域名
publicYuMing() {
return 'https://diancan.xianmxkj.com'
},
logout() {
this.remove("token");
this.remove("userId");
this.remove("mobile");
this.remove("openid");
this.remove("nickName");
this.remove("relation");
this.remove("image_url");
this.remove("relation_id");
this.remove("isInvitation");
this.remove("member");
},
loginClear() {
this.remove("token");
this.remove("userId");
this.remove("mobile");
this.remove("nickName");
this.remove("image_url");
this.remove("relation_id");
this.remove("isInvitation");
this.remove("member");
},
showLoading(title) {
uni.showLoading({
title: title
});
},
showToast(title) {
uni.showToast({
title: title,
mask: false,
duration: 2000,
icon: "none"
});
},
setJson: function(key, value) {
let jsonString = JSON.stringify(value);
try {
uni.setStorageSync(key, jsonString);
} catch (e) {
// error
}
},
setData: function(key, value) {
try {
uni.setStorageSync(key, value);
} catch (e) {
// error
}
},
getData: function(key) {
try {
const value = uni.getStorageSync(key);
if (value) {
return value;
}
} catch (e) {
// error
}
},
getJson: function(key) {
try {
const value = uni.getStorageSync(key);
if (value) {
return JSON.parse(value);
}
} catch (e) {
// error
}
},
clear: function() {
uni.clearStorage();
},
get: function(key) { //获取队列里面全部的数据
let data = this.getJson(key);
if (data instanceof Array) {
return data;
}
return [];
},
insert: function(param) { //队列插入数据
param.capacityNum = param.capacityNum || 100; //队列容量 默认队列中超过100条数据自动删除尾部
let data = this.getJson(param.key);
if (data instanceof Array) {
if (data.length > param.capacityNum) {
let total = data.length - param.capacityNum;
for (let i = 0; i < total; i++) {
data.pop();
}
}
data.unshift(param.value);
} else {
data = [];
data.push(param.value);
}
this.setJson(param.key, data);
},
removeItem: function(key, itemIds) { //提供itemIds数组 批量删除队列中的某项数据
let data = this.getJson(key);
if (data instanceof Array) {
for (let i = 0; i < itemIds.length; i++) {
for (let p = 0; p < data.length; p++) {
if (itemIds[i] === data[p].itemid) {
data.splice(p, 1);
break;
}
}
}
this.setJson(key, data);
}
},
isExist: function(key, itemId) { //检测某条数据在队列中是否存在
let data = this.getJson(key);
if (data instanceof Array) {
for (let p = 0; p < data.length; p++) {
if (itemId === data[p].itemid) {
return true;
}
}
}
return false;
},
isExistPdd: function(key, itemId) { //检测某条数据在队列中是否存在
let data = this.getJson(key);
if (data instanceof Array) {
for (let p = 0; p < data.length; p++) {
if (itemId === data[p].goodsId) {
return true;
}
}
}
return false;
},
isExistJd: function(key, itemId) { //检测某条数据在队列中是否存在
let data = this.getJson(key);
if (data instanceof Array) {
for (let p = 0; p < data.length; p++) {
if (itemId === data[p].skuId) {
return true;
}
}
}
return false;
},
remove: function(key) { //删除某条队列
try {
uni.removeStorageSync(key);
//localStorage.removeItem(key)
} catch (e) {
// error
}
},
getCount: function(key) { //获取队列中全部数据数量
let data = this.getJson(key);
if (data instanceof Array) {
return data.length;
}
return 0;
},
};

14
common/share.js Normal file
View File

@@ -0,0 +1,14 @@
export default {
onShareAppMessage(res) { //发送给朋友
return {
title: uni.getStorageSync('tuiguang'),
imageUrl: uni.getStorageSync('tuiguangImg'),
}
},
onShareTimeline(res) { //分享到朋友圈
return {
title: uni.getStorageSync('tuiguang'),
imageUrl: uni.getStorageSync('tuiguangImg'),
}
},
}

View File

@@ -0,0 +1,184 @@
/*
Animation 微动画
基于ColorUI组建库的动画模块 by 文晓港 2019年3月26日19:52:28
*/
/* css 滤镜 控制黑白底色gif的 */
.gif-black{
mix-blend-mode: screen;
}
.gif-white{
mix-blend-mode: multiply;
}
/* Animation css */
[class*=animation-] {
animation-duration: .5s;
animation-timing-function: ease-out;
animation-fill-mode: both
}
.animation-fade {
animation-name: fade;
animation-duration: .8s;
animation-timing-function: linear
}
.animation-scale-up {
animation-name: scale-up
}
.animation-scale-down {
animation-name: scale-down
}
.animation-slide-top {
animation-name: slide-top
}
.animation-slide-bottom {
animation-name: slide-bottom
}
.animation-slide-left {
animation-name: slide-left
}
.animation-slide-right {
animation-name: slide-right
}
.animation-shake {
animation-name: shake
}
.animation-reverse {
animation-direction: reverse
}
@keyframes fade {
0% {
opacity: 0
}
100% {
opacity: 1
}
}
@keyframes scale-up {
0% {
opacity: 0;
transform: scale(.2)
}
100% {
opacity: 1;
transform: scale(1)
}
}
@keyframes scale-down {
0% {
opacity: 0;
transform: scale(1.8)
}
100% {
opacity: 1;
transform: scale(1)
}
}
@keyframes slide-top {
0% {
opacity: 0;
transform: translateY(-100%)
}
100% {
opacity: 1;
transform: translateY(0)
}
}
@keyframes slide-bottom {
0% {
opacity: 0;
transform: translateY(100%)
}
100% {
opacity: 1;
transform: translateY(0)
}
}
@keyframes shake {
0%,
100% {
transform: translateX(0)
}
10% {
transform: translateX(-9px)
}
20% {
transform: translateX(8px)
}
30% {
transform: translateX(-7px)
}
40% {
transform: translateX(6px)
}
50% {
transform: translateX(-5px)
}
60% {
transform: translateX(4px)
}
70% {
transform: translateX(-3px)
}
80% {
transform: translateX(2px)
}
90% {
transform: translateX(-1px)
}
}
@keyframes slide-left {
0% {
opacity: 0;
transform: translateX(-100%)
}
100% {
opacity: 1;
transform: translateX(0)
}
}
@keyframes slide-right {
0% {
opacity: 0;
transform: translateX(100%)
}
100% {
opacity: 1;
transform: translateX(0)
}
}

View File

@@ -0,0 +1,65 @@
<template>
<view>
<view class="cu-custom" :style="[{height:CustomBar + 'px'}]">
<view class="cu-bar fixed" :style="style" :class="[bgImage!=''?'none-bg text-white bg-img':'',bgColor]">
<view class="action" @tap="BackPage" v-if="isBack">
<text class="cuIcon-back"></text>
<slot name="backText"></slot>
</view>
<view class="content" :style="[{top:StatusBar + 'px'}]">
<slot name="content"></slot>
</view>
<slot name="right"></slot>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
StatusBar: this.StatusBar,
CustomBar: this.CustomBar
};
},
name: 'cu-custom',
computed: {
style() {
var StatusBar= this.StatusBar;
var CustomBar= this.CustomBar;
var bgImage = this.bgImage;
var style = `height:${CustomBar}px;padding-top:${StatusBar}px;`;
if (this.bgImage) {
style = `${style}background-image:url(${bgImage});`;
}
return style
}
},
props: {
bgColor: {
type: String,
default: ''
},
isBack: {
type: [Boolean, String],
default: false
},
bgImage: {
type: String,
default: ''
},
},
methods: {
BackPage() {
uni.navigateBack({
delta: 1
});
}
}
}
</script>
<style>
</style>

1226
components/colorui/icon.css Normal file

File diff suppressed because one or more lines are too long

3912
components/colorui/main.css Normal file

File diff suppressed because it is too large Load Diff

312
components/com-input.vue Normal file
View File

@@ -0,0 +1,312 @@
<template>
<view>
<view class="mix-list-cell" :class="border" hover-class="cell-hover" :hover-stay-time="50">
<text class="cell-tit">{{title}}</text>
<input class="main-input" :value="value" :type="_type" placeholder-class="placeholder-class"
:maxlength="maxlength" :placeholder="placeholder" :password="type==='password'&&!showPassword"
@input="onInput" :disabled="readOnly" />
<!-- 是否可见密码 -->
<image v-if="_isShowPass&&type==='password'&&!_isShowCode" class="img cuIcon"
:class="showPassword?'cuIcon-attention':'cuIcon-attentionforbid'" @tap="showPass"></image>
<!-- 倒计时 -->
<view v-if="_isShowCode&&!_isShowPass" :class="['vercode',{'vercode-run': second>0}]" @click="setCode">
{{ getVerCodeSecond }}
</view>
</view>
</view>
</template>
<script>
var _this, countDown;
/**
* 简单封装了下, 应用范围比较狭窄,可以在此基础上进行扩展使用
* 比如加入image iconSize可控等
*/
export default {
data() {
return {
showPassword: false, //是否显示明文
second: 0, //倒计时
isRunCode: false, //是否开始倒计时
typeList: {
left: 'icon-zuo',
right: 'icon-you',
up: 'icon-shang',
down: 'icon-xia'
},
}
},
props: {
readOnly: {
//是否显示获取验证码(二选一)
type: [Boolean, String],
default: false,
},
type: String, //类型
logo: String, //类型
value: String, //值
placeholder: String, //框内提示
isShowCode: {
//是否显示获取验证码(二选一)
type: [Boolean, String],
default: false,
},
codeText: {
type: String,
default: "获取验证码",
},
setTime: {
//倒计时时间设置
type: [Number, String],
default: 60,
},
maxlength: {
//最大长度
type: [Number, String],
default: 30,
},
isShowPass: {
//是否显示密码图标(二选一)
type: [Boolean, String],
default: false,
},
icon: {
type: String,
default: ''
},
title: {
type: String,
default: '标题'
},
tips: {
type: String,
default: ''
},
navigateType: {
type: String,
default: 'right'
},
border: {
type: String,
default: 'b-b'
},
hoverClass: {
type: String,
default: 'cell-hover'
},
iconColor: {
type: String,
default: '#333'
}
},
mounted() {
_this = this
//准备触发
this.$on('runCodes', (val) => {
this.runCodes(val);
});
clearInterval(countDown); //先清理一次循环,避免缓存
},
methods: {
showPass() {
//是否显示密码
this.showPassword = !this.showPassword
},
onInput(e) {
//传出值
this.$emit('input', e.target.value)
},
setCode() {
//设置获取验证码的事件
if (this.isRunCode) {
//判断是否开始倒计时,避免重复点击
return false;
}
this.$emit('setCode')
},
runCodes(val) {
console.error("runCodes")
//开始倒计时
if (String(val) == "0") {
//判断是否需要终止循环
this.second = 0; //初始倒计时
clearInterval(countDown); //清理循环
this.isRunCode = false; //关闭循环状态
return false;
}
if (this.isRunCode) {
//判断是否开始倒计时,避免重复点击
return false;
}
this.isRunCode = true
this.second = this._setTime //倒数秒数
let _this = this;
countDown = setInterval(function() {
_this.second--
if (_this.second == 0) {
_this.isRunCode = false
clearInterval(countDown)
}
}, 1000)
}
},
computed: {
_type() {
//处理值
const type = this.type
return type == 'password' ? 'text' : type
},
_isShowPass() {
//处理值
return String(this.isShowPass) !== 'false'
},
_isShowCode() {
//处理值
return String(this.isShowCode) !== 'false'
},
_setTime() {
//处理值
const setTime = Number(this.setTime)
return setTime > 0 ? setTime : 60
},
getVerCodeSecond() {
//验证码倒计时计算
if (this.second <= 0) {
return this.codeText;
} else {
if (this.second < 10) {
return '0' + this.second + "s";
} else {
return this.second + "s";
}
}
}
}
}
</script>
<style lang='scss'>
.main-input {
flex: 1;
text-align: left;
/* color: white; */
font-size: 16px;
padding-right: 6px;
margin-left: 10px;
border: 1rpx solid #d9d9d9;
height: 90rpx;
border-radius: 10rpx;
padding: 0px 10px;
}
.icon .mix-list-cell.b-b:after {
left: 45px;
}
.placeholder-class {
color: white;
opacity: 0.5;
}
.mix-list-cell {
border-radius: 32upx;
margin-top: 1px;
font-size: 32upx;
background: #ffffff;
text-align: left;
display: flex;
margin: 32upx;
/* padding: 24upx 32upx; */
position: relative;
&.cell-hover {
background: transparent;
}
&.b-b:after {
left: 16px;
}
.cell-icon {
align-self: center;
width: 28px;
max-height: 30px;
font-size: 18px;
}
.cell-more {
align-self: center;
font-size: 16px;
color: #606266;
margin-left: 10px;
}
.cell-tit {
width: 80px;
font-size: 16px;
/* color: white; */
display: flex;
align-items: center;
}
.cell-tip {
font-size: 14px;
color: white;
}
}
.items {
position: absolute;
height: 48px;
width: 100%;
background: #FFFFFF;
/*opacity:0.05;*/
}
.main-list {
opacity: 0.8;
z-index: 88;
background: white;
border: 1px solid white;
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
height: 18px;
/* Input 高度 */
color: #333333;
padding: 16px;
margin-top: 12px;
margin-bottom: 12px;
}
.img {
width: 16px;
height: 16px;
font-size: 16px;
}
.vercode {
color: #e10a07;
font-size: 14px;
}
.vercode-run {
color: black !important;
}
.oBorder {
border-radius: 2.5rem;
-webkit-box-shadow: 0 0 30px 0 rgba(43, 86, 112, .1);
box-shadow: 0 0 30px 0 rgba(43, 86, 112, .1);
}
</style>

71
components/empty.vue Normal file
View File

@@ -0,0 +1,71 @@
<template>
<view class="page-box">
<view class="centre">
<image src="../static/images/img/empty.png" mode=""></image>
<view class="tips">
{{content}}
</view>
</view>
</view>
</template>
<script>
export default {
props: {
content: {
type: String,
default: '暂无内容'
}
}
}
</script>
<style lang="scss" scoped>
.page-box {
position: relative;
// left: 0;
// height: 90vh;
z-index: 0;
top: 0px;
background: #ffffff;
height: 100vh;
}
.centre {
position: absolute;
left: 0;
top: 0;
right: 0;
bottom: 0;
margin: auto;
height: 400rpx;
text-align: center;
// padding: 200rpx auto;
font-size: 32rpx;
image {
width: 387rpx;
height: 341rpx;
// margin-bottom: 20rpx;
margin: 0 auto 20rpx;
// border: 1px dotted #000000;
}
.tips {
font-size: 32rpx;
color: #2F3044;
margin-top: 20rpx;
font-weight: 700;
}
.btn {
margin: 80rpx auto;
width: 600rpx;
border-radius: 32rpx;
line-height: 90rpx;
color: #ffffff;
font-size: 34rpx;
background: #5074FF;
}
}
</style>

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,109 @@
<template>
<view>
<!-- 按钮 -->
<button :class="['buttonBorder',!_rotate?'dlbutton':'dlbutton_loading']" :style="{'background':bgColor, 'color': fontColor}">
<view :class="_rotate?'rotate_loop':''">
<text v-if="_rotate" class="cuIcon cuIcon-loading1 "></text>
<text v-if="!_rotate">{{ text }}</text>
</view>
</button>
</view>
</template>
<script>
export default{
props:{
text: String, //显示文本
rotate:{
//是否启动加载
type: [Boolean,String],
default: false,
},
bgColor:{
//按钮背景颜色
type: String,
// default: "linear-gradient(to right, rgba(0,0,0,0.7), rgba(0,0,0,0.6))",
},
fontColor:{
//按钮字体颜色
type: String,
default: "#000000",
},
},
computed:{
_rotate() {
//处理值
return String(this.rotate) !== 'false'
},
}
}
</script>
<style>
@import url("./css/icon.css");
.dlbutton {
/* color: #FFFFFF; */
font-size: 30upx;
width:601upx;
height:90upx;
/* background: #352680; */
background: #FCD202;
box-shadow:0upx 0upx 13upx 0upx rgba(164,217,228,0.4);
border-radius:2.5rem;
line-height: 90upx;
text-align: center;
margin-left: auto;
margin-right: auto;
margin-top: 96upx;
}
.dlbutton_loading {
color: #FFFFFF;
font-size: 30upx;
width:100upx;
height:100upx;
background: #5E81F9;
box-shadow:0upx 0upx 13upx 0upx rgba(164,217,228,0.4);
border-radius:2.5rem;
line-height: 100upx;
text-align: center;
margin-left: auto;
margin-right: auto;
margin-top: 96upx;
}
.buttonBorder{
border: none ;
border-radius: 2.5rem ;
-webkit-box-shadow: 0 0 60upx 0 rgba(0,0,0,.2) ;
box-shadow: 0 0 60upx 0 rgba(0,0,0,.2) ;
-webkit-transition: all 0.4s cubic-bezier(.57,.19,.51,.95);
-moz-transition: all 0.4s cubic-bezier(.57,.19,.51,.95);
-ms-transition: all 0.4s cubic-bezier(.57,.19,.51,.95);
-o-transition: all 0.4s cubic-bezier(.57,.19,.51,.95);
transition: all 0.4s cubic-bezier(.57,.19,.51,.95);
}
/* 旋转动画 */
.rotate_loop{
-webkit-transition-property: -webkit-transform;
-webkit-transition-duration: 1s;
-moz-transition-property: -moz-transform;
-moz-transition-duration: 1s;
-webkit-animation: rotate 1s linear infinite;
-moz-animation: rotate 1s linear infinite;
-o-animation: rotate 1s linear infinite;
animation: rotate 1s linear infinite;
}
@-webkit-keyframes rotate{from{-webkit-transform: rotate(0deg)}
to{-webkit-transform: rotate(360deg)}
}
@-moz-keyframes rotate{from{-moz-transform: rotate(0deg)}
to{-moz-transform: rotate(359deg)}
}
@-o-keyframes rotate{from{-o-transform: rotate(0deg)}
to{-o-transform: rotate(359deg)}
}
@keyframes rotate{from{transform: rotate(0deg)}
to{transform: rotate(359deg)}
}
</style>

View File

@@ -0,0 +1,223 @@
<template>
<view class="main-list oBorder">
<!-- 文本框 -->
<input
class="main-input"
:value="value"
:type="_type"
:maxlength="maxlength"
:placeholder="placeholder"
:password="type==='password'&&!showPassword"
@input="onInput"
/>
<!-- 是否可见密码 -->
<image
v-if="_isShowPass&&type==='password'&&!_isShowCode"
class="img cuIcon"
:class="showPassword?'cuIcon-attention':'cuIcon-attentionforbid'"
@tap="showPass"
></image>
<!-- 倒计时 -->
<view
v-if="_isShowCode&&!_isShowPass"
:class="['vercode',{'vercode-run': second>0}]"
@click="setCode"
>{{ getVerCodeSecond }}</view>
<view
v-if="_isShowGet"
class="vercode"
@click="setNumberCode"
>官方邀请码</view>
</view>
</template>
<script>
var _this, countDown;
export default{
data(){
return{
showPassword: false, //是否显示明文
second: 0, //倒计时
isRunCode: false, //是否开始倒计时
}
},
props:{
type: String, //类型
value: String, //值
placeholder: String, //框内提示
maxlength: {
//最大长度
type: [Number,String],
default: 20,
},
isShowPass:{
//是否显示密码图标(二选一)
type: [Boolean,String],
default: false,
},
isShowCode:{
//是否显示获取验证码(二选一)
type: [Boolean,String],
default: false,
},
isShowGet:{
//是否显示获取验证码(二选一)
type: [Boolean,String],
default: false,
},
codeText:{
type: String,
default: "获取验证码",
},
setTime:{
//倒计时时间设置
type: [Number,String],
default: 60,
}
},
model: {
prop: 'value',
event: 'input'
},
mounted() {
_this=this
//准备触发
this.$on('runCode',(val)=>{
this.runCode(val);
});
clearInterval(countDown);//先清理一次循环,避免缓存
},
methods:{
showPass(){
//是否显示密码
this.showPassword = !this.showPassword
},
onInput(e) {
//传出值
this.$emit('input', e.target.value)
},
setCode(){
//设置获取验证码的事件
if(this.isRunCode){
//判断是否开始倒计时,避免重复点击
return false;
}
this.$emit('setCode')
},
setNumberCode(){
this.$emit('setNumberCode')
},
runCode(val){
//开始倒计时
if(String(val)=="0"){
//判断是否需要终止循环
this.second = 0; //初始倒计时
clearInterval(countDown);//清理循环
this.isRunCode= false; //关闭循环状态
return false;
}
if(this.isRunCode){
//判断是否开始倒计时,避免重复点击
return false;
}
this.isRunCode= true
this.second = this._setTime //倒数秒数
let _this=this;
countDown = setInterval(function(){
_this.second--
if(_this.second==0){
_this.isRunCode= false
clearInterval(countDown)
}
},1000)
}
},
computed:{
_type(){
//处理值
const type = this.type
return type == 'password' ? 'text' : type
},
_isShowPass() {
//处理值
return String(this.isShowPass) !== 'false'
},
_isShowCode() {
//处理值
return String(this.isShowCode) !== 'false'
},
_isShowGet() {
//处理值
return String(this.isShowGet) !== 'false'
},
_setTime() {
//处理值
const setTime = Number(this.setTime)
return setTime>0 ? setTime : 60
},
getVerCodeSecond(){
//验证码倒计时计算
if(this.second<=0){
return this.codeText;
}else{
if(this.second<10){
return '0'+this.second;
}else{
return this.second;
}
}
}
}
}
</script>
<style>
@import url("./css/icon.css");
.main-list{
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
height: 90upx; /* Input 高度 */
color: #333333;
padding: 32upx;
margin-top:18upx;
margin-bottom: 18upx;
}
.img{
width: 32upx;
height: 32upx;
font-size: 32upx;
}
.main-input{
flex: 1;
text-align: left;
font-size: 28upx;
/* line-height: 100upx; */
padding-right: 10upx;
margin-left: 20upx;
}
.vercode {
color: rgba(0,0,0,0.7);
font-size: 24upx;
line-height: 100upx;
}
.vercode-run {
color: rgba(0,0,0,0.4) !important;
}
.oBorder{
border: none;
border-radius: 2.5rem ;
-webkit-box-shadow: 0 0 60upx 0 rgba(43,86,112,.1) ;
box-shadow: 0 0 60upx 0 rgba(43,86,112,.1) ;
}
</style>

8
file/ReadMe.txt Normal file
View File

@@ -0,0 +1,8 @@
同城外卖商户端小程序:
appidwx251e3e099f1a0936
秘钥a9f9e2c8bebd9821882b48852ea47310
包名com.tcwn.shd
别名tcwash
密码123456

BIN
file/shd.keystore Normal file

Binary file not shown.

BIN
file/taobao.jks Normal file

Binary file not shown.

14
index.html Normal file
View File

@@ -0,0 +1,14 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0" />
<title></title>
<!--preload-links-->
<!--app-context-->
</head>
<body>
<div id="app"><!--app-html--></div>
<script type="module" src="/main.js"></script>
</body>
</html>

36
main.js Normal file
View File

@@ -0,0 +1,36 @@
import App from './App'
import HttpRequest from './common/httpRequest'
import HttpCache from './common/cache'
import queue from './common/queue'
Vue.config.productionTip = false
Vue.prototype.$Request = HttpRequest;
Vue.prototype.$queue = queue;
import share from './common/share.js'
Vue.prototype.$Sysconf = HttpRequest.config;
Vue.prototype.$SysCache = HttpCache;
// 引入全局uView
import uView from "uview-ui";
Vue.use(uView);
Vue.mixin(share)
// #ifndef VUE3
import Vue from 'vue'
Vue.config.productionTip = false
App.mpType = 'app'
const app = new Vue({
...App
})
app.$mount()
// #endif
// #ifdef VUE3
import { createSSRApp } from 'vue'
export function createApp() {
const app = createSSRApp(App)
return {
app
}
}
// #endif

179
manifest.json Normal file
View File

@@ -0,0 +1,179 @@
{
"name" : "同城外卖商户端",
"appid" : "__UNI__49D8BC1",
"description" : "",
"versionName" : "1.0.0",
"versionCode" : "100",
"transformPx" : false,
/* 5+App */
"app-plus" : {
"privacy" : {
"prompt" : "template",
"template" : {
"title" : "服务协议和隐私政策",
"message" : "  请你务必审慎阅读、充分理解“服务协议”和“隐私政策”各条款,包括但不限于:为了更好的向你提供服务,我们需要收集你的设备标识、操作日志等信息用于分析、优化应用性能。<br/>  你可阅读<a href=\"https://tcwmshop.xianmaxiong.com/my/other/xieyi\">《服务协议》</a>和<a href=\"https://tcwmshop.xianmaxiong.com/my/other/mimi\">《隐私政策》</a>了解详细信息。如果你同意,请点击下面同意按钮开始接受我们的服务。",
"buttonAccept" : "同意",
"buttonRefuse" : "不同意"
}
},
"usingComponents" : true,
"nvueStyleCompiler" : "uni-app",
"compilerVersion" : 3,
"splashscreen" : {
"alwaysShowBeforeRender" : true,
"waiting" : true,
"autoclose" : true,
"delay" : 0
},
/* */
"modules" : {
"Maps" : {},
"OAuth" : {},
"Payment" : {}
},
/* */
"distribute" : {
/* android */
"android" : {
"permissions" : [
"<uses-feature android:name=\"android.hardware.camera\"/>",
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
"<uses-permission android:name=\"android.permission.INTERNET\"/>",
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
"<uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\"/>",
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
]
},
/* ios */
"ios" : {
"privacyDescription" : {
"NSPhotoLibraryUsageDescription" : "该应用需要读取你的相册,如果不允许,你将无法从系统相册选择照片编辑头像。",
"NSPhotoLibraryAddUsageDescription" : "是否允许此App在你的APP写入照片如果不允许你将无法保存图片到本地。",
"NSCameraUsageDescription" : "是否允许此App使用你的相机如果不允许你将无法使用拍照等功能。",
"NSLocationAlwaysAndWhenInUseUsageDescription" : "是否允许此App使用你的位置如果不允许你将无法获取到您所在位置附近商家。",
"NSAppleMusicUsageDescription" : "App需要您的同意,才能访问媒体资料库权限,如果不允许,你将无法从系统相册选择照片发布需求和修改头像",
"NSLocalNetworkUsageDescription" : "是否允许此App使用你的本地网络权限如果不允许你将无法获取在线内容。",
"NSLocationAlwaysUsageDescription" : "是否允许此App使用你的位置如果不允许你将无法获取到您所在位置附近商家。",
"NSLocationWhenInUseUsageDescription" : "是否允许此App使用你的位置如果不允许你将无法获取到您所在位置附近商家。",
"NSUserTrackingUsageDescription" : "请放心,开启权限不会获取您在其他站点的隐私信息,该权限仅用于标识设备并保障服务安全与提示浏览体验"
},
"dSYMs" : false
},
/* SDK */
"sdkConfigs" : {
"maps" : {
"amap" : {
"appkey_ios" : "0745993c59c890b5bb67ba6595400e76",
"appkey_android" : "7af0ea8202f9f5f8570afa4f262ffbc1"
}
},
"ad" : {},
"oauth" : {
"weixin" : {
"appid" : "wxeaffcaea958472d3",
"appsecret" : "",
"UniversalLinks" : ""
}
},
"payment" : {
"weixin" : {
"__platform__" : [ "ios", "android" ],
"appid" : "wxeaffcaea958472d3",
"UniversalLinks" : ""
}
}
},
"icons" : {
"android" : {
"hdpi" : "unpackage/res/icons/72x72.png",
"xhdpi" : "unpackage/res/icons/96x96.png",
"xxhdpi" : "unpackage/res/icons/144x144.png",
"xxxhdpi" : "unpackage/res/icons/192x192.png"
},
"ios" : {
"appstore" : "unpackage/res/icons/1024x1024.png",
"ipad" : {
"app" : "unpackage/res/icons/76x76.png",
"app@2x" : "unpackage/res/icons/152x152.png",
"notification" : "unpackage/res/icons/20x20.png",
"notification@2x" : "unpackage/res/icons/40x40.png",
"proapp@2x" : "unpackage/res/icons/167x167.png",
"settings" : "unpackage/res/icons/29x29.png",
"settings@2x" : "unpackage/res/icons/58x58.png",
"spotlight" : "unpackage/res/icons/40x40.png",
"spotlight@2x" : "unpackage/res/icons/80x80.png"
},
"iphone" : {
"app@2x" : "unpackage/res/icons/120x120.png",
"app@3x" : "unpackage/res/icons/180x180.png",
"notification@2x" : "unpackage/res/icons/40x40.png",
"notification@3x" : "unpackage/res/icons/60x60.png",
"settings@2x" : "unpackage/res/icons/58x58.png",
"settings@3x" : "unpackage/res/icons/87x87.png",
"spotlight@2x" : "unpackage/res/icons/80x80.png",
"spotlight@3x" : "unpackage/res/icons/120x120.png"
}
}
}
}
},
/* */
"quickapp" : {},
/* */
"mp-weixin" : {
"appid" : "wxcf9fdee37e8a4803",
"setting" : {
"urlCheck" : false,
"minified" : true
},
"usingComponents" : true,
"permission" : {
"scope.userLocation" : {
"desc" : "获取你的位置"
}
},
"optimization" : {
"subPackages" : true
},
"__usePrivacyCheck__" : true,
"requiredPrivateInfos" : [ "getLocation", "chooseLocation" ]
},
"mp-alipay" : {
"usingComponents" : true
},
"mp-baidu" : {
"usingComponents" : true
},
"mp-toutiao" : {
"usingComponents" : true
},
"uniStatistics" : {
"enable" : false
},
"vueVersion" : "2",
"h5" : {
"sdkConfigs" : {
"maps" : {
"qqmap" : {
"key" : "3ZPBZ-XIAWJ-JAXF3-K4S2S-IMGHS-42FN7"
}
}
},
"router" : {
"mode" : "history"
}
}
}

312
my/components/com-input.vue Normal file
View File

@@ -0,0 +1,312 @@
<template>
<view>
<view class="mix-list-cell" :class="border" hover-class="cell-hover" :hover-stay-time="50">
<text class="cell-tit">{{title}}</text>
<input class="main-input" :value="value" :type="_type" placeholder-class="placeholder-class"
:maxlength="maxlength" :placeholder="placeholder" :password="type==='password'&&!showPassword"
@input="onInput" :disabled="readOnly" />
<!-- 是否可见密码 -->
<image v-if="_isShowPass&&type==='password'&&!_isShowCode" class="img cuIcon"
:class="showPassword?'cuIcon-attention':'cuIcon-attentionforbid'" @tap="showPass"></image>
<!-- 倒计时 -->
<view v-if="_isShowCode&&!_isShowPass" :class="['vercode',{'vercode-run': second>0}]" @click="setCode">
{{ getVerCodeSecond }}
</view>
</view>
</view>
</template>
<script>
var _this, countDown;
/**
* 简单封装了下, 应用范围比较狭窄,可以在此基础上进行扩展使用
* 比如加入image iconSize可控等
*/
export default {
data() {
return {
showPassword: false, //是否显示明文
second: 0, //倒计时
isRunCode: false, //是否开始倒计时
typeList: {
left: 'icon-zuo',
right: 'icon-you',
up: 'icon-shang',
down: 'icon-xia'
},
}
},
props: {
readOnly: {
//是否显示获取验证码(二选一)
type: [Boolean, String],
default: false,
},
type: String, //类型
logo: String, //类型
value: String, //值
placeholder: String, //框内提示
isShowCode: {
//是否显示获取验证码(二选一)
type: [Boolean, String],
default: false,
},
codeText: {
type: String,
default: "获取验证码",
},
setTime: {
//倒计时时间设置
type: [Number, String],
default: 60,
},
maxlength: {
//最大长度
type: [Number, String],
default: 30,
},
isShowPass: {
//是否显示密码图标(二选一)
type: [Boolean, String],
default: false,
},
icon: {
type: String,
default: ''
},
title: {
type: String,
default: '标题'
},
tips: {
type: String,
default: ''
},
navigateType: {
type: String,
default: 'right'
},
border: {
type: String,
default: 'b-b'
},
hoverClass: {
type: String,
default: 'cell-hover'
},
iconColor: {
type: String,
default: '#333'
}
},
mounted() {
_this = this
//准备触发
this.$on('runCodes', (val) => {
this.runCodes(val);
});
clearInterval(countDown); //先清理一次循环,避免缓存
},
methods: {
showPass() {
//是否显示密码
this.showPassword = !this.showPassword
},
onInput(e) {
//传出值
this.$emit('input', e.target.value)
},
setCode() {
//设置获取验证码的事件
if (this.isRunCode) {
//判断是否开始倒计时,避免重复点击
return false;
}
this.$emit('setCode')
},
runCodes(val) {
console.error("runCodes")
//开始倒计时
if (String(val) == "0") {
//判断是否需要终止循环
this.second = 0; //初始倒计时
clearInterval(countDown); //清理循环
this.isRunCode = false; //关闭循环状态
return false;
}
if (this.isRunCode) {
//判断是否开始倒计时,避免重复点击
return false;
}
this.isRunCode = true
this.second = this._setTime //倒数秒数
let _this = this;
countDown = setInterval(function() {
_this.second--
if (_this.second == 0) {
_this.isRunCode = false
clearInterval(countDown)
}
}, 1000)
}
},
computed: {
_type() {
//处理值
const type = this.type
return type == 'password' ? 'text' : type
},
_isShowPass() {
//处理值
return String(this.isShowPass) !== 'false'
},
_isShowCode() {
//处理值
return String(this.isShowCode) !== 'false'
},
_setTime() {
//处理值
const setTime = Number(this.setTime)
return setTime > 0 ? setTime : 60
},
getVerCodeSecond() {
//验证码倒计时计算
if (this.second <= 0) {
return this.codeText;
} else {
if (this.second < 10) {
return '0' + this.second + "s";
} else {
return this.second + "s";
}
}
}
}
}
</script>
<style lang='scss'>
.main-input {
flex: 1;
text-align: left;
/* color: white; */
font-size: 16px;
padding-right: 6px;
margin-left: 10px;
border: 1rpx solid #d9d9d9;
height: 90rpx;
border-radius: 10rpx;
padding: 0px 10px;
}
.icon .mix-list-cell.b-b:after {
left: 45px;
}
.placeholder-class {
color: white;
opacity: 0.5;
}
.mix-list-cell {
border-radius: 32upx;
margin-top: 1px;
font-size: 32upx;
background: #ffffff;
text-align: left;
display: flex;
margin: 32upx;
/* padding: 24upx 32upx; */
position: relative;
&.cell-hover {
background: transparent;
}
&.b-b:after {
left: 16px;
}
.cell-icon {
align-self: center;
width: 28px;
max-height: 30px;
font-size: 18px;
}
.cell-more {
align-self: center;
font-size: 16px;
color: #606266;
margin-left: 10px;
}
.cell-tit {
width: 80px;
font-size: 16px;
/* color: white; */
display: flex;
align-items: center;
}
.cell-tip {
font-size: 14px;
color: white;
}
}
.items {
position: absolute;
height: 48px;
width: 100%;
background: #FFFFFF;
/*opacity:0.05;*/
}
.main-list {
opacity: 0.8;
z-index: 88;
background: white;
border: 1px solid white;
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
height: 18px;
/* Input 高度 */
color: #333333;
padding: 16px;
margin-top: 12px;
margin-bottom: 12px;
}
.img {
width: 16px;
height: 16px;
font-size: 16px;
}
.vercode {
color: #e10a07;
font-size: 14px;
}
.vercode-run {
color: black !important;
}
.oBorder {
border-radius: 2.5rem;
-webkit-box-shadow: 0 0 30px 0 rgba(43, 86, 112, .1);
box-shadow: 0 0 30px 0 rgba(43, 86, 112, .1);
}
</style>

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,109 @@
<template>
<view>
<!-- 按钮 -->
<button :class="['buttonBorder',!_rotate?'dlbutton':'dlbutton_loading']" :style="{'background':bgColor, 'color': fontColor}">
<view :class="_rotate?'rotate_loop':''">
<text v-if="_rotate" class="cuIcon cuIcon-loading1 "></text>
<text v-if="!_rotate">{{ text }}</text>
</view>
</button>
</view>
</template>
<script>
export default{
props:{
text: String, //显示文本
rotate:{
//是否启动加载
type: [Boolean,String],
default: false,
},
bgColor:{
//按钮背景颜色
type: String,
// default: "linear-gradient(to right, rgba(0,0,0,0.7), rgba(0,0,0,0.6))",
},
fontColor:{
//按钮字体颜色
type: String,
default: "#000000",
},
},
computed:{
_rotate() {
//处理值
return String(this.rotate) !== 'false'
},
}
}
</script>
<style>
@import url("./css/icon.css");
.dlbutton {
/* color: #FFFFFF; */
font-size: 30upx;
width:601upx;
height:90upx;
/* background: #352680; */
background: #FCD202;
box-shadow:0upx 0upx 13upx 0upx rgba(164,217,228,0.4);
border-radius:2.5rem;
line-height: 90upx;
text-align: center;
margin-left: auto;
margin-right: auto;
margin-top: 96upx;
}
.dlbutton_loading {
color: #FFFFFF;
font-size: 30upx;
width:100upx;
height:100upx;
background: #5E81F9;
box-shadow:0upx 0upx 13upx 0upx rgba(164,217,228,0.4);
border-radius:2.5rem;
line-height: 100upx;
text-align: center;
margin-left: auto;
margin-right: auto;
margin-top: 96upx;
}
.buttonBorder{
border: none ;
border-radius: 2.5rem ;
-webkit-box-shadow: 0 0 60upx 0 rgba(0,0,0,.2) ;
box-shadow: 0 0 60upx 0 rgba(0,0,0,.2) ;
-webkit-transition: all 0.4s cubic-bezier(.57,.19,.51,.95);
-moz-transition: all 0.4s cubic-bezier(.57,.19,.51,.95);
-ms-transition: all 0.4s cubic-bezier(.57,.19,.51,.95);
-o-transition: all 0.4s cubic-bezier(.57,.19,.51,.95);
transition: all 0.4s cubic-bezier(.57,.19,.51,.95);
}
/* 旋转动画 */
.rotate_loop{
-webkit-transition-property: -webkit-transform;
-webkit-transition-duration: 1s;
-moz-transition-property: -moz-transform;
-moz-transition-duration: 1s;
-webkit-animation: rotate 1s linear infinite;
-moz-animation: rotate 1s linear infinite;
-o-animation: rotate 1s linear infinite;
animation: rotate 1s linear infinite;
}
@-webkit-keyframes rotate{from{-webkit-transform: rotate(0deg)}
to{-webkit-transform: rotate(360deg)}
}
@-moz-keyframes rotate{from{-moz-transform: rotate(0deg)}
to{-moz-transform: rotate(359deg)}
}
@-o-keyframes rotate{from{-o-transform: rotate(0deg)}
to{-o-transform: rotate(359deg)}
}
@keyframes rotate{from{transform: rotate(0deg)}
to{transform: rotate(359deg)}
}
</style>

View File

@@ -0,0 +1,223 @@
<template>
<view class="main-list oBorder">
<!-- 文本框 -->
<input
class="main-input"
:value="value"
:type="_type"
:maxlength="maxlength"
:placeholder="placeholder"
:password="type==='password'&&!showPassword"
@input="onInput"
/>
<!-- 是否可见密码 -->
<image
v-if="_isShowPass&&type==='password'&&!_isShowCode"
class="img cuIcon"
:class="showPassword?'cuIcon-attention':'cuIcon-attentionforbid'"
@tap="showPass"
></image>
<!-- 倒计时 -->
<view
v-if="_isShowCode&&!_isShowPass"
:class="['vercode',{'vercode-run': second>0}]"
@click="setCode"
>{{ getVerCodeSecond }}</view>
<view
v-if="_isShowGet"
class="vercode"
@click="setNumberCode"
>官方邀请码</view>
</view>
</template>
<script>
var _this, countDown;
export default{
data(){
return{
showPassword: false, //是否显示明文
second: 0, //倒计时
isRunCode: false, //是否开始倒计时
}
},
props:{
type: String, //类型
value: String, //值
placeholder: String, //框内提示
maxlength: {
//最大长度
type: [Number,String],
default: 20,
},
isShowPass:{
//是否显示密码图标(二选一)
type: [Boolean,String],
default: false,
},
isShowCode:{
//是否显示获取验证码(二选一)
type: [Boolean,String],
default: false,
},
isShowGet:{
//是否显示获取验证码(二选一)
type: [Boolean,String],
default: false,
},
codeText:{
type: String,
default: "获取验证码",
},
setTime:{
//倒计时时间设置
type: [Number,String],
default: 60,
}
},
model: {
prop: 'value',
event: 'input'
},
mounted() {
_this=this
//准备触发
this.$on('runCode',(val)=>{
this.runCode(val);
});
clearInterval(countDown);//先清理一次循环,避免缓存
},
methods:{
showPass(){
//是否显示密码
this.showPassword = !this.showPassword
},
onInput(e) {
//传出值
this.$emit('input', e.target.value)
},
setCode(){
//设置获取验证码的事件
if(this.isRunCode){
//判断是否开始倒计时,避免重复点击
return false;
}
this.$emit('setCode')
},
setNumberCode(){
this.$emit('setNumberCode')
},
runCode(val){
//开始倒计时
if(String(val)=="0"){
//判断是否需要终止循环
this.second = 0; //初始倒计时
clearInterval(countDown);//清理循环
this.isRunCode= false; //关闭循环状态
return false;
}
if(this.isRunCode){
//判断是否开始倒计时,避免重复点击
return false;
}
this.isRunCode= true
this.second = this._setTime //倒数秒数
let _this=this;
countDown = setInterval(function(){
_this.second--
if(_this.second==0){
_this.isRunCode= false
clearInterval(countDown)
}
},1000)
}
},
computed:{
_type(){
//处理值
const type = this.type
return type == 'password' ? 'text' : type
},
_isShowPass() {
//处理值
return String(this.isShowPass) !== 'false'
},
_isShowCode() {
//处理值
return String(this.isShowCode) !== 'false'
},
_isShowGet() {
//处理值
return String(this.isShowGet) !== 'false'
},
_setTime() {
//处理值
const setTime = Number(this.setTime)
return setTime>0 ? setTime : 60
},
getVerCodeSecond(){
//验证码倒计时计算
if(this.second<=0){
return this.codeText;
}else{
if(this.second<10){
return '0'+this.second;
}else{
return this.second;
}
}
}
}
}
</script>
<style>
@import url("./css/icon.css");
.main-list{
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
height: 90upx; /* Input 高度 */
color: #333333;
padding: 32upx;
margin-top:18upx;
margin-bottom: 18upx;
}
.img{
width: 32upx;
height: 32upx;
font-size: 32upx;
}
.main-input{
flex: 1;
text-align: left;
font-size: 28upx;
/* line-height: 100upx; */
padding-right: 10upx;
margin-left: 20upx;
}
.vercode {
color: rgba(0,0,0,0.7);
font-size: 24upx;
line-height: 100upx;
}
.vercode-run {
color: rgba(0,0,0,0.4) !important;
}
.oBorder{
border: none;
border-radius: 2.5rem ;
-webkit-box-shadow: 0 0 60upx 0 rgba(43,86,112,.1) ;
box-shadow: 0 0 60upx 0 rgba(43,86,112,.1) ;
}
</style>

183
my/feedback/index.vue Normal file
View File

@@ -0,0 +1,183 @@
<template>
<view class="page" style="background-color: #ffffff;">
<view class="feedback-title">
<text>问题和意见</text>
<text @tap="chooseMsg">快速键入</text>
</view>
<view class="feedback-body"><textarea placeholder="请详细描述你的问题和意见..." v-model="sendDate.feedbackMessage" class="feedback-textare" /></view>
<view class="feedback-title"><text>QQ/邮箱</text></view>
<view class="feedback-body"><input class="feedback-input" v-model="sendDate.userEmail" placeholder="方便我们联系你" /></view>
<button style="" class="feedback-submit" @tap="send">提交</button>
</view>
</template>
<script>
export default {
data() {
return {
msgContents: ['界面显示错乱', '启动缓慢,卡出翔了', 'UI无法直视丑哭了', '偶发性崩溃'],
stars: [1, 2, 3, 4, 5],
imageList: [],
sendDate: {
score: 5,
feedbackMessage: '',
userEmail: ''
}
};
},
onLoad() {
// let deviceInfo = {
// appid: plus.runtime.appid,
// imei: plus.device.imei, //设备标识
// p: plus.os.name === 'Android' ? 'a' : 'i', //平台类型i表示iOS平台a表示Android平台。
// md: plus.device.model, //设备型号
// app_version: plus.runtime.version,
// plus_version: plus.runtime.innerVersion, //基座版本号
// os: plus.os.version,
// net: '' + plus.networkinfo.getCurrentType()
// };
// this.sendDate = Object.assign(deviceInfo, this.sendDate);
},
methods: {
close(e) {
this.imageList.splice(e, 1);
},
chooseMsg() {
//快速输入
uni.showActionSheet({
itemList: this.msgContents,
success: res => {
this.sendDate.feedbackMessage = this.msgContents[res.tapIndex];
}
});
},
chooseImg() {
//选择图片
uni.chooseImage({
sourceType: ['camera', 'album'],
sizeType: 'compressed',
count: 8 - this.imageList.length,
success: res => {
this.imageList = this.imageList.concat(res.tempFilePaths);
}
});
},
chooseStar(e) {
//点击评星
this.sendDate.score = e;
},
previewImage() {
//预览图片
uni.previewImage({
urls: this.imageList
});
},
send() {
//发送反馈
console.log(JSON.stringify(this.sendDate));
if (!this.sendDate.feedbackMessage) {
uni.showToast({
icon: 'none',
title: '请输入反馈内容'
});
return;
}
if (!this.sendDate.userEmail) {
uni.showToast({
icon: 'none',
title: '请填写QQ或邮箱'
});
return;
}
this.$queue.showLoading('加载中...');
this.$Request.postJson('/app/shop/userFeedback', {
shopId:uni.getStorageSync("shopId"),
userEmail: this.sendDate.userEmail,
feedbackMessage: this.sendDate.feedbackMessage,
// state: 2
}).then(res => {
if (res.code === 0) {
uni.showToast({
title: '提交成功'
});
setTimeout(function() {
uni.navigateBack();
}, 1000);
} else {
uni.hideLoading();
uni.showModal({
showCancel: false,
title: '提交失败',
feedbackMessage: res.msg
});
}
});
}
}
};
</script>
<style>
@font-face {
font-family: uniicons;
font-weight: normal;
font-style: normal;
src: url('https://img-cdn-qiniu.dcloud.net.cn/fonts/uni.ttf') format('truetype');
}
page {
background-color: #F5F5F5 !important;
}
view {
font-size: 28upx;
}
/*问题反馈*/
.feedback-title {
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
padding: 20upx;
color: #8f8f94;
font-size: 28upx;
}
.feedback-star-view.feedback-title {
justify-content: flex-start;
margin: 0;
}
.feedback-body {
font-size: 32upx;
padding: 16upx;
margin: 16upx;
border-radius: 16upx;
background: #FFFFFF;
/* color: #FFF; */
}
.feedback-textare {
height: 200upx;
font-size: 34upx;
line-height: 50upx;
width: 100%;
box-sizing: border-box;
padding: 20upx 30upx 0;
}
.feedback-input {
font-size: 32upx;
height: 60upx;
/* padding: 15upx 20upx; */
line-height: 60upx;
}
.feedback-submit {
background: #FFCC00;
/* color: #ffffff; */
margin: 20upx;
margin-top: 32upx;
}
</style>

33
my/other/about.vue Normal file
View File

@@ -0,0 +1,33 @@
<template>
<view style="font-size: 14px;line-height: 26px;padding: 32upx;" class="bg-white">
<view style="font-size: 28upx;" v-html="content" ></view>
</view>
</template>
<script>
export default {
data() {
return {
content:''
}
},
onLoad() {
this.getGuize();
},
methods: {
getGuize(){
this.$Request.getT('/app/common/type/286').then(res =>{
if(res.code === 0){
this.content = res.data.value;
}
});
}
}
}
</script>
<style>
page {
background: #FFF;
}
</style>

482
my/other/cashDetail.vue Normal file
View File

@@ -0,0 +1,482 @@
<template>
<view class="cash">
<view
style="background-image: url('../../static/images/my/qanbaobg.png');background-size: 100%;height: 400upx;">
<view style="font-size: 32upx;padding-top: 100upx;">可提现总额</view>
<view style="font-size: 40upx;padding-top: 20upx;">¥ {{money}}</view>
<view
style="width: 90%;height: max-content;margin-left: 40upx;background-color: #FFFFFF;box-shadow: rgba(183, 183, 183, 0.3) 0px 1px 10px;margin-top: 50upx;border-radius: 20upx;">
<view style="display: flex;flex-direction: row;padding: 20upx;">
<view style="font-size: 32upx;color: #333333;">提现金额 <text style="font-size: 28upx;color: #FF2638;"
v-if="shouxufei">提现手续费为{{shouxufei * 100}}%</text>
</view>
</view>
<view style="display: flex;flex-direction: row;padding: 20upx;">
<view style="font-size: 40upx;color: #333333;">¥</view>
<input type="text" v-model="moneys" placeholder="请输入金额"
style="font-size: 40upx;color: #333333;text-align: left;margin-left: 10upx;width: 100%;" />
</view>
<view style="background: #E6E6E6;width: 100%;height: 1upx;"></view>
<view style="display: flex;flex-direction: row;flex-wrap: wrap;">
<view style="display: flex;flex-direction: row;" v-for="(item, index) in moneyList" :key="index">
<view>
<view style="padding: 20upx;" @click="getOut(item.money)">
<view
style="padding-top: 40upx;width: 180upx; height: 120upx;background-color: #FFFFFF;border:1px solid #FFCC00;border-radius: 10upx;">
{{ item.money }}
</view>
</view>
</view>
</view>
</view>
</view>
<view style="margin-top:59upx" class="padding-lr margin-lr-sm">
<view class="flex justify-between margin-bottom-xl" v-for="(item,index) in openLists" :key="index">
<view class="flex align-center">
<image :src="item.image" style="width:23px;height:20px"></image>
<text class="text-lg margin-left-sm" style="color:#333333;font-weight:700;">{{item.text}}</text>
</view>
<view>
<radio-group name="openWay" style="margin-left: 20upx;" @tap='selectWay(item)'>
<label class="tui-radio">
<radio color="#FF7F00" :checked="openWay === item.id ? true : false" />
</label>
</radio-group>
</view>
</view>
</view>
<view @click="getOut()"
style="margin: 32upx;font-size: 18px;background: #FFCC00;border-radius: 10px;height: 40px;line-height: 40px">
提现
</view>
<view style="display: flex;width: 100%;justify-content: center;">
<view style="color: grey;padding-bottom: 30px;padding-top: 20upx;flex: 1;" @click="goZhifuBao">提现账号
</view>
<view style="color: grey;padding-bottom: 30px;padding-top: 20upx;flex: 1;" @click="goqianbao">钱包明细
</view>
<view style="color: grey;padding-bottom: 30px;padding-top: 20upx;flex: 1;" @click="isShow">微信收款码
</view>
<view style="color: grey;padding-bottom: 30px;padding-top: 20upx;flex: 1;" @click="gojilu">提现记录
</view>
</view>
</view>
<!-- 微信收款码弹框 -->
<u-popup v-model="show" mode="center">
<view class="padding">
<view class="text-center text-lg text-bold flex justify-between">
<view></view>
<view>添加微信收款码</view>
<view @click="show=false">X</view>
</view>
<!-- <view class="text-center padding-top-sm padding-bottom-lg" style="color: #999999;">请提交微信号和微信二维码
</view> -->
<view style="width: 80%;margin: 0 auto;">
<view class="margin-top" @click.stop="weixin"
style="border: 4rpx solid #010101;border-radius: 16rpx;overflow: hidden;">
<image v-if="!wximg" src="../../static/images/my/erweima.png"></image>
<image v-else :src="wximg" mode=""></image>
</view>
</view>
<!-- <view class="text-center margin-top-sm " @click="submit"
style="border-radius: 10rpx;background-color: #7E59FF;color: #fff;height: 80rpx;line-height: 80rpx;">保存</view> -->
</view>
</u-popup>
<!-- <view v-if="show" class="popup">
</view> -->
</view>
</template>
<script>
export default {
data() {
return {
show: false,
money: '',
moneys: '',
zhifubao: '',
mayMoney: '0',
zhifubaoName: '',
shouxufei: '',
moneyList: [{
money: '10'
},
{
money: '20'
},
{
money: '50'
},
{
money: '100'
},
{
money: '200'
},
{
money: '500'
}
],
value: 0,
min: '',
zhifubao: '',
zhifubaoName: '',
openLists: [],
openWay: 1,
values: '',
wximg: ''
};
},
onLoad() {
this.getUserInfo()
this.$Request.getT('/common/type/290').then(res => { //判断微信提现方式
if (res.code == 0) {
if (res.data && res.data.value) {
this.values = res.data.value
}
}
})
//提现手续费
this.$Request.getT('/common/type/115').then(res => {
if (res.code === 0) {
this.shouxufei = res.data.value;
}
});
this.openLists = [{
image: '../../static/images/img/icon_weixin.png',
text: '微信',
id: 1
}, {
image: '../../static/images/img/zhifubao.png',
text: '支付宝',
id: 2
}];
this.openWay = 1;
},
onShow: function(e) {
this.getwalletMoney();
this.getUserInfo()
},
onNavigationBarButtonTap() {
this.list();
},
methods: {
//用户收款码弹框
isShow() {
this.getUserInfo()
this.show = true
},
//微信 支付宝提现选择
selectWay: function(item) {
this.openWay = item.id;
},
//获取用户信息获取用户是否上传收款码
getUserInfo() {
this.$Request.getA("/sys/user/info").then(res => {
if (res.code == 0) {
this.zhifubao = res.user.userEntity.zhiFuBao
this.zhifubaoName = res.user.userEntity.zhiFuBaoName
this.wximg = res.user.userEntity.cashQrCode;
// console.log(this.zhifubao, this.zhifubaoName, '-')
}
});
},
//获取账户余额
getwalletMoney() {
this.$Request.getT('/shop/shopmoney/selectShopMoney').then(res => {
if (res.code == 0) {
this.money = res.data.money;
}
uni.hideLoading();
});
},
gojilu() {
uni.navigateTo({
url: '/my/other/moneydetail'
});
},
goqianbao() {
uni.navigateTo({
url: '/my/other/cashList'
});
},
goZhifuBao() {
uni.navigateTo({
url: '/my/other/zhifubao'
});
},
weixin() {
let that = this
uni.chooseImage({
count: 1, //默认9
sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
sourceType: ['album', 'camera'], //从相册选择
success: (res) => {
console.log('`````````````', res)
that.$queue.showLoading("上传中...");
for (let i = 0; i < 1; i++) {
uni.uploadFile({ // 上传接口
url: 'https://tcwm.xianmaxiong.com/sqx_fast/alioss/upload', //真实的接口地址
filePath: res.tempFilePaths[i],
name: 'file',
success: (uploadFileRes) => {
let img = JSON.parse(uploadFileRes.data).data
// let userId = that.$queue.getData('userId');
let data = {
cashQrCode: img
}
that.$Request.getA('/shop/shopmoney/shopBindingQrCode',
data).then(
res => {
if (res.code == 0) {
that.getUserInfo()
setTimeout(function() {
that.$queue.showToast('上传成功')
}, 1000)
}
});
uni.hideLoading();
// that.show = false
}
});
}
}
});
},
//校验用户输入金额
checkMobile(money) {
return RegExp(/^1[34578]\d{9}$/).test(money);
},
getOut(money) {
let that = this
if (money) {
that.moneys = money
}
if (!/^\d+$/.test(that.moneys)) {
uni.showToast({
icon: 'none',
title: '请输入正确金额,不能包含中文,英文,特殊字符和小数'
});
return;
}
if (that.openWay == 2) { //支付宝提现
if (that.zhifubao != null && that.zhifubaoName != null) {
uni.showModal({
title: "提现申请提示",
content: '请仔细确认收款人信息\n\n收款人姓名:' + that.zhifubaoName + '\n\n收款人账号' + that.zhifubao +
'\n\n提现金额:' + that.moneys + '元\t\t手续费:' + (that.moneys * that.shouxufei).toFixed(
1),
success: (e) => {
if (e.confirm) {
that.$queue.showLoading("提现中...");
let data = {
money: that.moneys,
classify: '1'
}
that.$Request.getT('/shop/shopmoney/shopCashMoney', data).then(
res => {
if (res.status === 0 && res.data) {
setTimeout(function() {
that.$queue.showToast("提现申请成功,预计三个工作日到账");
}, 3000)
that.getwalletMoney();
} else {
that.$queue.showToast(res.msg);
that.getwalletMoney();
}
uni.hideLoading();
});
}
}
});
} else {
uni.navigateTo({
url: '/my/other/zhifubao'
});
}
} else if (that.openWay == 1) { //微信提现
if (that.values == 2) {
that.$Request.getA('/sys/user/info').then(res => {
if (res.code === 0) {
let wxImg = res.user.userEntity.cashQrCode;
if (!wxImg) {
uni.showModal({
title: '提现提示',
content: '请上传微信收款码',
showCancel: true,
cancelText: '取消',
confirmText: '上传',
success: res => {
if (res.confirm) {
that.show = true
}
},
fail: () => {},
complete: () => {}
});
return;
}
if (!/^\d+$/.test(that.moneys)) {
uni.showToast({
icon: 'none',
title: '请输入正确金额,不能包含中文,英文,特殊字符和小数'
});
return;
}
if (that.moneys * 1 >= that.value * 1) {
uni.showModal({
title: '提现申请提示',
content: '金额:' + that.moneys + '元'+','+'手续费:' + (that.moneys *that.shouxufei).toFixed(1),
success: e => {
if (e.confirm) {
that.$queue.showLoading('提现中...');
let data = {
money: that.moneys,
classify: 2
}
that.$Request.getT('/shop/shopmoney/shopCashMoney',
data).then(
res => {
if (res.code === 0) {
setTimeout(function() {
that.$queue.showToast(
'提现申请成功,预计三个工作日到账');
}, 1000)
that.getwalletMoney();
} else {
uni.showModal({
title: '温馨提示',
content: res.msg,
showCancel: false,
cancelText: '取消',
confirmText: '确认'
});
}
uni.hideLoading();
});
}
}
});
} else {
setTimeout(function() {
that.$queue.showToast('提现金额必须大于或等于' + that.value + '元才可提现');
}, 1000)
}
} else {
that.$queue.showToast('网络状态不好,请刷新后重试!');
}
});
} else {
if (!/^\d+$/.test(that.moneys)) {
uni.showToast({
icon: 'none',
title: '请输入正确金额,不能包含中文,英文,特殊字符和小数'
});
return;
}
if (parseFloat(that.moneys).toFixed(1) >= that.value) {
uni.showModal({
title: '提现申请提示',
content: '金额:' + that.moneys + '元'+','+'手续费:' + parseFloat(that.moneys *
that.shouxufei).toFixed(1),
success: e => {
if (e.confirm) {
that.$queue.showLoading('提现中...');
let data = {
money: that.moneys,
classify: 2
}
that.$Request.getT('/shop/shopmoney/shopCashMoney', data).then(
res => {
if (res.code === 0) {
setTimeout(function() {
that.$queue.showToast('提现申请成功,预计三个工作日到账');
}, 1000)
that.getwalletMoney();
} else {
uni.showModal({
title: '温馨提示',
content: res.msg,
showCancel: false,
cancelText: '取消',
confirmText: '确认'
});
that.getwalletMoney();
}
uni.hideLoading();
});
}
}
});
} else {
that.$queue.showToast('提现金额必须大于或等于' + that.value + '元才可提现');
}
}
}
},
}
};
</script>
<style lang="less">
// @import '../../static/css/index.css';
.view2-view-text {
font-size: 14px;
color: #000000;
margin-left: 20upx;
width: 80%;
}
.view2-view-image-right {
width: 18upx;
height: 30upx;
margin-left: 50upx;
}
.cash {
text-align: center;
background: white;
height: 100%;
position: absolute;
width: 100%;
.cash-top {
padding: 32upx 32upx 50upx 32upx;
/* border-bottom: 1px solid gainsboro; */
background: #FF2638;
}
.leiji {
font-size: 14px;
color: #ffffff;
margin-bottom: 10px;
}
}
</style>

129
my/other/cashList.vue Normal file
View File

@@ -0,0 +1,129 @@
<template>
<view>
<view style="text-align: left;padding-bottom: 10rpx;">
<view v-for="(item, index) in list" :key="index" class="item">
<view>
<!-- <view style="margin-bottom: 8upx;text-align: right;">
<text v-if="item.type == 1" style="margin-bottom: 8upx;color: #ecd4b4">充值</text>
<text v-if="item.type == 2" style="margin-bottom: 8upx;color: #ecd4b4">提现</text>
</view> -->
<view style="color: #999999;font-size: 28upx;">
<view style="margin-bottom: 8upx">{{item.title}}</view>
<!-- <view v-if="item.classify === 2" style="margin-bottom: 8upx"> 返佣类型直属返佣</view> -->
<!-- <view v-if="item.classify === 3" style="margin-bottom: 8upx"> 返佣类型非直属支付</view> -->
<view style="margin-bottom: 8upx">{{item.content}}</view>
<view style="margin-bottom: 8upx"> 创建时间{{item.createTime}}</view>
<view style="margin-bottom: 8upx;text-align: right;">
<text v-if="item.type == 1" style="color: #ecd4b4;font-size: 32upx;font-weight: 600"><text
class="text-olive">+</text>{{item.money}}</text>
<text v-if="item.type == 2" style="color: #ecd4b4;font-size: 32upx;font-weight: 600"><text
class="text-red">-</text>{{item.money}}</text>
</view>
</view>
</view>
</view>
<!-- 加载更多提示 -->
<!-- <view class="s-col is-col-24" v-if="list.length > 0">
<load-more :loadingType="loadingType" :contentText="contentText"></load-more>
</view> -->
<!-- 加载更多提示 -->
<!-- <empty v-if="list.length === 0" des="暂无明细数据" show="false"></empty> -->
<empty v-if="list.length == 0" content="暂无明细"></empty>
</view>
</view>
</template>
<script>
import empty from '@/components/empty.vue'
export default {
components: {
empty
},
data() {
return {
list: [],
page: 1,
limit: 10,
tabIndex: 1,
checkReZhiShu: '否',
checkReTuanZhang: '否',
checkReFeiZhiShu: '否',
scrollTop: false,
contentText: {
contentdown: '上拉显示更多',
contentrefresh: '正在加载...',
contentnomore: '没有更多数据了'
}
}
},
onLoad() {
this.$queue.showLoading("加载中...");
this.getList();
},
onPageScroll: function(e) {
this.scrollTop = e.scrollTop > 200;
},
methods: {
getList() {
let data = {
page: this.page,
limit: this.limit,
classify: 3,
type:''
}
this.$Request.getT('/shop/shopmoney/selectShopMoneydetails', data).then(res => {
if (res.code === 0) {
if (this.page === 1) {
this.list = res.data.records;
} else {
this.list = [...this.list, ...res.data.records];
}
}
uni.stopPullDownRefresh();
uni.hideLoading();
});
}
},
onReachBottom: function() {
this.page = this.page + 1;
this.getList();
},
onPullDownRefresh: function() {
this.page = 1;
this.getList();
}
}
</script>
<style lang="less">
page {
// background: #1c1b20;
}
.tui-tab-item-title {
// color: #ffffff;
font-size: 30rpx;
height: 80rpx;
line-height: 80rpx;
flex-wrap: nowrap;
white-space: nowrap;
}
.tui-tab-item-title-active {
border-bottom: 1px solid #5E81F9;
color: #5E81F9;
font-size: 32upx;
font-weight: bold;
border-bottom-width: 6upx;
text-align: center;
}
.item {
background: #FFFFFF;
padding: 32rpx;
margin: 32rpx;
font-size: 28rpx;
box-shadow: 7px 9px 34px rgba(0, 0, 0, 0.1);
border-radius: 16upx;
}
</style>

135
my/other/customer.vue Normal file
View File

@@ -0,0 +1,135 @@
<template>
<view style="height: 100vh;margin: 32upx;">
<view style="text-align: center;background: #FFFFFF;padding: 40upx;border-radius: 32upx;">
<view style="font-size: 38upx;">添加客服微信咨询</view>
<view style="font-size: 32upx;margin-top: 32upx;">微信号{{weixin}}</view>
<view style="font-size: 32upx;margin-top: 32upx;">手机号{{phone}}</view>
<view @click="copyHref"
style="background: #557EFD;width:200upx;margin-top: 32upx;font-size: 30upx;margin-left: 36%;color: #FFFFFF;padding: 4upx 20upx;border-radius: 24upx;">
一键复制</view>
<image @click="saveImg" mode="aspectFit" style="margin-top: 32upx" :src="images"></image>
<view style="font-size: 28upx;margin-top: 32upx" v-if="isWeiXin">{{ isWeiXin ? '长按识别上方二维码' : '' }}</view>
<!-- <button open-type="contact">在线客服</button> -->
<!-- <view @click="goChat"
style="width:260upx;margin-top: 32upx;font-size: 30upx;margin-left: 28%;color: #557EFD;padding: 4upx 20upx;border-radius: 24upx;">
联系在线客服</view>
<view v-if="isWeiXin" style="font-size: 24upx;margin-top: 80upx" @click="rests">无法识别</view> -->
</view>
</view>
</template>
<script>
export default {
data() {
return {
images: 'https://www.gomyorder.cn/custom.jpg',
isWeiXin: false,
weixin: '710070994',
phone: '',
webviewStyles: {
progress: {
color: '#1A1929 '
}
}
};
},
onLoad() {
// #ifdef H5
let ua = navigator.userAgent.toLowerCase();
if (ua.indexOf('micromessenger') !== -1) {
this.isWeiXin = true;
}
// #endif
//获取客服二维码
this.$Request.getT('/app/common/type/289').then(res => {
if (res.code == 0) {
if (res.data && res.data.value) {
console.log(res.data.value)
this.images = res.data.value;
}
}
});
this.$Request.getT('/app/common/type/288').then(res => {
if (res.code == 0) {
if (res.data && res.data.value) {
this.weixin = res.data.value;
}
}
});
//获取手机号码
this.$Request.getT('/app/common/type/287').then(res => {
if (res.code == 0) {
if (res.data && res.data.value) {
this.phone = res.data.value;
}
}
});
},
onPullDownRefresh: function() {
uni.stopPullDownRefresh(); // 停止刷新
},
methods: {
//邀请码复制
copyHref() {
uni.setClipboardData({
data: this.weixin,
success: r => {
this.$queue.showToast('复制成功');
}
});
},
saveImg() {
let that = this;
let imgArr = []
imgArr.push(that.image);
//预览图片
uni.previewImage({
urls: imgArr,
current: imgArr[0]
});
// uni.saveImageToPhotosAlbum({
// filePath: that.image,
// success(res) {
// that.$queue.showToast('保存成功');
// }
// });
},
rests() {
uni.showToast({
title: '已刷新请再次长按识别',
mask: false,
duration: 1500,
icon: 'none'
});
window.location.reload();
},
// 在线客服
goChat() {
let token = this.$queue.getData('token');
if (token) {
uni.navigateTo({
url: '/my/setting/chat'
});
} else {
this.goLoginInfo();
}
},
//统一登录跳转
goLoginInfo() {
uni.navigateTo({
url: '/pages/public/loginphone'
});
},
}
};
</script>
<style>
/* @import '../../static/css/index.css'; */
page {
background: #F5F5F5;
}
</style>

194
my/other/detail.vue Normal file
View File

@@ -0,0 +1,194 @@
<template>
<view class="content">
<view class="online_box">
<view class="online_title">{{datas.shopIllegal}}</view>
<u-line color="#E6E6E6" />
<view class="online" style="padding-top: 10rpx;">
<view class="online_tit">违规说明</view>
<view class="online_test">{{datas.wrongExplain}}</view>
</view>
<view class="online">
<view class="online_tit">关联订单</view>
<view class="online_text" v-if="datas.shipAddressDetail" >
<image src="../static/black.png"></image>
<text>{{datas.shipAddressDetail}}</text>
</view>
<view class="online_text" v-if="datas.deilveryAddressDetail">
<image src="../static/orange.png"></image>
<text>{{datas.deilveryAddressDetail}}</text>
</view>
<view class="online_text" v-if="datas.shopAddressDetail">
<image src="../static/black.png"></image>
<text>{{datas.shopAddressDetail}}</text>
</view>
<view class="online_text" v-if="datas.userAddressDetail">
<image src="../static/orange.png"></image>
<text>{{datas.userAddressDetail}}</text>
</view>
<view class="online_text" v-if="datas.indentNumber" @click="copyOrder(datas.indentNumber)">
<image src="../static/orange.png"></image>
<text>订单号{{datas.indentNumber}}</text>
</view>
</view>
<!-- <view class="online">
<view class="online_tit">违规说明</view>
<view style="font-size: 24rpx;margin-top: 10rpx;">{{datas.resultHanding}}</view>
<view class="pnline_tip">如果配送中上报异常审核成功后违规消除不扣款</view>
</view> -->
</view>
<!-- <view class="btn" v-if="datas.complaintState=='1'" @click="bindonline">在线申诉</view>
<view class="btn btn1" v-if="datas.complaintState=='2'" >申诉中</view>
<view class="btn" v-if="datas.complaintState=='3'"@click="bindonline" >申诉未通过</view>
<view class="btn" v-if="datas.complaintState=='4'" >申诉通过</view> -->
</view>
</template>
<script>
export default {
data() {
return {
list: [{
id: 1,
img: '../static/black.png',
name: '西安智能大厦'
}, {
id: 2,
img: '../static/orange.png',
name: '用户地址隐藏',
}],
indentNumber:'',
datas:{},
complaintId: ''
}
},
onLoad(options) {
console.log(options)
this.indentNumber =options.indentNumber
this.complaintId = options.complaintId
// this.bindorder()
},
onShow() {
console.log('`````````````11111111')
if(this.indentNumber!=''){
this.bindorder()
}
},
methods: {
copyOrder(value) {
uni.setClipboardData({
data: value, //要被复制的内容
success: () => { //复制成功的回调函数
uni.showToast({ //提示
title: '复制成功'
})
}
});
},
bindonline() {
uni.navigateTo({
url: '/pages/riderMy/myOnline/myOnline?indentNumber='+this.indentNumber+'&complaintType='+this.datas.complaintType+'&complaintId='+this.complaintId
})
},
// 获取数据
bindorder() {
this.$Request.getT('/app/shop/findComplaint',
{
complaintId: this.complaintId
}).then(res => {
if(res.code==0){
this.datas = res.data
}else{
console.log('失败:',res.data)
}
});
},
}
}
</script>
<style>
body {
background-color: #F5F5F5;
}
.content {
width: 100%;
}
.online_box {
width: 90%;
margin: 0 auto;
background: #FFFFFF;
border-radius: 20rpx;
margin-top: 30rpx;
}
.online_title {
font-size: 28rpx;
font-weight: bold;
letter-spacing: 2rpx;
width: 90%;
margin: 0 auto;
line-height: 80rpx;
}
.online {
width: 90%;
margin: 0 auto;
padding-bottom: 34rpx;
}
.online_tit {
font-size: 27rpx;
letter-spacing: 2rpx;
font-weight: bolder;
line-height: 40rpx;
}
.online_test {
color: #333333;
font-size: 26rpx;
letter-spacing: 2rpx;
line-height: 38rpx;
}
.online_text {}
.online_text image {
width: 15rpx;
height: 15rpx;
}
.online_text text {
font-size: 21rpx;
color: #333333;
margin-left: 15rpx;
letter-spacing: 1rpx;
}
.pnline_tip {
color: #999999;
font-size: 25rpx;
line-height: 50rpx;
}
.btn {
width: 90%;
margin: 0 auto;
background: #FF7F00;
line-height: 90rpx;
text-align: center;
color: white;
border-radius: 15rpx;
margin-top: 20rpx;
font-size: 28rpx;
}
.btn1{
background: #ccc;
}
</style>

48
my/other/help.vue Normal file
View File

@@ -0,0 +1,48 @@
<template>
<view>
<view style="margin-top: 4upx;" class="bg-white flex justify-between align-center padding" v-for="(item,index) in dataList" :key='index' @click="goDet(item)" >
<view class="text-lg">{{index+1}}.{{item.title}}</view>
<image src="../../static/images/img/go.png" style="width: 20rpx;height: 34rpx;" mode="aspectFill"></image>
</view>
</view>
</template>
<script>
export default {
data() {
return {
page: 1,
limit: 10,
dataList: []
}
},
onLoad() {
this.getDataList()
},
methods: {
getDataList() {
let data = {
page: this.page,
limit: this.limit,
type:3
}
this.$Request.getT("/app/userinfo/trainingCenterList",data).then(res => {
this.dataList = res.data.list
})
},
goDet(e) {
uni.navigateTo({
url: '/my/other/helpDet?id='+e.trainingId
})
}
},
onReachBottom: function() {
this.page = this.page + 1;
this.getDataList();
},
}
</script>
<style>
</style>

77
my/other/helpDet.vue Normal file
View File

@@ -0,0 +1,77 @@
<template>
<view style="line-height: 26px;padding: 32upx;" class="home1">
<!-- <view v-html="tit"> </view> -->
<!-- <view style="font-size: 28upx;" v-html="content"></view> -->
<u-parse :html="content"></u-parse>
</view>
</template>
<script>
export default {
data() {
return {
list: [],
content: ''
}
},
onLoad(e) {
this.taskData(e.id)
},
methods: {
// 获取任务数据
taskData(e) {
this.$Request.getT('/app/userinfo/TrainingCenter?id='+e).then(res => {
if(res.code==0){
this.content = res.data.message
}
});
},
}
}
</script>
<style>
page {
background: #FFFFFF;
}
.content {
width: 100%;
background: #FFFFFF;
margin-top: 20rpx;
padding-bottom: 50rpx;
padding-top: 20rpx;
}
.list_box {
width: 90%;
margin: 0 auto;
display: flex;
line-height: 45rpx;
padding-top: 20rpx;
}
.list_left {
flex: 2;
}
.name {
font-size: 26rpx;
color: #333333;
font-weight: bold;
letter-spacing: 2rpx;
}
.data {
color: #999999;
font-size: 24rpx;
}
/* .list_right {
flex: 1;
display: flex;
justify-content: flex-end;
align-items: center;
font-size: 31rpx;
} */
</style>

44
my/other/mimi.vue Normal file
View File

@@ -0,0 +1,44 @@
<template>
<view style="line-height: 26px;padding: 32upx;" class="bg-white">
<!-- <view v-html="tit"> </view> -->
<view style="font-size: 28upx;" v-html="content"></view>
</view>
</template>
<script>
export default {
data() {
return {
tit: '',
content: ''
}
},
onLoad() {
// this.getGuize();
// 隐私政策
this.$Request.getT('/app/common/type/237').then(res => { //用户完成成功
if (res.code == 0) {
if (res.data && res.data.value) {
this.content = res.data.value;
}
}
})
},
methods: {
getGuize() {
this.$Request.getT('/app/userinfo/privacyPolicy').then(res => {
if (res.code == 0) {
this.content = res.data.value;
// this.tit = res.data.min
}
});
}
}
}
</script>
<style>
page {
background: #FFF;
}
</style>

544
my/other/money.vue Normal file
View File

@@ -0,0 +1,544 @@
<template>
<view>
<view style="width: 100%;height: 384upx;position: relative;">
<image src="../../static/images/img/image_bg.png" style="width: 100%;height: 100%;"></image>
<view class="box">
<view class="margin-top padding-top">保证金</view>
<view class="margin-top-lg text-bold" style="font-size: 78upx;">{{cashDeposit?cashDeposit:0}}</view>
<view class="mingxi" @click="bindmingxi()">保证金明细</view>
<view class="flex justify-center padding-lr" style="margin-top: 100upx;">
<view class="btn1" @click="Tuiprice()">退保证金</view>
<view class="btn2" @click="submit()">缴纳保证金</view>
</view>
</view>
</view>
<view class="padding" style="margin-top: 180upx;">
<view style="color: #333333;font-size: 38upx;" class="text-bold">保证金规则</view>
<view style="font-size: 32upx;margin-top: 58upx;" class="text-bold">保证金退款</view>
<view style="color: #666666;margin-top: 29upx;font-size: 28upx;">
48小时内无订单记录即可申请退保证金保证金统一退款至账户余额实时到账
</view>
<view style="font-size: 32upx;margin-top: 58upx;" class="text-bold">保证金缴纳</view>
<view style="color: #666666;margin-top: 29upx;font-size: 28upx;">
所有店铺发布商品需缴纳保证金{{money}}没有缴纳者将无法接订单建议您及时缴纳
</view>
</view>
<!-- 支付方式 -->
<!-- <u-popup v-model="showpay" mode="bottom" :closeable="closeable">
<view class="popup_pay">
<view style="background-color: #fff;">
<view style="padding: 0 20upx;margin-top: 60rpx;margin-bottom: 20rpx;">
<view
style="display: flex;height: 100upx;align-items: center;padding: 20upx 0;justify-content: center;"
v-for="(item,index) in openLists" :key='index'>
<image :src="item.image" style="width: 55upx;height: 55upx;border-radius: 50upx;">
</image>
<view style="font-size: 30upx;margin-left: 20upx;width: 70%;">
{{item.text}}
</view>
<radio-group name="openWay" style="margin-left: 45upx;" @tap='selectWay(item)'>
<label class="tui-radio">
<radio color="#1777FF" :checked="openWay === item.id ? true : false" />
</label>
</radio-group>
</view>
</view>
</view>
<view class="pay_btn" @click="pay()">确认支付</view>
</view>
</u-popup> -->
<!-- 支付方式 -->
<u-popup v-model="showpay" mode="center" width="640rpx" height="640rpx" border-radius="14" :closeable="true"
close-icon="close-circle" close-icon-size="50" close-icon-color="#CCCCCC" @close="closePopup()">
<view style="width: 100%;height: 300upx;background: #FFFFFF;">
<view class="receipt_code">
<view class="code_title">请输入支付金额</view>
<u-input v-model="earnestMoney" placeholder="请输入支付金额" :border="true" />
<view class="margin-tb padding-lr radius bg-white" style="height: 220upx;">
<view class="flex align-center justify-between padding-tb-sm" v-for="(item,index) in openLists"
:key='index'>
<image :src="item.image" style="width: 80upx;height: 80upx;border-radius: 50upx;"></image>
<view class="flex-sub text-xl text-bold margin-left">{{item.text}}</view>
<radio-group name="openWay" style="margin-left: 20upx;" @change='selectWay(item)'>
<label class="tui-radio">
<radio class="red" :checked="openWay === item.id ? true : false" />
</label>
</radio-group>
</view>
</view>
<view class="sure" @click="pay()">确定</view>
</view>
</view>
</u-popup>
</view>
</template>
<script>
export default {
data() {
return {
money: 0,
showpay: false,
openLists: [],
openWay: 1,
closeable: true,
renzheng: '',
cashDeposit: '',
earnestMoney: '',
openId: ''
}
},
onLoad() {
this.cashDeposit = uni.getStorageSync('cashDeposit')
this.openId = uni.getStorageSync('openId')
this.renzheng = uni.getStorageSync("renzheng")
// #ifdef APP
this.openLists = [{
image: '../../static/images/img/icon_weixin.png',
text: '微信',
id: 1
}, {
image: '../../static/images/img/zhifubao.png',
text: '支付宝',
id: 2
}],
this.openWay = 1;
// #endif
// #ifdef MP-WEIXIN
this.openLists = [{
image: '../../static/images/img/icon_weixin.png',
text: '微信',
id: 1
}],
this.openWay = 1;
// #endif
// #ifdef H5
this.openLists = [{
image: '../../static/images/img/zhifubao.png',
text: '支付宝',
id: 2
}]
this.openWay = 2;
// #endif
},
onShow() {
this.Getmoney()
this.getshanghuinfo()
},
methods: {
selectWay: function(item) {
this.openWay = item.id;
},
//保证金明细
bindmingxi() {
uni.navigateTo({
url: '/my/other/moneylist'
})
},
getshanghuinfo() {
let data = {
shopId: uni.getStorageSync('shopId')
}
this.$Request.get("/app/shop/selectShopMessage", data).then(res => {
if (res.code == 0) {
this.cashDeposit = res.data.cashDeposit
uni.setStorageSync('cashDeposit', res.data.cashDeposit)
}
});
},
// 保证金
Getmoney() {
this.$Request.get("/app/common/type/270").then(res => {
console.log(res)
if (res.code == 0) {
this.money = res.data.value
}
});
},
//缴纳保证金
submit() {
// if (this.isCashDeposit == 3) {
// uni.showToast({
// title: '系统审核中,请耐心等待',
// icon: 'none',
// duration: 1000
// })
// } else if (this.isCashDeposit == 1) {
// this.showpay = true
// }
this.showpay = true
// #ifdef MP-WEIXIN
this.wxlogin()
// #endif
},
//退保证金
Tuiprice() {
if (this.cashDeposit == 0) {
uni.showToast({
title: '保证金余额0',
icon: 'none',
duration: 1000
})
} else {
this.$Request.getT('/app/shop/shopRefundCashDeposit', {
shopId: uni.getStorageSync('shopId')
}).then(res => {
if (res.code == 0) {
uni.showToast({
title: '申请提交成功,保证金已退还至您的钱包账户',
icon: 'none',
duration: 1000
})
uni.switchTab({
url: '/pages/my/index'
})
}else{
this.$queue.showToast(res.msg);
}
})
}
},
// 关闭底部弹出层
closePopup() {
this.shows = false
},
wxlogin() {
let that = this
wx.login({
success(res) {
if (res.code) {
console.log(res)
//发起网络请求
let data = {
code: res.code
}
that.$Request.getA("/app/Login/wxShopLogin", data).then(res => {
if (res.code == 0) {
that.$queue.setData("openId", res.data.open_id);
}
})
} else {
console.log('登录失败!' + res.errMsg)
}
}
})
},
pay() {
let that = this;
if (!this.earnestMoney) {
that.$queue.showToast('请输入支付金额');
return;
}
uni.showLoading({
title: '支付中'
});
let userId = uni.getStorageSync('userId')
let openId = uni.getStorageSync('openId')
that.showpay = false
if (that.openWay == 1) { //微信支付
// #ifdef MP-WEIXIN
let data = {
money: that.earnestMoney,
openId: openId,
type: 3
}
that.$Request.post('/shop/shopmoney/shopCashDeposit', data).then(res => {
console.log(res)
uni.hideLoading();
if (res.code == 0) {
that.earnestMoney = ''
uni.requestPayment({
provider: 'wxpay',
timeStamp: res.data.timestamp,
nonceStr: res.data.noncestr,
package: res.data.package,
signType: res.data.signType,
paySign: res.data.sign,
success: function(res) {
console.log(res)
uni.showToast({
title: '支付成功',
icon: 'nones'
});
// this.$queue.showToast('支付成功');
that.getshanghuinfo()
// uni.switchTab({
// url: '/pages/my/index'
// })
},
fail: function(err) {
that.$queue.showToast('支付失败');
}
});
}
});
// #endif
// #ifdef H5
let data = {
money: that.money,
type: 2
}
that.$Request.post('/shop/shopmoney/shopCashDeposit', data).then(res => {
uni.hideLoading();
that.showpay = false
that.callPay(res);
});
// #endif
// #ifdef APP
let data = {
money: that.money,
type: 1
}
that.$Request.post('/shop/shopmoney/shopCashDeposit', data).then(res => {
uni.hideLoading()
console.log(res)
that.showpay = false
if (res.code == 0) {
that.isCheckPay(res.code, 'wxpay', JSON.stringify(res.data));
}
});
// #endif
} else if (that.openWay == 2) { //支付宝支付
// #ifdef H5
let data = {
money: that.money,
type: 5
}
that.$Request.post('/shop/shopmoney/shopCashDeposit', data).then(
res => {
uni.hideLoading()
that.showpay = false
const div = document.createElement('div')
div.innerHTML = res.data //此处form就是后台返回接收到的数据
document.body.appendChild(div)
document.forms[0].submit()
});
// #endif
// #ifdef APP-PLUS
let data = {
money: that.money,
type: 4
}
that.$Request.post('/shop/shopmoney/shopCashDeposit', data).then(
res => {
uni.hideLoading()
that.showpay = false
that.setPayment('alipay', res.data);
});
// #endif
}
},
callPay: function(response) {
if (typeof WeixinJSBridge === "undefined") {
if (document.addEventListener) {
document.addEventListener('WeixinJSBridgeReady', this.onBridgeReady(response), false);
} else if (document.attachEvent) {
document.attachEvent('WeixinJSBridgeReady', this.onBridgeReady(response));
document.attachEvent('onWeixinJSBridgeReady', this.onBridgeReady(response));
}
} else {
this.onBridgeReady(response);
}
},
onBridgeReady: function(response) {
let that = this;
if (!response.package) {
return;
}
WeixinJSBridge.invoke(
'getBrandWCPayRequest', {
"appId": response.appid, //公众号名称,由商户传入
"timeStamp": response.timestamp, //时间戳自1970年以来的秒数
"nonceStr": response.noncestr, //随机串
"package": response.package,
"signType": response.signType, //微信签名方式:
"paySign": response.sign //微信签名
},
function(res) {
if (res.err_msg === "get_brand_wcpay_request:ok") {
// 使用以上方式判断前端返回,微信团队郑重提示:
//res.err_msg将在用户支付成功后返回ok但并不保证它绝对可靠。
uni.showLoading({
title: '支付成功'
});
uni.hideLoading();
uni.navigateTo({
url: '/pages/my/index'
})
} else {
uni.hideLoading();
}
WeixinJSBridge.log(response.err_msg);
}
);
},
isCheckPay(code, name, order) {
if (code == 0) {
console.log('999999999999')
this.setPayment(name, order);
} else {
uni.hideLoading();
uni.showToast({
title: '支付信息有误'
});
}
},
setPayment(name, order) {
console.log(777777777, name, order)
uni.requestPayment({
provider: name,
orderInfo: order, //微信、支付宝订单数据
success: function(res) {
uni.hideLoading();
uni.showLoading({
title: '支付成功'
});
uni.switchTab({
url: '/pages/my/index'
})
},
fail: function(err) {
uni.hideLoading();
},
complete() {
uni.hideLoading();
}
});
}
}
}
</script>
<style>
page {
background: #FFFfff;
}
.box {
width: 690upx;
height: 430upx;
background: #FFFDFC;
box-shadow: 0upx 15upx 43upx 0upx rgba(232, 215, 199, 0.29);
border-radius: 24upx;
margin: 0 auto;
position: absolute;
top: 80upx;
left: 0;
right: 0;
text-align: center;
}
.btn1 {
/* width: 305upx; */
width: 100%;
height: 88upx;
background: #ffffff;
border: 2upx solid #CCCCCC;
border-radius: 8upx;
line-height: 88upx;
/* color: #FFFFFF; */
font-size: 28upx;
margin-right: 20upx;
}
.btn2 {
/* width: 305upx; */
width: 100%;
height: 88upx;
background: #FCD202;
border-radius: 8upx;
line-height: 88upx;
/* color: #FFFFFF; */
font-size: 28upx;
}
.popup_pay {
width: 100%;
position: relative;
padding-bottom: 45rpx;
/* height: 160px; */
/* #ifndef MP-WEIXIN */
/* height: 130px; */
/* #endif */
}
.pay_btn {
width: 90%;
margin: 0 auto;
text-align: center;
background: #2FB57A;
height: 80rpx;
border-radius: 16rpx;
color: #ffffff;
line-height: 80rpx;
}
/* 支付金额弹框 */
.receipt_code {
width: 90%;
margin: 0 auto;
}
.code_title {
width: 100%;
line-height: 100rpx;
font-size: 31rpx;
font-weight: bold;
text-align: center;
letter-spacing: 2rpx;
margin-top: 21rpx;
margin-bottom: 25rpx;
}
.u-input--border {
border: 1px solid #F2F2F2 !important;
background: #F2F2F2 !important;
color: #999999 !important;
font-weight: 500 !important;
letter-spacing: 2rpx !important;
}
.u-input__input {
font-size: 30rpx;
font-weight: bold;
flex: 1;
color: #999999 !important;
min-height: 85rpx !important;
margin-top: 7rpx;
}
.sure {
width: 100%;
height: 80rpx;
background: #2FB57A;
color: white;
border-radius: 46rpx;
text-align: center;
line-height: 80rpx;
margin-top: 30rpx;
letter-spacing: 2rpx;
}
.mingxi {
position: relative;
top: 10px;
}
</style>

138
my/other/moneydetail.vue Normal file
View File

@@ -0,0 +1,138 @@
<template>
<view>
<view style="text-align: left;padding-bottom: 10rpx;">
<view v-for="(item, index) in list" :key="index" class="item">
<view>
<view style="margin-bottom: 8upx;display: flex;justify-content: space-between;">
<view class="flex" style="color: #2FB57A">
<view v-if="item.classify == 2"> 微信 </view>
<view v-if="item.classify == 1"> 支付宝 </view>
<text style="margin-bottom: 8upx;color: #2FB57A" v-if="item.state==1">提现成功</text>
<text style="margin-bottom: 8upx;color: #2FB57A" v-if="item.state==0">提现中 </text>
<text style="margin-bottom: 8upx;color: #e10a07" v-if="item.state==-1">提现失败提现金额已退回钱包</text>
</view>
<text style="color: #ecd4b4;font-size: 32upx;font-weight: 600"> {{item.money}}</text>
</view>
<view style="color: #999999;font-size: 28upx;">
<!-- <view style="margin-bottom: 8upx" v-if="item.classify ==1">支付宝提现</view> -->
<view style="margin-bottom: 8upx" v-if="item.classify == 1"> 支付宝账号{{item.zhifubao}}</view>
<view style="margin-bottom: 8upx" v-if="item.classify == 1"> 支付宝姓名{{item.zhifubaoName}}</view>
<view style="margin-bottom: 8upx"> 创建时间{{item.createAt}}</view>
<view style="margin-bottom: 8upx;text-align: right;">
<text v-if="item.type == -1" class="text-olive"
style="font-size: 32upx;font-weight: 600"><text
class="text-olive">+</text>{{item.money}}</text>
<text v-if="item.state == 1||item.state == 0" class="text-red" style="font-size: 32upx;font-weight: 600"><text
class="text-red">-</text>{{item.money}}</text>
</view>
</view>
</view>
</view>
<!-- 加载更多提示 -->
<!-- <view class="s-col is-col-24" v-if="list.length > 0">
<load-more :loadingType="loadingType" :contentText="contentText"></load-more>
</view> -->
<!-- 加载更多提示 -->
<!-- <empty v-if="list.length === 0" des="暂无明细数据" show="false"></empty> -->
<empty v-if="list.length == 0" content="暂无明细"></empty>
</view>
</view>
</template>
<script>
import empty from '@/components/empty.vue'
export default {
components: {
empty
},
data() {
return {
list: [],
page: 1,
limit: 10,
tabIndex: 1,
checkReZhiShu: '否',
checkReTuanZhang: '否',
checkReFeiZhiShu: '否',
scrollTop: false,
contentText: {
contentdown: '上拉显示更多',
contentrefresh: '正在加载...',
contentnomore: '没有更多数据了'
}
}
},
onLoad() {
this.$queue.showLoading("加载中...");
this.getList();
},
onPageScroll: function(e) {
this.scrollTop = e.scrollTop > 200;
},
methods: {
getList() {
let userId = this.$queue.getData('userId');
let data = {
page: this.page,
limit: this.limit,
shopId:uni.getStorageSync('shopId')
}
this.$Request.getT('/shop/shopmoney/selectCashOutList', data).then(res => {
if (res.code === 0) {
if (this.page === 1) {
this.list = res.data.list;
} else {
this.list = [...this.list, ...res.data.list];
}
}
uni.stopPullDownRefresh();
uni.hideLoading();
});
}
},
onReachBottom: function() {
this.page = this.page + 1;
this.getList();
},
onPullDownRefresh: function() {
this.page = 1;
this.getList();
}
}
</script>
<style lang="less">
page {
background: #FFFFFF;
}
.tui-tab-item-title {
// color: #ffffff;
font-size: 30rpx;
height: 80rpx;
line-height: 80rpx;
flex-wrap: nowrap;
white-space: nowrap;
}
.tui-tab-item-title-active {
border-bottom: 1px solid #557EFD;
color: #557EFD;
font-size: 32upx;
font-weight: bold;
border-bottom-width: 6upx;
text-align: center;
}
.item {
background: #FFFFFF;
padding: 32rpx;
margin: 32rpx;
font-size: 28rpx;
box-shadow: 7px 9px 34px rgba(0, 0, 0, 0.1);
border-radius: 16upx;
}
</style>

127
my/other/moneylist.vue Normal file
View File

@@ -0,0 +1,127 @@
<template>
<view>
<view style="text-align: left;padding-bottom: 10rpx;">
<view v-for="(item, index) in list" :key="index" class="item">
<view>
<!-- <view style="margin-bottom: 8upx;text-align: right;">
<text v-if="item.type == 1" style="margin-bottom: 8upx;color: #ecd4b4">充值</text>
<text v-if="item.type == 2" style="margin-bottom: 8upx;color: #ecd4b4">提现</text>
</view> -->
<view style="color: #999999;font-size: 28upx;">
<view style="margin-bottom: 8upx">{{item.title}}</view>
<!-- <view v-if="item.classify === 2" style="margin-bottom: 8upx"> 返佣类型直属返佣</view> -->
<!-- <view v-if="item.classify === 3" style="margin-bottom: 8upx"> 返佣类型非直属支付</view> -->
<view style="margin-bottom: 8upx">{{item.content}}</view>
<view style="margin-bottom: 8upx"> 创建时间{{item.createTime}}</view>
<view style="margin-bottom: 8upx;text-align: right;">
<text v-if="item.type == 1" class="text-olive" style="font-size: 32upx;font-weight: 600"><text class="text-olive">+</text>{{item.money}}</text>
<text v-if="item.type == 2" class="text-red" style="font-size: 32upx;font-weight: 600"><text class="text-red">-</text>{{item.money}}</text>
</view>
</view>
</view>
</view>
<!-- 加载更多提示 -->
<!-- <view class="s-col is-col-24" v-if="list.length > 0">
<load-more :loadingType="loadingType" :contentText="contentText"></load-more>
</view> -->
<!-- 加载更多提示 -->
<!-- <empty v-if="list.length === 0" des="暂无明细数据" show="false"></empty> -->
<empty v-if="list.length == 0" content="暂无明细" ></empty>
</view>
</view>
</template>
<script>
import empty from '@/components/empty.vue'
export default {
components: {
empty
},
data() {
return {
list: [],
page: 1,
limit: 10,
tabIndex: 1,
checkReZhiShu: '否',
checkReTuanZhang: '否',
checkReFeiZhiShu: '否',
scrollTop: false,
contentText: {
contentdown: '上拉显示更多',
contentrefresh: '正在加载...',
contentnomore: '没有更多数据了'
}
}
},
onLoad() {
this.$queue.showLoading("加载中...");
this.getList();
},
onPageScroll: function(e) {
this.scrollTop = e.scrollTop > 200;
},
methods: {
getList() {
let userId = this.$queue.getData('userId');
let data = {
page: this.page,
limit: this.limit,
classify:2
}
this.$Request.getT('/shop/shopmoney/selectShopCashDeposit',data ).then(res => {
if (res.code === 0) {
if (this.page === 1) {
this.list = res.data.list;
} else {
this.list = [...this.list, ...res.data.list];
}
}
uni.stopPullDownRefresh();
uni.hideLoading();
});
}
},
onReachBottom: function() {
this.page = this.page + 1;
this.getList();
},
onPullDownRefresh: function() {
this.page = 1;
this.getList();
}
}
</script>
<style lang="less">
page {
background: #FFFFFF;
}
.tui-tab-item-title {
// color: #ffffff;
font-size: 30rpx;
height: 80rpx;
line-height: 80rpx;
flex-wrap: nowrap;
white-space: nowrap;
}
.tui-tab-item-title-active {
border-bottom: 1px solid #557EFD;
color: #557EFD;
font-size: 32upx;
font-weight: bold;
border-bottom-width: 6upx;
text-align: center;
}
.item {
background: #FFFFFF;
padding: 32rpx;
margin: 32rpx;
font-size: 28rpx;
box-shadow: 7px 9px 34px rgba(0, 0, 0, 0.1);
border-radius: 16upx;
}
</style>

345
my/other/myComplain.vue Normal file
View File

@@ -0,0 +1,345 @@
<template>
<view class="content">
<view class="complain_cont">
<view class="complain_tabs" v-show="!isShow">
<u-tabs :list="list" :is-scroll="true" name="illegal" :current="current" active-color="#FF7F00"
@change="change"></u-tabs>
</view>
</view>
<u-tabs :list="listTab" :is-scroll="false" inactive-color="#333333" active-color="#FF7F00" :current="currentIndex" @change="changeTab">
</u-tabs>
<view class="tabs_box dis">
<!-- 全部 -->
<view class="complain_box" v-for="(item,index) in orderlist" :key="index" @click="bindonline(item)">
<view class="complain_part1">
<view class="part1_left">{{item.illegal}}</view>
<!-- <view class="part1_left" v-if="item.complaintType=='2'">拒绝系统推单</view> -->
<!-- <view class="part1_left" v-if="item.complaintType=='3'">残损违规</view> -->
<view class="part1_right">扣款{{item.deductMoney}}</view>
</view>
<view class="complain_part2" v-if="item.shipAddressDetail">
<image src="../../../static/image/black.png"></image>
<text>{{item.shipAddressDetail}}</text>
</view>
<view class="complain_part2" v-if="item.deilveryAddressDetail">
<image src="../../../static/image/orange.png"></image>
<text>{{item.deilveryAddressDetail}}</text>
</view>
<u-line color="#E6E6E6" />
<view class="complain_title">
<span v-if="item.complaintState=='1'">可申诉</span>
<span v-if="item.complaintState=='2'">申诉中</span>
<span v-if="item.complaintState=='3'">申诉未通过</span>
<span v-if="item.complaintState=='4'">申诉通过</span>
</view>
</view>
<view class="empty" v-if="orderlist.length == 0">
<view
style="display: block; width: 90%; margin: 0 auto; position: fixed;top: 35%;left: 0rpx;right: 0rpx;text-align: center;">
<image src="../../../static/image/empty.png" style="width: 300rpx;height: 300rpx;"></image>
<view style="color: #CCCCCC;">暂无内容</view>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
isShow: false,
page: 1,
limit: 10,
complaintType: null,
complaintState: '',
listTab: [{
name: '全部'
}, {
name: '可申诉'
}, {
name: '申诉中'
}, {
name: '申诉未通过'
}, {
name: '申诉通过'
}],
currentIndex: 0,
list: [{
id: '',
illegal: '全部'
}],
current: 0,
orderlist: [],
totalCount: 0,
illegalId: ''
}
},
mounted() {
},
onLoad() {
this.getTypeList()
this.bindorder()
},
methods: {
getTypeList() {
this.$Request.getT('/app/illegalType/selectIllegalTypeList').then(res => {
if (res.code == 0) {
this.list = [...this.list, ...res.data]
}
});
},
bindlist(index) {
console.log(index)
this.current = index;
this.isShow = !this.isShow
},
// 获取全部数据
bindorder() {
this.$Request.getT('/app/indent/findAllComplaint', {
page: this.page,
limit: this.limit,
complaintState: this.complaintState,
illegalId: this.illegalId
}).then(res => {
if (res.code == 0) {
this.totalCount = res.data.totalCount
if (this.page == 1) {
this.orderlist = res.data.list
} else {
this.orderlist = this.list_box.concat(res.data.list)
}
} else {
console.log('失败:', res.data)
}
});
},
change(index) {
console.log(index)
this.illegalId = this.list[index].id
this.orderlist = []
this.current = index;
this.currentIndex = 0
this.page = 1
this.complaintState = ''
this.bindorder()
},
changeTab(index) {
this.orderlist = []
this.currentIndex = index
this.page = 1
if (index == 0) {
this.complaintState = ''
} else {
this.complaintState = index
}
this.bindorder()
},
bindonline(item) {
// if(item.complaintState == 1 || item.complaintState == 4) {
uni.navigateTo({
url: '/pages/riderMy/myComplain/online_complain/online_complain?indentNumber=' + item
.indentNumber + '&complaintId=' + item.complaintId
})
// }
},
bindshow() {
this.isShow = !this.isShow
},
},
// 上拉加载
onReachBottom: function() {
if (this.page < this.totalCount) {
this.page = this.page + 1;
} else {
uni.showToast({
title: '已经最后一页啦',
icon: 'none'
})
}
this.bindorder();
}
}
</script>
<style>
body {
background-color: #F5F5F5;
}
.empty {
width: 100%;
background: #ffffff;
/* #ifdef MP-WEIXIN */
height: 93vh;
/* #endif */
/* #ifndef MP-WEIXIN */
height: 80vh;
/* #endif */
}
.u-tab-item {
font-weight: 400 !important;
color: #000000 !important;
font-size: 24rpx !important;
}
.tabs_box {
/* display: none; */
/* position: absolute; */
/* top: 144rpx; */
}
.dis {
/* display: block; */
/* width: 100%; */
/* position: absolute; */
/* top: 100rpx; */
}
.content {
width: 100%;
position: relative;
}
.complain_cont {
width: 100%;
position: relative;
/* display: flex; */
}
.complain_tabs {
width: 100%;
}
.complain_btn {
width: 15%;
background: #FFFFFF;
box-shadow: -2rpx 1rpx 3rpx 0rpx rgba(39, 39, 39, 0.11);
height: 88rpx;
position: absolute;
top: 0rpx;
right: 0rpx;
z-index: 10075;
}
.btn {
color: #999999;
font-size: 25rpx;
letter-spacing: 2rpx;
text-align: center;
line-height: 88rpx;
}
.complain_none {
width: 15%;
background: #FFFFFF;
box-shadow: -2rpx 1rpx 3rpx 0rpx rgba(39, 39, 39, 0.11);
height: 88rpx;
position: absolute;
top: 88rpx;
right: 0rpx;
}
.popup_list {
width: 97%;
margin: 0 auto;
position: relative;
top: 90rpx;
}
.list_tabs {
width: 90%;
height: auto;
display: flex;
justify-content: start;
flex-wrap: wrap;
}
.tabs {
border: 1rpx solid #cccccc;
padding: 0rpx 25rpx;
line-height: 50rpx;
margin: 10rpx 10rpx;
}
/* 全部 */
.complain_box {
width: 90%;
margin: 0 auto;
/* height: 300rpx; */
background: #ffffff;
margin-top: 30rpx;
border-radius: 17rpx;
}
.complain_part1 {
width: 90%;
margin: 0 auto;
display: flex;
/* padding-top: 20rpx; */
}
.part1_left {
flex: 1;
font-size: 26rpx;
font-weight: bold;
letter-spacing: 2rpx;
height: 80rpx;
justify-content: left;
align-items: center;
display: flex;
}
.part1_right {
flex: 1;
color: #FF1B1B;
display: flex;
justify-content: flex-end;
align-items: center;
}
.complain_part2 {
width: 90%;
margin: 0 auto;
height: 50rpx;
display: flex;
justify-content: left;
align-items: center;
}
.complain_part2 image {
width: 15rpx;
height: 15rpx;
margin-right: 20rpx;
}
.complain_part2 text {
color: #999999;
font-size: 24rpx;
}
.u-line {
border-bottom-width: 3px !important;
margin-top: 20rpx !important;
}
.complain_title {
width: 90%;
margin: 0 auto;
height: 80rpx;
display: flex;
justify-content: flex-end;
align-items: center;
color: #FF2727;
font-size: 27rpx;
font-weight: bold;
letter-spacing: 2rpx;
}
</style>

129
my/other/set.vue Normal file
View File

@@ -0,0 +1,129 @@
<template>
<view class=" padding-lr">
<view class="flex padding-tb" v-if="userId" @click="goNav('/pages/my/pwd')">
<view class="flex-sub text-df" style="line-height: 50upx;">修改密码</view>
<image src="../../static/images/my/right.png" style="line-height: 50upx;width: 18rpx;height: 30rpx;">
</image>
</view>
<view class="flex padding-tb" @click="goNav('/my/other/help')">
<view class="flex-sub text-df" style="line-height: 50upx;">帮助中心</view>
<image src="../../static/images/my/right.png" style="line-height: 50upx;width: 18rpx;height: 30rpx;">
</image>
</view>
<view class="flex padding-tb" @click="goNav('/my/other/xieyi')">
<view class="flex-sub text-df" style="line-height: 50upx;">用户协议</view>
<image src="../../static/images/my/right.png" style="line-height: 50upx;width: 18rpx;height: 30rpx;">
</image>
</view>
<view class="flex padding-tb" @click="goNav('/my/other/mimi')">
<view class="flex-sub text-df" style="line-height: 50upx;">隐私政策</view>
<image src="../../static/images/my/right.png" style="line-height: 50upx;width: 18rpx;height: 30rpx;">
</image>
</view>
<view class="flex padding-tb" @click="goNav('/my/other/about')">
<view class="flex-sub text-df" style="line-height: 50upx;">关于我们</view>
<image src="../../static/images/my/right.png" style="line-height: 50upx;width: 18rpx;height: 30rpx;">
</image>
</view>
<view class="btn" v-if="userId" @click="TuiLogin">退出登录</view>
</view>
</template>
<script>
export default {
data() {
return {
userId: ""
}
},
onLoad() {
this.userId = uni.getStorageSync('userId')
},
methods: {
goNav(e) {
uni.navigateTo({
url: e
})
},
//退出登录
TuiLogin() {
let that = this
if (that.userId) {
uni.showModal({
title: '提示',
content: '确定退出登录吗?',
success: function(res) {
if (res.confirm) {
console.log('用户点击确定');
uni.removeStorageSync('shopUserName')
uni.removeStorageSync('shopCover')
uni.removeStorageSync('userId')
uni.removeStorageSync('token')
uni.removeStorageSync('mobile')
uni.removeStorageSync('zhiFuBaoName')
uni.removeStorageSync('zhiFuBao')
uni.removeStorageSync('invitationCode')
uni.removeStorageSync('unionId')
uni.removeStorageSync('openId')
uni.removeStorageSync('shopToken')
uni.removeStorageSync('shopId')
uni.showToast({
title: '退出成功!',
icon: 'none'
})
uni.navigateBack()
// that.isLogin = true
// that.shopName = '匿名'
// this.sumMoney = 0 //累计余额
// this.dayMoney = 0 //今日收益
// this.monthMoney = 0 //本月收益
// this.cashMoney = 0 //本月提现
// that.shopCover = '../../static/logo.png'
// that.userId = uni.getStorageSync('userId')
} else if (res.cancel) {
console.log('用户点击取消');
}
}
})
} else {
uni.showModal({
title: '提示',
content: '您还未登录,请先登录',
success: function(res) {
if (res.confirm) {
console.log('用户点击确定');
uni.navigateTo({
url: '/pages/my/loginphone'
})
} else if (res.cancel) {
console.log('用户点击取消');
}
}
})
}
},
}
}
</script>
<style>
page {
background: #FFFFFF;
}
.btn {
width: 100%;
height: 80upx;
background: #FCD202;
border-radius: 6upx;
text-align: center;
line-height: 80upx;
margin-top: 40upx;
font-size: 34upx;
/* color: #fff; */
}
</style>

363
my/other/tousu.vue Normal file
View File

@@ -0,0 +1,363 @@
<template>
<view class="content">
<!-- <view class="complain_cont">
<view class="complain_tabs" v-show="!isShow">
<u-tabs :list="list" :is-scroll="true" name="illegal" :current="current" active-color="#FF7F00"
@change="change"></u-tabs>
</view>
</view> -->
<!-- <u-tabs :list="listTab" :is-scroll="false" inactive-color="#333333" active-color="#FF7F00" :current="currentIndex" @change="changeTab">
</u-tabs> -->
<view class="tabs_box dis">
<!-- 全部 -->
<view class="complain_box padding-bottom-xs" v-for="(item,index) in orderlist" :key="index" @click="bindonline(item)">
<view class="complain_part1 ">
<view class="part1_left">{{item.shopIllegal}}</view>
<!-- <view class="part1_left" v-if="item.complaintType=='2'">拒绝系统推单</view> -->
<!-- <view class="part1_left" v-if="item.complaintType=='3'">残损违规</view> -->
<!-- <view class="part1_right">扣款{{item.deductMoney}}</view> -->
<view class="complain_title">
<span v-if="item.complaintState=='1'">投诉成功</span>
<!-- <span v-if="item.complaintState=='2'">申诉中</span> -->
<!-- <span v-if="item.complaintState=='3'">申诉未通过</span> -->
<!-- <span v-if="item.complaintState=='4'">申诉通过</span> -->
<span v-if="item.complaintState=='5'">投诉审核中</span>
<span v-if="item.complaintState=='6'">投诉未通过</span>
</view>
</view>
<view class="complain_part2" v-if="item.shopAddressDetail">
<image src="../static/black.png"></image>
<text>{{item.shopAddressDetail}}</text>
</view>
<view class="complain_part2" v-if="item.userAddressDetail">
<image src="../static/orange.png"></image>
<text>{{item.userAddressDetail}}</text>
</view>
<view class="complain_part2" v-if="item.complaintTime">
<image src="../static/black.png"></image>
<text>投诉时间{{item.complaintTime}}</text>
</view>
<view class="complain_part2" v-if="item.indentNumber">
<image src="../static/orange.png"></image>
<text>订单号{{item.indentNumber}}</text>
</view>
<!-- <u-line color="#E6E6E6" /> -->
</view>
<!-- <view class="empty" v-if="orderlist.length == 0">
<view
style="display: block; width: 90%; margin: 0 auto; position: fixed;top: 35%;left: 0rpx;right: 0rpx;text-align: center;">
<image src="../../../static/image/empty.png" style="width: 300rpx;height: 300rpx;"></image>
<view style="color: #CCCCCC;">暂无内容</view>
</view>
</view> -->
<empty v-if="!orderlist.length" style="z-index:0;position: relative;top: -20px;"></empty>
</view>
</view>
</template>
<script>
import empty from '@/components/empty.vue'
export default {
components: {
empty
},
data() {
return {
isShow: false,
page: 1,
limit: 10,
complaintType: null,
complaintState: '',
listTab: [{
name: '全部'
}, {
name: '可申诉'
}, {
name: '申诉中'
}, {
name: '申诉未通过'
}, {
name: '申诉通过'
}],
currentIndex: 0,
list: [{
id: '',
illegal: '全部'
}],
current: 0,
orderlist: [],
totalCount: 0,
illegalId: ''
}
},
mounted() {
},
onLoad() {
this.getTypeList()
this.bindorder()
},
methods: {
getTypeList() {
this.$Request.getT('/app/illegalType/selectIllegalTypeList').then(res => {
if (res.code == 0) {
this.list = [...this.list, ...res.data]
}
});
},
bindlist(index) {
console.log(index)
this.current = index;
this.isShow = !this.isShow
},
// 获取全部数据
bindorder() {
this.$Request.getT('/app/shop/selectComplaint', {
page: this.page,
limit: this.limit,
shopId:uni.getStorageSync('shopId')
// complaintState: this.complaintState,
// illegalId: this.illegalId
}).then(res => {
if (res.code == 0) {
this.totalCount = res.data.totalCount
if (this.page == 1) {
this.orderlist = res.data.list
} else {
this.orderlist = this.list_box.concat(res.data.list)
}
} else {
console.log('失败:', res.data)
}
});
},
change(index) {
console.log(index)
this.illegalId = this.list[index].id
this.orderlist = []
this.current = index;
this.currentIndex = 0
this.page = 1
this.complaintState = ''
this.bindorder()
},
changeTab(index) {
this.orderlist = []
this.currentIndex = index
this.page = 1
if (index == 0) {
this.complaintState = ''
} else {
this.complaintState = index
}
this.bindorder()
},
bindonline(item) {
// if(item.complaintState == 1 || item.complaintState == 4) {
uni.navigateTo({
url: '/my/other/detail?indentNumber=' + item
.indentNumber + '&complaintId=' + item.complaintId
})
// }
},
bindshow() {
this.isShow = !this.isShow
},
},
// 上拉加载
onReachBottom: function() {
if (this.page < this.totalCount) {
this.page = this.page + 1;
} else {
uni.showToast({
title: '已经最后一页啦',
icon: 'none'
})
}
this.bindorder();
}
}
</script>
<style>
body {
background-color: #F5F5F5;
}
.empty {
width: 100%;
background: #ffffff;
/* #ifdef MP-WEIXIN */
height: 93vh;
/* #endif */
/* #ifndef MP-WEIXIN */
height: 80vh;
/* #endif */
}
.u-tab-item {
font-weight: 400 !important;
color: #000000 !important;
font-size: 24rpx !important;
}
.tabs_box {
/* display: none; */
/* position: absolute; */
/* top: 144rpx; */
}
.dis {
/* display: block; */
/* width: 100%; */
/* position: absolute; */
/* top: 100rpx; */
}
.content {
width: 100%;
position: relative;
}
.complain_cont {
width: 100%;
position: relative;
/* display: flex; */
}
.complain_tabs {
width: 100%;
}
.complain_btn {
width: 15%;
background: #FFFFFF;
box-shadow: -2rpx 1rpx 3rpx 0rpx rgba(39, 39, 39, 0.11);
height: 88rpx;
position: absolute;
top: 0rpx;
right: 0rpx;
z-index: 10075;
}
.btn {
color: #999999;
font-size: 25rpx;
letter-spacing: 2rpx;
text-align: center;
line-height: 88rpx;
}
.complain_none {
width: 15%;
background: #FFFFFF;
box-shadow: -2rpx 1rpx 3rpx 0rpx rgba(39, 39, 39, 0.11);
height: 88rpx;
position: absolute;
top: 88rpx;
right: 0rpx;
}
.popup_list {
width: 97%;
margin: 0 auto;
position: relative;
top: 90rpx;
}
.list_tabs {
width: 90%;
height: auto;
display: flex;
justify-content: start;
flex-wrap: wrap;
}
.tabs {
border: 1rpx solid #cccccc;
padding: 0rpx 25rpx;
line-height: 50rpx;
margin: 10rpx 10rpx;
}
/* 全部 */
.complain_box {
width: 90%;
margin: 0 auto;
/* height: 300rpx; */
background: #ffffff;
margin-top: 30rpx;
border-radius: 17rpx;
}
.complain_part1 {
width: 90%;
margin: 0 auto;
display: flex;
/* padding-top: 20rpx; */
}
.part1_left {
flex: 1;
font-size: 26rpx;
font-weight: bold;
letter-spacing: 2rpx;
height: 80rpx;
justify-content: left;
align-items: center;
display: flex;
}
.part1_right {
flex: 1;
color: #FF1B1B;
display: flex;
justify-content: flex-end;
align-items: center;
}
.complain_part2 {
width: 90%;
margin: 0 auto;
height: 50rpx;
display: flex;
justify-content: left;
align-items: center;
}
.complain_part2 image {
width: 15rpx;
height: 15rpx;
margin-right: 20rpx;
}
.complain_part2 text {
color: #999999;
font-size: 24rpx;
}
.u-line {
border-bottom-width: 3px !important;
margin-top: 20rpx !important;
}
.complain_title {
/* width: 90%; */
margin: 0 auto;
height: 80rpx;
display: flex;
justify-content: flex-end;
align-items: center;
color: #FF2727;
font-size: 27rpx;
font-weight: bold;
letter-spacing: 2rpx;
}
</style>

253
my/other/wallet.vue Normal file
View File

@@ -0,0 +1,253 @@
<template>
<view class="content">
<view style="background: #FFFFFF;">
<view class="view1" style="text-align: center;">
<view class="view_top">
<view class="view_name">总资产()</view>
<view style="font-size: 29px;">{{ money }}<text
style="font-size: 31rpx;margin-left: 15rpx;"></text></view>
<!-- <view class="margin-top padding-top">累计提现金额{{ totalMoney }}</view> -->
</view>
</view>
<view class="view2-views">
<view class="view2_box">
<view class="name">账户余额()</view>
<view class="money">{{money}}</view>
</view>
<view class="btn" @tap="getOut">提现</view>
</view>
</view>
<view class="view2">
<view class="view2-view" @tap="moneyList">
<image src="https://api.shengqianxiong.com.cn/img/20201118/22f17a68dc7446d6bef8e0a7a6cbac55.png"
class="view2-view-image"></image>
<view class="view2-view1">
<view class="view2-view-text">钱包明细</view>
<image
src="https://api.shengqianxiong.com.cn/file/uploadPath/2021/10/08/9a7ea5f18fae76c2f9c9d5b3e8323f4e.png"
class="view2-view-image-right"></image>
</view>
</view>
<view class="view2-view" @click="goZhifuBao">
<image src="https://api.shengqianxiong.com.cn/img/20201118/86efb280c3d2416e86e7b1900bbe17ff.png"
class="view2-view-image"></image>
<view class="view2-view1">
<view class="view2-view-text">提现账号</view>
<image
src="https://api.shengqianxiong.com.cn/file/uploadPath/2021/10/08/9a7ea5f18fae76c2f9c9d5b3e8323f4e.png"
class="view2-view-image-right"></image>
</view>
</view>
<view class="view2-view" @tap="list">
<image src="https://api.shengqianxiong.com.cn/img/20201118/5ce91ac860334fc9ac09c977467607cd.png"
class="view2-view-image"></image>
<view class="view2-view1">
<view class="view2-view-text">提现记录</view>
<image
src="https://api.shengqianxiong.com.cn/file/uploadPath/2021/10/08/9a7ea5f18fae76c2f9c9d5b3e8323f4e.png"
class="view2-view-image-right"></image>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
money: '0.00',
zhifubao: '',
walletmoney: '0.00',
totalMoney: '0.00',
zhifubaoName: '',
}
},
onLoad() {
this.getwalletMoney();
},
onShow: function(e) {
// this.getMoney();
this.getwalletMoney();
},
methods: {
ketixian() {
uni.showModal({
showCancel: false,
confirmColor: '#e10a07',
title: '可提现金额说明',
content: '可提现金额是我们通过在商城中购买商品后返利的佣金,这个金额是可提现的'
});
},
leijitixian() {
uni.showModal({
showCancel: false,
confirmColor: '#e10a07',
title: '累计提现金额说明',
content: '累计提现金额是我们过往提现成功金额的总计'
});
},
moneyList() {
uni.navigateTo({
url: '/my/other/cashList'
})
},
list() {
uni.navigateTo({
url: '/my/other/moneydetail'
})
},
goZhifuBao() {
uni.navigateTo({
url: "/my/other/zhifubao"
})
},
//获取账户余额
getwalletMoney() {
this.$Request.getT('/shop/shopmoney/selectShopMoney').then(res => {
if (res.code == 0) {
this.money = res.data.money;
}
uni.hideLoading();
});
},
// getMoney() {
// let that = this;
// let token = this.$queue.getData("token");
// let userId = this.$queue.getData("userId");
// if (token) {
// //this.$queue.showLoading("加载中...");
// //可以提现金额查询预估收入查询
// this.$Request.getT("/cash/money/" + userId).then(res => {
// if (res.status === 0 && res.data) {
// // that.money = parseFloat(res.data).toFixed(2);
// } else if (res.status === -102) {
// this.$queue.showToast(res.msg);
// this.$queue.logout();
// uni.navigateTo({
// url: '/pages/member/register'
// });
// } else {
// // that.money = '0.00';
// //this.$queue.showToast(res.msg);
// }
// });
// this.$Request.getT("/cash/userinfo/" + userId).then(res => {
// if (res.status === 0 && res.data) {
// that.zhifubao = res.data.zhifubao;
// that.zhifubaoName = res.data.zhifubaoName;
// }
// uni.hideLoading();
// });
// //总的提现记录
// this.$Request.getT("/cash/countByRelationId/" + this.$queue.getData("relation_id")).then(res => {
// if (res.status === 0 && res.data) {
// that.totalMoney = parseFloat(res.data).toFixed(2);
// } else {
// that.totalMoney = '0.00';
// }
// });
// }
// },
getOut() {
uni.navigateTo({
url: '/my/other/cashDetail'
});
},
},
}
</script>
<style lang='less'>
/* @import "../../static/css/index.css"; */
.view_top {
padding: 35rpx 55rpx;
}
.view_name {
font-size: 32rpx;
letter-spacing: 2rpx;
font-family: serif;
margin-bottom: 10rpx;
}
.view1 {
width: 90%;
margin: 0 auto;
height: 320rpx;
border-radius: 16upx;
/* color: #FFFFFF; */
background: linear-gradient(to right, #FCB202 0, #FCD202 100%);
}
.view2 {
background-color: #ffffff;
margin-top: 15rpx;
}
.name {
font-size: 28rpx;
}
.money {
margin-top: 12rpx;
font-size: 48rpx;
}
.btn {
background: #FCD202;
/* color: white; */
text-align: center;
width: 24%;
padding: 16rpx 0rpx;
border-radius: 6rpx;
}
.view2-view {
display: flex;
width: 100%;
height: 110rpx;
align-items: center;
}
.view2-views {
display: flex;
width: 90%;
margin: 0 auto;
height: 140rpx;
align-items: center;
justify-content: space-between;
margin-top: 30rpx;
}
.view2-view1 {
display: flex;
flex-direction: row;
width: 90%;
align-items: center;
}
.view2-view-image {
margin-left: 40upx;
width: 50upx;
height: 50upx;
}
.view2-view-text {
font-size: 14px;
color: #000000;
margin-left: 40upx;
width: 80%;
}
.view2-view-image-right {
width: 19rpx;
height: 31rpx;
margin-left: 30rpx;
}
</style>

44
my/other/xieyi.vue Normal file
View File

@@ -0,0 +1,44 @@
<template>
<view style="line-height: 26px;padding: 32upx;" class="bg-white">
<!-- <view v-html="tit"> </view> -->
<view style="font-size: 28upx;" v-html="content"></view>
</view>
</template>
<script>
export default {
data() {
return {
tit: '',
content: ''
}
},
onLoad() {
// this.getGuize();
// 用户协议
this.$Request.getT('/app/common/type/236').then(res => { //用户完成成功
if (res.code == 0) {
if (res.data && res.data.value) {
this.content = res.data.value;
}
}
})
},
methods: {
getGuize() {
this.$Request.getT('/app/userinfo/userAgreement').then(res => {
if (res.code == 0) {
this.content = res.data.value;
// this.tit = res.data.min
}
});
}
}
}
</script>
<style>
page {
background: #FFFFFF;
}
</style>

151
my/other/zhifubao.vue Normal file
View File

@@ -0,0 +1,151 @@
<template>
<view class="container" v-if="XCXIsSelect=='是'">
<list-cell title="收款人姓名" type="text" placeholder="请输入支付宝收款人姓名" v-model="zhiFuBaoName"></list-cell>
<list-cell title="支付宝账号" type="text" placeholder="请输入要绑定的支付宝账号" v-model="zhiFuBao"></list-cell>
<wButton text="绑定账户" :rotate="logining" @click.native="toLogin()"></wButton>
<view style="padding: 32upx 64upx;font-size: 24upx;color: #999999;">提示请正确填写收款人的支付宝账户和真实的收款人姓名否则将无法正常收款</view>
</view>
</view>
</template>
<script>
import listCell from '../components/com-input';
import wButton from '../components/watch-login/watch-button.vue'; //button
export default {
components: {
listCell,
wButton
},
data() {
return {
zhiFuBao: '',
zhiFuBaoName: '',
logining: false,
XCXIsSelect: '否'
}
},
onLoad() {
// #ifdef MP-WEIXIN
this.XCXIsSelect = this.$queue.getData('XCXIsSelect');
// #endif
// #ifndef MP-WEIXIN
this.XCXIsSelect = '是'
// #endif
if (this.XCXIsSelect == '否') {
uni.setNavigationBarTitle({
title: '隐私政策'
});
} else {
uni.setNavigationBarTitle({
title: '提现账号'
});
}
this.getUserInfo()
let userId = this.$queue.getData("userId");
if (userId) {
this.$Request.get("/sys/user/info").then(res => {
if (res.code == 0) {
if (res.user.userEntity.zhiFuBao) {
this.zhiFuBao = res.user.userEntity.zhiFuBao;
}
if (res.user.userEntity.zhiFuBaoName) {
this.zhiFuBaoName = res.user.userEntity.zhiFuBaoName;
}
}
});
}
},
methods: {
inputChange(e) {
const key = e.currentTarget.dataset.key;
this[key] = e.detail.value;
},
navBack() {
uni.navigateBack();
},
toLogin() {
let userId = this.$queue.getData("userId");
let token = uni.getStorageSync("token");
const {
zhiFuBao,
zhiFuBaoName
} = this;
if (!zhiFuBao) {
this.$queue.showToast("请设置收款人支付宝账号");
} else if (!zhiFuBaoName) {
this.$queue.showToast("请设置收款人姓名");
} else {
this.$queue.showLoading("修改中...");
let data = {
zhiFuBao: this.zhiFuBao,
zhiFuBaoName: this.zhiFuBaoName
}
this.$Request.postJson('/shop/shopmoney/updateUser', data).then(res => {
if (res.code === 0) {
// uni.setStorageSync('zhiFuBao',zhiFuBao)
// uni.setStorageSync('zhiFuBaoName',zhiFuBaoName)
uni.showToast({
title: '修改成功',
icon: 'none',
complete() {
setTimeout(function() {
uni.navigateBack();
}, 1000)
}
})
} else {
this.$queue.showToast(res.msg)
}
uni.hideLoading();
});
}
},
getUserInfo() {
this.$Request.getA("/sys/user/info").then(res => {
if (res.code == 0) {
this.$queue.setData("zhiFuBao", res.user.userEntity.zhiFuBao);
this.$queue.setData("zhiFuBaoName", res.user.userEntity.zhiFuBaoName);
}
});
},
},
}
</script>
<style lang='scss'>
page {
background-color: #FFFFFF;
}
.container {
padding-top: 32upx;
position: relative;
width: 100%;
height: 100%;
overflow: hidden;
background: #FFFFFF;
}
.confirm-btn {
width: 300px;
height: 42px;
line-height: 42px;
border-radius: 30px;
margin-top: 70upx;
background: #e10a07;
color: #fff;
font-size: 32rpx;
&:after {
border-radius: 60px;
}
}
</style>

957
my/publish/goods.vue Normal file
View File

@@ -0,0 +1,957 @@
<template>
<view class="padding">
<view class="text-white padding bg radius">
<u-form :model="shop" label-position="top">
<u-form-item label="商品标题">
<u-input v-model="shop.goodsName" placeholder="请填写商品标题" />
</u-form-item>
<u-form-item label="商品分类">
<u-input v-model="shop.classifyName" placeholder="请选择" :disabled="true" @click="getflshow()" />
</u-form-item>
<u-form-item label="商品标签">
<!-- <u-input v-model="" placeholder="请填写" /> -->
<view class="flex align-center flex-wrap margin-bottom-sm">
<view v-for="(item,index) in goodsLabel" :key="index" class="btn flex align-center margin-top">
<view>{{item}}</view>
<view class="margin-left-sm" @tap.stop="bindupdata(index)">x</view>
</view>
<view class="btns margin-top" @click="addtype1()">+添加</view>
</view>
</u-form-item>
<u-form-item label="商品原价">
<u-input v-model="shop.originalMoney" @input="ZheKouInput" placeholder="请填写" />
</u-form-item>
<u-form-item label="打包费">
<u-input v-model="shop.packMoney" placeholder="请填写" />
</u-form-item>
<u-form-item label="商品售价">
<u-input v-model="shop.goodsMoney" @input="ZheKouInput" placeholder="请填写" />
</u-form-item>
<view class="padding bg radius margin-tb" style="padding: 10px 0;">
<view>
<view class="text-lg" style="color: #333;">商品描述</view>
<view class="margin-tb-sm">
<u-input v-model="shop.goodsDescribe" type="textarea" height="200" placeholde="请描述一下您的特长"
maxlengt="200" :clearable="false" style="background:#F5F5F5;" />
</view>
</view>
<view>
<view class="text-lg margin-top-sm text-black">商品封面图</view>
<view class="flex" style="overflow: hidden;flex-wrap: wrap;">
<view v-if="shop.goodsCover.length">
<view class="margin-top flex margin-right-sm flex-wrap">
<view class="flex"
style="width: 200rpx;height: 200rpx;margin-right: 2rpx;position: relative;">
<image :src="shop.goodsCover" style="width: 100%;height: 100%;"></image>
<view style="z-index: 9;position: absolute;top: -15rpx;right: -15rpx;"
@click="removeImgs()">
<u-icon name="close-circle-fill" color="#FCD202" size="50rpx"></u-icon>
</view>
</view>
</view>
</view>
<view class="margin-top" @click="addImage(1)" v-if="shop.goodsCover.length<=0">
<view style="width: 200rpx;height: 200rpx;background: #f4f5f6;"
class="flex justify-center align-center">
<view>
<view class="text-center">
<image src="../static/addimg.png" style="width: 65rpx;height: 55rpx;">
</image>
</view>
<view class="text-center text-black">添加图片</view>
</view>
</view>
</view>
</view>
</view>
<view>
<view class="text-lg margin-top-sm text-black">商品轮播图可多张</view>
<view class="flex" style="overflow: hidden;flex-wrap: wrap;">
<view v-if="goodsPicture.length">
<view class="margin-top flex margin-right-sm flex-wrap">
<view class="flex"
style="width: 200rpx;height: 200rpx;margin-right: 2rpx;position: relative;"
v-for="(image,index) in goodsPicture" :key="index">
<image :src="image" style="width: 100%;height: 100%;"></image>
<view style="z-index: 9;position: absolute;top: -15rpx;right: -15rpx;"
@click="removeImg(index,'lb')">
<u-icon name="close-circle-fill" color="#FCD202" size="50rpx"></u-icon>
</view>
</view>
</view>
</view>
<view class="margin-top" @click="addImages(1)" v-if="goodsPicture.length<=5">
<view style="width: 200rpx;height: 200rpx;background: #f4f5f6;"
class="flex justify-center align-center">
<view>
<view class="text-center">
<image src="../static/addimg.png" style="width: 65rpx;height: 55rpx;">
</image>
</view>
<view class="text-center text-black">添加图片</view>
</view>
</view>
</view>
</view>
</view>
<view>
<view class="text-lg margin-top-sm text-black">商品详情图可多张</view>
<view class="flex" style="overflow: hidden;flex-wrap: wrap;">
<view v-if="goodsParticularsPicture.length">
<view class="margin-top flex margin-right-sm flex-wrap">
<view class="flex"
style="width: 200rpx;height: 200rpx;margin-right: 2rpx;position: relative;"
v-for="(image,index) in goodsParticularsPicture" :key="index">
<image :src="image" style="width: 100%;height: 100%;"></image>
<view style="z-index: 9;position: absolute;top: -15rpx;right: -15rpx;"
@click="removeImg(index,'sq')">
<u-icon name="close-circle-fill" color="#FCD202" size="50rpx"></u-icon>
</view>
</view>
</view>
</view>
<view class="margin-top" @click="addImages(2)" v-if="goodsParticularsPicture.length<=5">
<view style="width: 200rpx;height: 200rpx;background: #f4f5f6;"
class="flex justify-center align-center">
<view>
<view class="text-center">
<image src="../static/addimg.png" style="width: 65rpx;height: 55rpx;">
</image>
</view>
<view class="text-center text-black">添加图片</view>
</view>
</view>
</view>
</view>
</view>
<!-- <view>
<view class="text-lg margin-top-sm text-black">商品详情图可多张</view>
<editor id="editor"
style="height:350rpx;color: #000000;font-size: 28rpx;width: 100%;border: 2rpx solid #F0F0F0;padding: 16rpx;"
placeholder="请输入商品详情" @ready="onEditorReady" @input="getText"></editor>
</view>
<view>
<view class="margin-top" @click="addImages(2)" v-if="goodsParticularsPicture.length<=1">
<view style="width: 200rpx;height: 200rpx;background: #f4f5f6;"
class="flex justify-center align-center">
<view>
<view class="text-center">
<image src="../static/addimg.png" style="width: 65rpx;height: 55rpx;">
</image>
</view>
<view class="text-center text-black">添加图片</view>
</view>
</view>
</view>
</view> -->
</view>
<u-form-item label="规格类型">
<u-input v-model="attrsType" placeholder="请选择" :disabled="true" @click="ggShow()" />
</u-form-item>
<u-form-item label="商品规格" v-if="attrsid==2">
<view style="width: 100%;">
<view style="display: flex;width: 100%;">
<u-input style="width: 80%;" v-model="attrs" placeholder="请选择" :disabled="true"
@click="openguige()" />
<view style="width: 20%;text-align: right;color: #FF4701;" v-if="attrs"
@click="goGuiGeItem()">
修改价格</view>
</view>
<view style="color: #FF4701;font-size: 24upx;">*修改商品商品售价后商品规格将重置请谨慎操作</view>
</view>
</u-form-item>
</u-form>
</view>
<u-button @click="submit" class="margin-top" :custom-style="customStyle" shape="square" :hair-line="false">提交
</u-button>
<!-- 规格弹框 -->
<u-popup v-model="Guigeshow" mode="bottom" border-radius="14" :closeable="closeable">
<view>
<scroll-view scroll-y="true">
<view class="padding" style="margin-bottom: 70px;">
<view>规格类型</view>
<view class="flex align-center margin-top-sm flex-wrap">
<view class="" v-for="(item,indexs) in list" :key="indexs">
<view class="btn margin-top-sm flex align-center flex-wrap"
:class="listIndex == indexs?'boxH':''" @click="bindguige(indexs,1,item.ruleName)">
{{item.ruleName}}
</view>
<!-- <view class="btns margin-top-sm" @click="addtype(1)">+添加</view> -->
</view>
</view>
<view v-for="(name,index) in attrList.ruleValue" :key="index">
<view class="margin-top-sm">{{name.value}}</view>
<view class="flex align-center flex-wrap margin-top-sm">
<!-- :class="typeIndex1 == index&&typeIndex == ind?'active':''" -->
<view class="btn margin-top-sm" v-for="(ite,ind) in name.detail1" :key='ind'
@click="bindguige(ind,2,name.detail,index)" v-if="name.detail1">
{{ite}}
</view>
<!-- <view class="btns margin-top-sm">+添加</view> -->
</view>
</view>
</view>
</scroll-view>
<view class="addguige" @click="bindget()">确定</view>
</view>
</u-popup>
<u-select v-model="flshow" :list="ClassifyList" valueName='classifyId' labelName="classifyName"
@confirm="confirm">
</u-select>
<!-- 规格类型 -->
<u-select v-model="ggshow" :list="attrList1" valueName='id' labelName="name" @confirm="ggconfirm">
</u-select>
<!-- 添加规格弹框 -->
<u-popup v-model="show2" mode="center" border-radius="14" width="500rpx" height="300rpx" :closeable="closeable">
<view>
<view class="padding">
<view>添加标签</view>
<view>
<u-input v-model="typeName" placeholder="请填写" />
</view>
</view>
<view class="addguiges" @click="bindclose1()">确定</view>
</view>
</u-popup>
</view>
</template>
<script>
import configdata from '@/common/config.js';
export default {
data() {
return {
shop: {
goodsName: '',
classifyId: '',
classifyName: '',
goodsLabel: [],
attr: [],
sku: [],
originalMoney: '',
packMoney: 0,
goodsMoney: '',
goodsDescribe: '',
//详情图
goodsCover: '',
goodsPicture: [],
goodsParticularsPicture: [],
shopId: uni.getStorageSync('shopId')
},
shops: {
goodsName: '',
classifyId: '',
classifyName: '',
goodsLabel: [],
attr: [],
sku: [],
originalMoney: '',
packMoney: 0,
goodsMoney: '',
goodsDescribe: '',
//详情图
goodsCover: '',
goodsPicture: [],
goodsParticularsPicture: [],
shopId: uni.getStorageSync('shopId')
},
attrs: '',
goodsLabel: [],
goodsPicture: [],
goodsParticularsPicture: [],
customStyle: {
backgroundColor: '#FFCC00',
color: '#000000',
border: 0
},
status: 1,
customStyle1: {
color: '#000000',
position: "fixed",
bottom: "15rpx",
left: "0rpx",
right: "0rpx",
margin: "0rpx 50rpx",
backgroundColor: '#FFCC00',
},
Guigeshow: false,
//详情图
goodsCover: [],
shopId: '',
page: 1,
limit: 100,
list: [],
listIndex: 0,
typeIndex: 0,
typeIndex1: 0,
wdIndex: 0,
show: false,
typeName: '',
shows: false,
typeperature: '',
flshow: false,
ggshow: false,
ClassifyList: [],
attrList: {},
attrLists: [],
shopId: '',
show2: false,
update: 0,
count: 6,
editorCtx: '',
htmlMessage: '',
closeable: true,
attrsType: '多规格',
attrsid: 2,
attrList1: [{
'name': '单规格',
'id': 1
},
{
'name': '多规格',
'id': 2
}
],
}
},
onLoad(option) {
console.log('option', option)
if (option.goodsId) {
this.update = 1
uni.setNavigationBarTitle({
title: '修改商品'
})
this.goodsDet(option.goodsId)
} else {
this.update = 0
}
// console.log(option, '店铺id')
// this.shopId = option.shopId
this.shopId = this.$queue.getData("shopId")
this.getguige()
// this.onEditorReady();
},
onShow() {
let list = this.$queue.getData('guigeSelectItemList');
if (list) {
this.shop.sku = list;
this.$queue.remove('guigeSelectItemList');
}
this.getClassifyList()
},
methods: {
ZheKouInput(e) {
console.log(e)
this.attrs = '';
this.shop.attr = []
if (this.attrsid == 1) {
this.guigeclect()
} else {
this.getgoodslist()
}
},
goGuiGeItem() {
this.$queue.setData('guigeSelectItemList', this.shop.sku)
uni.navigateTo({
url: '/my/publish/guigeitem'
});
},
//获取分类
getflshow() {
console.log(this.ClassifyList.length)
if (this.ClassifyList.length == 0) {
uni.navigateTo({
url: '/my/store/fenlei'
})
} else {
this.flshow = true
}
},
// 规格类型
ggShow() {
this.ggshow = true
},
//获取商品规格列表
getgoodslist() {
let ruleValues = this.attrList.ruleValue
for (var j = 0; j < ruleValues.length; j++) {
let details = ruleValues[j].detail;
ruleValues[j].detail = ruleValues[j].detail.toString();
}
let data = {
attrName: this.attrList.ruleName,
attrValue: ruleValues,
ruleId: this.attrList.id,
}
this.$Request.postJsonA("/admin/goods/isFormatAttr?coverImg=" + this.shop.goodsCover + '&originalPrice=' +
this.shop.originalMoney + '&price=' + this.shop.goodsMoney, data).then(res => {
if (res.code == 0) {
// this.shop.sku.push(res.data.value)
this.shop.sku = res.data.value
console.log(res.data.value, '111', this.shop.sku)
}
});
},
//获取规格
bindget() {
this.getgoodslist()
this.attrs = this.attrList.ruleName
var obj = {}
obj.attrName = this.attrList.ruleName
obj.attrValue = this.attrList.ruleValue
obj.ruleId = this.attrList.id
this.shop.attr.push(obj)
this.Guigeshow = false
},
//商品分类
confirm(e) {
// console.log(e)
this.shop.classifyName = e[0].label
this.shop.classifyId = e[0].value
},
//规格分类
ggconfirm(e) {
// console.log(e)
this.attrsType = e[0].label
this.attrsid = e[0].value
if (e[0].value == 1) {
this.shop.attr = []
this.guigeclect()
}
},
// 单规格
guigeclect() {
this.$Request.getA("/admin/goods/onlyFormatAttr?coverImg=" + this.shop.goodsCover + '&originalPrice=' +
this.shop.originalMoney + '&price=' + this.shop.goodsMoney).then(res => {
if (res.code == 0) {
// this.shop.sku.push(res.data.value)
this.shop.sku = res.data.value
console.log(res.data.value, '111', this.shop.sku)
}
});
},
addtype(index) {
if (index == 1) {
this.show = true
} else if (index == 2) {
this.shows = true
}
},
bindclose() {
if (index == 1) {
this.show = false
} else if (index == 2) {
this.shows = false
}
},
//弹框规格切换
bindguige(index, e, name, index1) {
// console.log(index, e, name)
if (e == 1) {
this.listIndex = index
this.attrList = this.list[index]
} else if (e == 2) {
this.typeIndex = index
this.typeIndex1 = index1
} else if (e == 3) {
this.wdIndex = index
}
},
//规格弹框
openguige() {
if (!this.attrList.ruleValue) {
uni.showToast({
title: '暂无规格',
icon: 'none',
duration: 1000
})
return
}
// 打开规格选项弹框
this.Guigeshow = true
},
//获取商品规格
getguige() {
let data = {
// page: this.page,
// limit: this.limit,
shopId: this.shopId,
}
this.$Request.getA("/selfGoodsRule/list", data).then(res => {
if (res.code == 0) {
// this.shop.sku = res.data
if (res.data.length > 0) {
this.list = res.data
this.list.forEach(res => {
res.ruleValue.forEach(ret => {
ret.detail = ret.detail.split(',')
ret.detail1 = ret.detail
})
})
console.log('this.attrList', this.list)
this.attrList = this.list[0]
if (this.shop.attr && this.shop.attr.length > 0) {
for (var i in res.data) {
if (this.shop.attr[0].ruleId == res.data[i].id) {
this.attrs = res.data[i].ruleName
}
}
}
}
}
});
},
// 商品类型
getClassifyList() {
this.$Request.getA("/admin/goods/selectAllClassify?shopId=" + this.shopId).then(res => {
if (res.code == 0) {
this.ClassifyList = res.data
this.counts = this.ClassifyList[0].classifyId
if (this.shop.classifyId != '') {
for (var i in res.data) {
if (this.shop.classifyId == res.data[i].classifyId) {
this.shop.classifyName = res.data[i].classifyName
}
}
}
}
});
},
getStarttime(e) {
console.log(e)
console.log(this.shop)
this.shop.openTime = e.hour + ':' + e.minute
},
getEndtime(e) {
console.log(e)
this.shop.closeTime = e.hour + ':' + e.minute
},
// 详情图删除
removeImg(index, texts) {
if (texts == 'lb') {
this.goodsPicture.splice(index, 1)
} else if (texts == 'sq') {
this.goodsParticularsPicture.splice(index, 1)
}
},
// 身份证 资格证删除
removeImgs() {
// if (index == 1) {
this.shop.goodsCover = ''
// }
},
bindOpen(e) {
console.log(e)
let that = this
uni.chooseLocation({
success: function(res) {
console.log('位置名称:' + res.name);
console.log('详细地址:' + res.address);
console.log('纬度:' + res.latitude);
console.log('经度:' + res.longitude);
that.shop.detailedAddress = res.address
that.shop.shopLat = res.latitude
that.shop.shopLng = res.longitude
}
});
},
// 图片上传
addImages(e) {
if (e == 1) {
var num = this.goodsPicture.length
this.count = 6 - num
}
if (e == 2) {
var num = this.goodsParticularsPicture.length
this.count = 6 - num
}
let that = this
uni.chooseImage({
count: this.count,
sourceType: ['album', 'camera'],
success: res => {
for (let i = 0; i < res.tempFilePaths.length; i++) {
that.$queue.showLoading("上传中...");
uni.uploadFile({ // 上传接口
url: that.config("APIHOST1") + '/alioss/upload', //真实的接口地址
// url: 'https://tcwm.xianmaxiong.com/sqx_fast/alioss/upload',
filePath: res.tempFilePaths[i],
name: 'file',
success: (uploadFileRes) => {
if (e == 1) {
if (that.goodsPicture.length < 6) {
that.goodsPicture.push(JSON.parse(uploadFileRes.data)
.data)
}
} else if (e == 2) {
if (that.goodsParticularsPicture.length < 6) {
that.goodsParticularsPicture.push(JSON.parse(
uploadFileRes.data).data)
}
console.log(that.goodsParticularsPicture)
}
uni.hideLoading();
}
});
}
}
})
},
// 图片上传
addImage(e) {
let that = this
uni.chooseImage({
count: 1,
sourceType: ['album', 'camera'],
success: res => {
for (let i = 0; i < res.tempFilePaths.length; i++) {
that.$queue.showLoading("上传中...");
uni.uploadFile({ // 上传接口
// url: that.config("APIHOST1") + '/alioss/upload', //真实的接口地址
url: 'https://tcwm.xianmaxiong.com/sqx_fast/alioss/upload',
filePath: res.tempFilePaths[i],
name: 'file',
success: (uploadFileRes) => {
if (e == 1) {
that.shop.goodsCover = JSON.parse(uploadFileRes.data).data
}
uni.hideLoading();
}
});
}
}
})
},
config: function(name) {
var info = null;
if (name) {
var name2 = name.split("."); //字符分割
if (name2.length > 1) {
info = configdata[name2[0]][name2[1]] || null;
} else {
info = configdata[name] || null;
}
if (info == null) {
let web_config = cache.get("web_config");
if (web_config) {
if (name2.length > 1) {
info = web_config[name2[0]][name2[1]] || null;
} else {
info = web_config[name] || null;
}
}
}
}
return info;
},
// 发布
submit() {
this.shop.goodsPicture = this.goodsPicture
this.shop.goodsPicture = this.goodsPicture.toString();
this.shop.goodsParticularsPicture = this.goodsParticularsPicture.toString();
this.shop.goodsLabel = this.goodsLabel.toString();
if (!this.shop.goodsName) {
uni.showToast({
title: '请填写商品标题',
icon: 'none',
duration: 1000
})
return
}
if (!this.shop.classifyName) {
uni.showToast({
title: '请选择商品分类',
icon: 'none',
duration: 1000
})
return
}
if (!this.shop.goodsLabel) {
uni.showToast({
title: '请填写商品标签',
icon: 'none',
duration: 1000
})
return
}
if (!this.shop.originalMoney) {
uni.showToast({
title: '请填写商品原价',
icon: 'none',
duration: 1000
})
return
}
// console.log(this.shop.packMoney,'------------')
// if (this.shop.packMoney*1 != '') {
// uni.showToast({
// title: '请填写商品打包费',
// icon: 'none',
// duration: 1000
// })
// return
// }
if (!this.shop.goodsMoney) {
uni.showToast({
title: '请填写商品售价',
icon: 'none',
duration: 1000
})
return
}
if (!this.shop.goodsDescribe) {
uni.showToast({
title: '请填写商品描述',
icon: 'none',
duration: 1000
})
return
}
if (!this.shop.goodsCover) {
uni.showToast({
title: '请上传商品封面图',
icon: 'none',
duration: 1000
})
return
}
if (!this.shop.goodsPicture) {
uni.showToast({
title: '请上传商品轮播图',
icon: 'none',
duration: 1000
})
return
}
if (!this.shop.goodsParticularsPicture) {
uni.showToast({
title: '请上传商品详情图',
icon: 'none',
duration: 1000
})
return
}
if (this.attrsid == 2) {
if (this.shop.attr.length == 0) {
uni.showToast({
title: '请选择商品规格',
icon: 'none',
duration: 1000
})
return
}
}
let shops = this.shop;
for (var i = 0; i < shops.attr.length; i++) {
let attrValues = shops.attr[i].attrValue;
for (var j = 0; j < attrValues.length; j++) {
let details = attrValues[j].detail;
let detailss = '';
for (var z = 0; z < details.length; z++) {
detailss = detailss + details[z];
}
shops.attr[i].attrValue[j].detail = detailss
}
}
if (this.update == 0) {
var url = '/admin/goods/insertGoods'
}
if (this.update == 1) {
var url = '/admin/goods/update'
}
this.$Request.postJsonA(url, shops).then(res => {
if (res.code == 0) {
uni.showToast({
title: '操作成功',
icon: 'none'
})
setTimeout(function() {
uni.navigateBack()
}, 1000)
} else {
uni.showToast({
title: res.msg,
icon: 'none'
})
}
});
},
//删除规格
bindupdata(index) {
console.log('this.shop.goodsLabel', typeof this.goodsLabel)
this.goodsLabel.splice(index, 1)
},
addtype1() {
this.typeName = ''
this.show2 = true
},
bindclose1() {
if (!this.typeName) {
uni.showToast({
title: '请填写规格',
icon: 'none',
duration: 1000
})
return
}
this.goodsLabel.push(this.typeName)
this.show2 = false
},
// 获取商铺详情
goodsDet(goodsId) {
this.$Request.getA("/admin/goods/selectGoodsById?goodsId=" + goodsId).then(res => {
if (res.code == 0) {
this.dataCentre = res.data;
this.shop = res.data;
this.getClassifyList()
if (this.shop.goodsLabel) {
this.goodsLabel = this.shop.goodsLabel.split(',')
}
if (this.shop.goodsPicture) {
this.goodsPicture = this.shop.goodsPicture.split(',')
}
if (this.shop.goodsParticularsPicture) {
this.goodsParticularsPicture = this.shop.goodsParticularsPicture.split(',')
}
if (res.data.attr.length == 0) {
this.attrsid = 1
this.attrsType = '单规格'
} else {
this.attrsid = 2
this.attrsType = '多规格'
}
this.getguige()
}
});
}
}
}
</script>
<style>
page {
background-color: #F5F5F5;
}
.bg {
background-color: #FFFFFF;
}
.btn {
border: 1upx solid #CCCCCC;
border-radius: 10px;
padding: 0rpx 30rpx;
margin-right: 25rpx;
height: 30px;
line-height: 30px;
}
.boxH {
background: #FCD202;
border: none;
}
.btns {
border: 1upx dashed #333333;
border-radius: 28px;
padding: 0rpx 35rpx;
margin-right: 25rpx;
height: 30px;
line-height: 30px;
}
.active {
background: #FCD202;
border: none;
}
.actives {
background: #FCD202;
border: none;
}
.addguige {
width: 90%;
margin: 0 auto;
background: #FCD202;
box-shadow: 0px 10upx 20upx 0px #FFD9B3;
border-radius: 16upx;
text-align: center;
height: 88upx;
line-height: 88upx;
position: fixed;
bottom: 25upx;
left: 0;
right: 0;
}
.addguiges {
width: 90%;
margin: 0 auto;
background: #FCD202;
box-shadow: 0px 10upx 20upx 0px #FFD9B3;
border-radius: 16upx;
text-align: center;
height: 88upx;
line-height: 88upx;
/* position: fixed;
bottom: 25upx;
left: 0;
right: 0; */
}
.u-input__textarea {
background-color: #f5f5f5 !important;
padding: 10rpx !important;
}
</style>

229
my/publish/guigeitem.vue Normal file
View File

@@ -0,0 +1,229 @@
<template>
<view class="container" style="padding-bottom: 60rpx;">
<view v-for="(item,index) in guigeAttrList">
<view class="main">
<view class="order-des">
<view class="title">名称</view>
<view class="textarea-wrap">
<input type="text" v-model="item.detailJson" disabled class="input" />
</view>
</view>
<view class="order-des">
<view class="title">原价</view>
<view class="textarea-wrap">
<input type="digit" v-model="item.skuOriginalPrice" class="input" placeholder="请输入商品原价" />
</view>
</view>
<view class="order-des">
<view class="title">售价</view>
<view class="textarea-wrap">
<input type="digit" v-model="item.skuPrice" class="input" placeholder="请输入商品价格" />
</view>
</view>
<!-- <view class="order-des">
<view class="title">库存</view>
<view class="textarea-wrap">
<input type="number" v-model="item.stock" class="input" placeholder="请输入商品库存" />
</view>
</view> -->
</view>
</view>
<view class="save_btn" @tap="addSave">保存</view>
</view>
</template>
<script>
export default {
data() {
return {
guigeAttrList: [],
}
},
onLoad() {
this.guigeAttrList = this.$queue.getData('guigeSelectItemList');
},
methods: {
addSave() {
this.$queue.setData('guigeSelectItemList', this.guigeAttrList);
uni.navigateBack();
}
}
}
</script>
<style lang="scss">
page {
width: 100%;
}
.save_btn {
margin: 50upx;
width: 650upx;
height: 88upx;
text-align: center;
line-height: 88upx;
background: #FCD202;
border-radius: 16upx;
color: #333333;
}
.container {
width: 100%;
padding-bottom: calc(98upx + env(safe-area-inset-bottom));
padding-bottom: calc(98upx + constant(safe-area-inset-bottom));
.main {
padding: 20upx 20upx 20upx;
.order-des {
padding: 30upx;
// border-radius: 20upx;
background-color: #fff;
// margin-bottom: 20upx;
position: relative;
.title {
font-size: 30upx;
font-weight: bold;
color: #333333;
line-height: 32upx;
padding-bottom: 20upx;
}
.textarea-wrap {
padding-top: 20upx;
width: 100%;
border-bottom: 1upx solid #E6E6E6;
.textarea {
width: 100%;
font-size: 28upx;
line-height: 35upx;
color: #333;
}
}
.textarea-counter {
text-align: right;
font-size: 28upx;
font-weight: 500;
color: #999999;
margin-top: 10upx;
}
}
.order-list {
margin-top: 20upx;
padding: 0 30upx;
border-radius: 20upx;
background-color: #fff;
.order-list-item {
width: 100%;
height: 110upx;
border-bottom: 1upx solid #E6E6E6;
display: flex;
align-items: center;
justify-content: space-between;
.tit {
font-size: 34upx;
font-weight: 500;
color: #333333;
}
.right {
font-size: 34upx;
font-weight: 500;
color: #666;
display: flex;
align-items: center;
.input {
flex: 1;
display: flex;
align-items: center;
text-align: right;
padding-right: 10upx;
}
}
}
.order-list-item:last-child {
border-bottom: 0;
}
}
}
.btns {
button {
// width: 80%;
margin: 22upx;
color: #fff;
border: none;
border-radius: 10upx;
}
.qr {
background: #FF4701;
}
}
.footer {
width: 100%;
height: calc(98upx + env(safe-area-inset-bottom));
height: calc(98upx + constant(safe-area-inset-bottom));
padding-bottom: env(safe-area-inset-bottom);
/*兼容IOS>11.2*/
padding-bottom: constant(safe-area-inset-bottom);
/*兼容IOS<11.2*/
background: #FFFFFF;
position: fixed;
bottom: 0;
padding: 0 30upx;
z-index: 10;
display: flex;
align-items: center;
justify-content: space-between;
.payinfo {
font-size: 32upx;
font-weight: bold;
color: #333333;
text {
color: #FF3737;
}
}
.tui-button-primar {
width: 300upx;
height: 78upx;
line-height: 78upx;
background: #FF332F;
border-radius: 10upx;
margin: 0;
}
}
.dragImg {
position: absolute;
left: 266rpx;
top: 88rpx;
height: 99%;
width: 50%;
.area-con {
width: 186rpx !important;
}
image {
width: 186rpx !important;
height: 186rpx !important;
}
}
}
</style>

821
my/publish/index.vue Normal file
View File

@@ -0,0 +1,821 @@
<template>
<view class="padding" v-if="XCXIsSelect!='否'">
<view style="padding-bottom: 20upx;color: red;" v-if="auditReason && shop.status == 2">拒绝原因{{auditReason}}</view>
<view class="text-white padding bg radius">
<u-form :model="shop" label-position="top">
<!-- <u-form-item label="入驻学校">
<u-input v-model="schoolName" placeholder="请输入入驻学校(选填)" disabled @click="show1 = true" />
</u-form-item>
<u-form-item label="入驻学区">
<u-input v-model="shop.schoolName" placeholder="请输入入驻学区(选填)" disabled @click="show2 = true" />
</u-form-item> -->
<u-form-item label="商铺主营类型">
<u-input v-model="shop.shopTypeName" placeholder="请输入商铺主营类型" disabled @click="show = true" />
</u-form-item>
<u-form-item label="商铺名称">
<u-input v-model="shop.name" placeholder="请填写 (必填)" />
</u-form-item>
<u-form-item label="省市区">
<u-input v-model="shop.address" disabled placeholder="请填写" @click="bindOpen" />
</u-form-item>
<u-form-item label="商铺详细地址">
<!-- <u-input v-model="shop.detailedAddress" placeholder="请填写" /> -->
<textarea v-model="shop.detailedAddress" placeholder-style="color: #aaaaaa;font-size: 28rpx;"
placeholder="请填写商铺详细地址" style="height: 120rpx;width: 100%;font-size: 28rpx;" />
</u-form-item>
</u-form>
</view>
<view class="text-white padding bg radius margin-top">
<u-form :model="shop" label-position="top">
<u-form-item label="联系人姓名">
<u-input v-model="shop.userName" placeholder="请输入真实姓名" />
</u-form-item>
<u-form-item label="身份证号">
<u-input v-model="shop.isNumber" maxlength="20" placeholder="请填写 (必填)" />
</u-form-item>
<u-form-item label="联系电话">
<u-input v-model="shop.phone" type="number" placeholder="请填写 (必填)" />
</u-form-item>
<u-form-item label="验证码" v-if="shop.status == null||shop.status == 2">
<!-- #ifndef MP-WEIXIN -->
<u-input v-model="shop.verCode" type="number" placeholder="请填写 (必填)"
style="width: 50%;" />
<!-- #endif -->
<!-- #ifdef MP-WEIXIN -->
<u-input v-model="shop.verCode" type="number" placeholder="请填写 (必填)"
style="width: 50%;display: inline-block;" />
<!-- #endif -->
<button class="send-msg" @click="sendMsg">{{sendTime}}</button>
</u-form-item>
</u-form>
</view>
<view class="text-white padding bg radius margin-tb">
<view>
<view class="text-lg margin-top-sm text-black">店铺logo</view>
<view class="flex" style="overflow: hidden;flex-wrap: wrap;">
<view v-if="detailsImg.length">
<view class="margin-top flex margin-right-sm flex-wrap">
<view class="flex"
style="width: 200rpx;height: 200rpx;margin-right: 2rpx;position: relative;">
<image :src="detailsImg" style="width: 100%;height: 100%;"></image>
<view style="z-index: 9;position: absolute;top: -15rpx;right: -15rpx;"
@click="removeImg(1)">
<u-icon name="close-circle-fill" color="#2979ff" size="50rpx"></u-icon>
</view>
</view>
</view>
</view>
<view class="margin-top" @click="addImages(2)" v-if="detailsImg.length<=0">
<view style="width: 200rpx;height: 200rpx;background: #f4f5f6;"
class="flex justify-center align-center">
<view>
<view class="text-center">
<image src="../static/addimg.png" style="width: 65rpx;height: 55rpx;">
</image>
</view>
<view class="text-center text-black">添加图片</view>
</view>
</view>
</view>
</view>
</view>
<view>
<view class="text-lg margin-top-sm text-black">营业执照</view>
<view class="flex" style="overflow: hidden;flex-wrap: wrap;">
<view v-if="shop.business.length">
<view class="margin-top flex margin-right-sm flex-wrap">
<view class="flex"
style="width: 200rpx;height: 200rpx;margin-right: 2rpx;position: relative;">
<image :src="shop.business" style="width: 100%;height: 100%;"></image>
<view style="z-index: 9;position: absolute;top: -15rpx;right: -15rpx;"
@click="removeImgs(1)">
<u-icon name="close-circle-fill" color="#2979ff" size="50rpx"></u-icon>
</view>
</view>
</view>
</view>
<view class="margin-top" @click="addImage(1)" v-if="shop.business.length<=0">
<view style="width: 200rpx;height: 200rpx;background: #f4f5f6;"
class="flex justify-center align-center">
<view>
<view class="text-center">
<image src="../static/addimg.png" style="width: 65rpx;height: 55rpx;">
</image>
</view>
<view class="text-center text-black">添加图片</view>
</view>
</view>
</view>
</view>
</view>
<view>
<view class="text-lg margin-top-sm text-black">身份证正面</view>
<view class="flex" style="overflow: hidden;flex-wrap: wrap;">
<view v-if="shop.front.length">
<view class="margin-top flex margin-right-sm flex-wrap">
<view class="flex"
style="width: 200rpx;height: 200rpx;margin-right: 2rpx;position: relative;">
<image :src="shop.front" style="width: 100%;height: 100%;"></image>
<view style="z-index: 9;position: absolute;top: -15rpx;right: -15rpx;"
@click="removeImgs(2)">
<u-icon name="close-circle-fill" color="#2979ff" size="50rpx"></u-icon>
</view>
</view>
</view>
</view>
<view class="margin-top" @click="addImage(2)" v-if="shop.front.length<=0">
<view style="width: 200rpx;height: 200rpx;background: #f4f5f6;"
class="flex justify-center align-center">
<view>
<view class="text-center">
<image src="../static/addimg.png" style="width: 65rpx;height: 55rpx;">
</image>
</view>
<view class="text-center text-black">添加图片</view>
</view>
</view>
</view>
</view>
</view>
<view>
<view class="text-lg margin-top-sm text-black">身份证反面片</view>
<view class="flex" style="overflow: hidden;flex-wrap: wrap;">
<view v-if="shop.back.length">
<view class="margin-top flex margin-right-sm flex-wrap">
<view class="flex"
style="width: 200rpx;height: 200rpx;margin-right: 2rpx;position: relative;">
<image :src="shop.back" style="width: 100%;height: 100%;"></image>
<view style="z-index: 9;position: absolute;top: -15rpx;right: -15rpx;"
@click="removeImgs(3)">
<u-icon name="close-circle-fill" color="#2979ff" size="50rpx"></u-icon>
</view>
</view>
</view>
</view>
<view class="margin-top" @click="addImage(3)" v-if="shop.back.length<=0">
<view style="width: 200rpx;height: 200rpx;background: #f4f5f6;"
class="flex justify-center align-center">
<view>
<view class="text-center">
<image src="../static/addimg.png" style="width: 65rpx;height: 55rpx;">
</image>
</view>
<view class="text-center text-black">添加图片</view>
</view>
</view>
</view>
</view>
</view>
</view>
<u-button v-if="shop.status == null || shop.status == 2" @click="submit" class="margin-top"
:custom-style="customStyle" shape="square" :hair-line="false">提交审核
</u-button>
<u-button v-if="shop.status == 0" class="margin-top" disabled :custom-style="customStyle" shape="square"
:hair-line="false">审核中
</u-button>
<!-- 分类列表 -->
<u-select v-model="show" :list="shopList" valueName='id' labelName="shopTypeName" @confirm="confirm"></u-select>
<!-- 学校列表 -->
<u-select v-model="show1" :list="shopList1" valueName='schoolId' labelName="schoolName" @confirm="confirms">
</u-select>
<!-- 校区列表 -->
<u-select v-model="show2" :list="shopList2" valueName='schoolId' labelName="schoolName" @confirm="confirm1">
</u-select>
</view>
</template>
<script>
import configdata from '@/common/config.js';
export default {
data() {
return {
shop: {
schoolName: '',
schoolId: '',
type: '',
typeid: '',
name: '',
address: '',
shopTypeName: '',
detailedAddress: '',
userName: '',
isNumber: '',
phone: '',
verCode: '',
latitude: '',
longitude: '',
//详情图
detailsImg: [],
business: '',
front: '',
back: ""
},
customStyle: {
backgroundColor: '#FFCC00',
color: '#000000',
border: 0
},
status: 1,
//详情图
detailsImg: [],
shopId: '',
page: 1,
limit: 100,
show: false,
show1: false,
show2: false,
shopList: [],
city: '',
province: '',
district: '',
auditReason: '',
Settedlist: [],
sending: false,
sendTime: '获取验证码',
count: 60,
XCXIsSelect: '是',
platform: "h5",
shopList1: [],
shopList2: [],
schoolName: '',
schoolId: '',
}
},
onLoad(option) {
this.XCXIsSelect = this.$queue.getData('XCXIsSelect');
if (this.XCXIsSelect == '否') {
uni.setNavigationBarTitle({
title: '隐私政策'
});
} else {
uni.setNavigationBarTitle({
title: '商家入驻'
});
}
// uni.getLocation({
// type: 'gcj02',
// success: (res) => {
// console.log(res.latitude);
// console.log(res.longitude);
// console.log("res___:" + JSON.stringify(res));
// },
// fail(e) {
// console.log(e);
// }
// });
this.Settedlist = uni.getStorageSync("Settedlist")
if (this.Settedlist) {
this.shopId = this.Settedlist.shopId
this.auditReason = this.Settedlist.auditReason
this.shop.name = this.Settedlist.shopName
this.shop.typeid = this.Settedlist.shopTypeId
this.shop.shopTypeName = this.Settedlist.shopTypeName
this.shop.address = this.Settedlist.province + this.Settedlist.city + this.Settedlist.district
this.shop.detailedAddress = this.Settedlist.detailedAddress
this.shop.latitude = this.Settedlist.shopLat
this.shop.longitude = this.Settedlist.shopLng
this.province = this.Settedlist.province
this.city = this.Settedlist.city
this.district = this.Settedlist.district
this.shop.status = this.Settedlist.status
this.shop.userName = this.Settedlist.realName
this.shop.isNumber = this.Settedlist.identitycardNumber
this.shop.phone = this.Settedlist.phone
this.shop.business = this.Settedlist.businessLicense
this.shop.front = this.Settedlist.identitycardPro
this.shop.back = this.Settedlist.identitycardCon
this.shop.detailsImg = this.Settedlist.shopCover
this.detailsImg = this.Settedlist.shopCover.split(',')
uni.removeStorageSync("Settedlist")
}
this.getShopList()
let token = this.$queue.getData('XCXIsSelect');
if (token) {
this.getData()
}
},
onShow() {
},
onHide() {
},
methods: {
getData() {
this.$Request.get("/app/shop/selectShopByUserId").then(res => {
if (res.code == 0 && res.data) {
this.auditReason = res.data.auditReason
this.shop.shopTypeName = res.data.shopTypeName
this.shop.name = res.data.shopName
this.shop.address = res.data.province + res.data.city + res.data.district
this.shop.detailedAddress = res.data.detailedAddress
this.shop.userName = res.data.realName
this.shop.isNumber = res.data.identitycardNumber
this.shop.phone = res.data.phone
this.shop.detailsImg = res.data.shopCover //商铺图片
this.detailsImg = res.data.shopCover.split(',')
this.shop.business = res.data.businessLicense //营业执照
this.shop.front = res.data.identitycardPro //身份证正面
this.shop.back = res.data.identitycardCon //身份证反面
this.shop.latitude = res.data.shopLat
this.shop.longitude = res.data.shopLng
this.province = res.data.province
this.city = res.data.city
this.district = res.data.district
this.shop.status = res.data.status
}
});
},
confirm(e) {
console.log(e)
this.shop.shopTypeName = e[0].label
this.shop.typeid = e[0].value
},
confirms(e) {
console.log(e)
this.schoolName = e[0].label
this.schoolId = e[0].value
this.getShopList2()
},
confirm1(e) {
console.log(e)
this.shop.schoolName = e[0].label
this.shop.schoolId = e[0].value
},
// 店铺列表
getShopList() {
let data = {
page: this.page,
limit: this.limit,
}
this.$Request.get("/app/shoptype/selectShopTypeList", data).then(res => {
if (res.code == 0) {
this.shopList = res.data.list
}
});
},
// 学校列表
getShopList1() {
let data = {
page: this.page,
limit: this.limit,
}
this.$Request.get("/app/school/getSchoolList", data).then(res => {
if (res.code == 0) {
this.shopList1 = res.data.records
}
});
},
// 校区列表
getShopList2() {
let data = {
schoolId: this.schoolId,
}
this.$Request.get("/app/school/getChildrenByParentId", data).then(res => {
if (res.code == 0) {
this.shopList2 = res.data
}
});
},
// 详情图删除
removeImg(index) {
this.detailsImg = ''
},
// 身份证 资格证删除
removeImgs(index) {
if (index == 1) {
this.shop.business = ''
} else if (index == 2) {
this.shop.front = ''
} else if (index == 3) {
this.shop.back = ''
}
},
bindOpen() {
const that = this;
uni.chooseLocation({
success: function(res) {
console.log('位置名称:' + res.name);
console.log('详细地址:' + res.address);
console.log('纬度:' + res.latitude);
console.log('经度:' + res.longitude);
that.shop.detailedAddress = res.address
that.shop.latitude = res.latitude
that.shop.longitude = res.longitude
that.getcity(res.latitude, res.longitude)
}
});
},
getcity(latitude, longitude) {
let data = {
lat: latitude,
lng: longitude,
}
this.$Request.get("/app/address/selectCity", data).then(res => {
if (res.code == 0) {
this.city = res.data.city
this.province = res.data.province
this.district = res.data.district
this.shop.address = res.data.province + res.data.city + res.data.district
}
});
},
// 图片上传
addImages(e) {
let that = this
uni.chooseImage({
count: 1,
sourceType: ['album', 'camera'],
success: res => {
for (let i = 0; i < res.tempFilePaths.length; i++) {
that.$queue.showLoading("上传中...");
uni.uploadFile({ // 上传接口
url: that.config("APIHOST1") + '/alioss/upload', //真实的接口地址
filePath: res.tempFilePaths[i],
name: 'file',
success: (uploadFileRes) => {
// if (that.detailsImg.length < 6) {
that.detailsImg = JSON.parse(uploadFileRes.data).data
// }
console.log(that.detailsImg)
uni.hideLoading();
}
});
}
}
})
},
// 图片上传
addImage(e) {
let that = this
uni.chooseImage({
count: 1,
sourceType: ['album', 'camera'],
success: res => {
for (let i = 0; i < res.tempFilePaths.length; i++) {
that.$queue.showLoading("上传中...");
uni.uploadFile({ // 上传接口
url: that.config("APIHOST1") + '/alioss/upload', //真实的接口地址
filePath: res.tempFilePaths[i],
name: 'file',
success: (uploadFileRes) => {
if (e == 1) {
that.shop.business = JSON.parse(uploadFileRes.data).data
} else if (e == 2) {
that.shop.front = JSON.parse(uploadFileRes.data).data
} else if (e == 3) {
that.shop.back = JSON.parse(uploadFileRes.data).data
}
console.log(that.detailsImg)
uni.hideLoading();
}
});
}
}
})
},
config: function(name) {
var info = null;
if (name) {
var name2 = name.split("."); //字符分割
if (name2.length > 1) {
info = configdata[name2[0]][name2[1]] || null;
} else {
info = configdata[name] || null;
}
if (info == null) {
let web_config = cache.get("web_config");
if (web_config) {
if (name2.length > 1) {
info = web_config[name2[0]][name2[1]] || null;
} else {
info = web_config[name] || null;
}
}
}
}
return info;
},
// 发布
submit() {
let that = this;
console.log(this.detailsImg)
this.shop.detailsImg = this.detailsImg
this.shop.detailsImg = this.shop.detailsImg.toString();
uni.getSystemInfo({
success: function(res) {
console.log(res.model);
if (res.model == 'iPhone') {
that.sysphone = 2
} else if (res.model != 'iPhone') {
that.sysphone = 1
}
}
});
if (!this.shop.shopTypeName) {
uni.showToast({
title: '请填写商铺主营类型',
icon: 'none',
duration: 1000
})
return
}
if (!this.shop.name) {
uni.showToast({
title: '请填写商铺名称',
icon: 'none',
duration: 1000
})
return
}
if (!this.shop.address) {
uni.showToast({
title: '请填写商铺地址',
icon: 'none',
duration: 1000
})
return
}
if (!this.shop.detailedAddress) {
uni.showToast({
title: '请填写店铺详细地址',
icon: 'none',
duration: 1000
})
return
}
if (!this.shop.userName) {
uni.showToast({
title: '请填写真实姓名',
icon: 'none',
duration: 1000
})
return
}
if (!this.shop.isNumber) {
uni.showToast({
title: '请填写身份证号',
icon: 'none',
duration: 1000
})
return
}
let regX = /^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/;
if (!regX.test(this.shop.isNumber)) {
uni.showToast({
title: '请输入正确的身份证号',
icon: 'none',
duration: 1000
})
return;
}
if (!this.shop.phone) {
uni.showToast({
title: '请填写联系电话',
icon: 'none',
duration: 1000
})
return
}
if (!this.shop.verCode) {
uni.showToast({
title: '请填写验证码',
icon: 'none',
duration: 1000
})
return
}
if (!this.shop.detailsImg) {
uni.showToast({
title: '请上传商铺图片',
icon: 'none',
duration: 1000
})
return
}
if (!this.shop.business) {
uni.showToast({
title: '请上传营业执照',
icon: 'none',
duration: 1000
})
return
}
if (!this.shop.front) {
uni.showToast({
title: '请上传身份证正面',
icon: 'none',
duration: 1000
})
return
}
if (!this.shop.back) {
uni.showToast({
title: '请上传身份证反面',
icon: 'none',
duration: 1000
})
return
}
var openId = this.$queue.getData("openid") ? this.$queue.getData("openid") : '';
let data = {
msg: this.shop.verCode,
phone: this.shop.phone,
userType: 1,
openId: openId,
platform: this.platform,
sysPhone: this.sysphone,
shopName: this.shop.name,
shopTypeId: this.shop.typeid,
shopTypeName: this.shop.shopTypeName,
detailedAddress: this.shop.address,
detailedAddress: this.shop.detailedAddress,
shopLat: this.shop.latitude,
shopLng: this.shop.longitude,
province: this.province,
city: this.city,
district: this.district,
realName: this.shop.userName,
identitycardNumber: this.shop.isNumber,
// phone: this.shop.phone,
// code: this.shop.verCode,
businessLicense: this.shop.business,
identitycardPro: this.shop.front,
identitycardCon: this.shop.back,
shopCover: this.shop.detailsImg,
// schoolId:this.shop.schoolId
}
// uni.setStorageSync('updataShopId', this.shop.shopId)
if (this.Settedlist) {
data.shopId = this.shopId;
this.$Request.postJson("/admin/goodsShop/updateGoodsShop", data).then(res => {
if (res.code == 0) {
uni.showToast({
title: '提交成功,等待审核通过',
icon: 'none'
})
setTimeout(function() {
uni.navigateBack()
}, 1000)
} else {
uni.showToast({
title: res.msg,
icon: 'none'
})
}
});
}else{
this.$Request.postJson("/admin/goodsShop/quickGoodsShop", data).then(res => {
if (res.code == 0) {
uni.showToast({
title: '提交成功,等待审核通过',
icon: 'none'
})
setTimeout(function() {
uni.navigateBack()
}, 1000)
} else {
uni.showToast({
title: res.msg,
icon: 'none'
})
}
});
}
},
sendMsg() {
// const {
// phone
// } = this.shop;
if(this.sendTime != '获取验证码'){
return;
}
console.log('this.shop.phone', this.shop.phone)
if (!this.shop.phone) {
this.$queue.showToast("请输入手机号");
} else if (this.shop.phone.length !== 11) {
this.$queue.showToast("请输入正确的手机号");
} else {
this.$queue.showLoading("正在发送验证码...");
this.$Request.getT("/app/Login/sendMsg/" + this.shop.phone + "/ruzhu").then(res => {
if (res.code === 0) {
this.sending = true;
this.$queue.showToast('验证码发送成功请注意查收');
this.countDown();
uni.hideLoading();
} else {
uni.hideLoading();
uni.showModal({
showCancel: false,
title: '短信发送失败',
content: res.msg ? res.msg : '请一分钟后再获取验证码'
});
}
});
}
},
countDown() {
const {
count
} = this;
if (count === 1) {
this.count = 60;
this.sending = false;
this.sendTime = '获取验证码'
} else {
this.count = count - 1;
this.sending = true;
this.sendTime = count - 1 + '秒后重新获取';
setTimeout(this.countDown.bind(this), 1000);
}
},
},
}
</script>
<style>
page {
background-color: #F5F5F5;
}
.bg {
background-color: #FFFFFF;
}
textarea::-webkit-input-placeholder {
color: #303133;
font-size: 20rpx;
}
textarea:-moz-placeholder {
color: #303133;
font-size: 20rpx;
}
textarea::-moz-placeholder {
color: #303133;
font-size: 20rpx;
}
textarea::-ms-input-placeholder {
color: #303133;
font-size: 20rpx;
}
.tabBox {
border: 1rpx solid #999999;
padding: 15rpx 20rpx;
border-radius: 15rpx;
font-size: 28rpx;
}
.btnnum {
color: #005DFF;
border: 1rpx solid #005DFF;
}
.send-msg {
border-radius: 30px;
color: #FFFFFF;
/*#FCD202 */
background: #FCD202;
height: 60rpx;
font-size: 28rpx;
line-height: 60rpx;
display: inline-block;
width: 45%;
margin-left: 4%;
position: relative;
/* #ifndef MP-WEIXIN */
top: 0;
/* #endif */
/* #ifdef MP-WEIXIN */
top: 20rpx;
/* #endif */
}
</style>

BIN
my/static/addimg.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

BIN
my/static/black.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 375 B

BIN
my/static/orange.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 343 B

813
my/store/addgood.vue Normal file
View File

@@ -0,0 +1,813 @@
<template>
<view style="padding-bottom: 130rpx;">
<view>
<!-- #ifndef H5 -->
<view style="position: fixed;top: 0;left: 0;right: 0;z-index: 9999;background: #fff;">
<!-- #endif -->
<!-- #ifdef H5 -->
<view style="position: fixed;top: 44px;left: 0;right: 0;z-index: 99;background: #fff;">
<!-- #endif -->
<view class="bg padding-lr padding-tb-sm flex align-center">
<u-search @change="search" v-model="goodsName" placeholder="搜索商品标题 " bg-color="#F7F7F7"
style="width: 100%;" shape="square" :show-action="false"></u-search>
</view>
<view class="flex bg">
<view v-for="(item,index) in tab" :key="index" class="flex-sub boxIndex"
:class="tabIndex == index?'tans':''"
:style="index==1?'text-align:center':(index==2?'text-align:right;margin-right:40rpx':'')"
style="position: relative;padding-left: 40rpx;" @click="bindindex(index)">
{{item.name}}
<view :class="index==0?'tabse':(index==1?'tabse1':'tabse2')" v-show="tabIndex == index">
</view>
</view>
</view>
<scroll-view scroll-x="true" class="flex align-center padding-sm"
style="height: 100rpx;width: 100%;white-space: nowrap">
<view v-for="(item,index) in list" :key="index" class="boxs"
:class="counts == index?'actives':''" @click="bindTabs(index,item)">{{item.classifyName}}
</view>
</scroll-view>
</view>
<!-- #ifdef H5 -->
<view style="margin-top: 155px;" v-if="goodsList.length>0">
<!-- #endif -->
<!-- #ifndef H5 -->
<view style="margin-top: 290upx;padding-bottom: 170px;" v-if="goodsList.length>0">
<!-- #endif -->
<u-checkbox-group class="flex justify-center flex-wrap">
<view class="bg radius" style="width: 686rpx;margin-top: 20rpx;" v-for="(item,index) in goodsList" :key='index'>
<view class="padding-sm" style="position: relative;">
<u-checkbox @change="checkboxChange(item)" v-model="item.checkeds">
</u-checkbox>
创建时间{{item.createTime}}
<span style="position: absolute;right: 20rpx;">
<u-switch v-model="item.checked" active-color="#17cd8a" inactive-color="#eee" size="40"
@change="changeKg(index,item)"></u-switch>
</span>
</view>
<view style="width:100%;border-top: 1upx solid #E6E6E6;"></view>
<view class="flex padding" @click="goDet(item)">
<view>
<image :src="item.goodsCover?item.goodsCover:'../../static/logo.png'" class="radius"
style="width:210upx;height:170upx;"></image>
</view>
<view class="margin-left flex flex-direction justify-between">
<view class="text-lg text-bold">{{item.goodsName}}</view>
<view class="margin-tb-xs u-line-2" style="color:#999999;">
{{item.goodsDescribe}}
</view>
<view style="width: 414rpx;" class="text-lg flex justify-between align-center">
<view class="">
<text class="text-sm"></text>{{item.goodsMoney}}
</view>
<view style="margin-right: 10rpx;">库存{{item.inventory?item.inventory:'0'}}</view>
</view>
</view>
</view>
<view style="width: 686upx;height: 1upx;border: 1upx solid #E6E6E6;margin:0 auto;"></view>
<view class="flex justify-between padding align-center" >
<!-- <view>库存{{item.inventory?item.inventory:'0'}}</view> -->
<view class="flex align-center justify-end" style="width: 100%;">
<view @click="goodsSort(item)" class="btn margin-right-sm">排序</view>
<view @click="goodupdete(item)" class="btn margin-right-sm">删除</view>
<view @click="deitor(item)" class="btn margin-right-sm">库存</view>
<view @click="goUpdate(item)" class="btn">修改</view>
</view>
</view>
</view>
</u-checkbox-group>
</view>
<!-- <view class="addguige text-bold" @click="goAdd()">添加商品</view> -->
<empty v-if="goodsList.length == 0"></empty>
</view>
<view class="selectcz flex align-center">
<u-checkbox @change="checkboxChanges()" style="margin-left: 40rpx;" v-model="checkedz">全选</u-checkbox>
<view class="addguige text-bold addguigezz" @click="selectczan">操作</view>
<view class="addguige text-bold addguigezzs" @click="goAdd()">添加商品</view>
</view>
<!-- 排序 -->
<u-popup v-model="shows3" mode="center" border-radius="14" width="500rpx" height="300rpx"
:closeable="true">
<view>
<view class="padding">
<view>排序</view>
<view style="margin-top: 20rpx;" class="flex justify-center">
<u-number-box :input-width="300" :input-height="60" v-model="paixu" :min="0" placeholder="请填写"></u-number-box>
</view>
</view>
<view class="addguiges" @click="bindclose3()">确定</view>
</view>
</u-popup>
<u-popup v-model="shows" mode="center" border-radius="14" width="500rpx" height="300rpx"
:closeable="closeable">
<view>
<view class="padding">
<view>添加库存</view>
<view>
<u-input v-model="typeperature" placeholder="请填写" type="number" />
</view>
</view>
<view class="addguiges" @click="bindclose()">确定</view>
</view>
</u-popup>
<!-- 批量修改库存 -->
<u-popup v-model="shows2" mode="center" border-radius="14" width="500rpx" height="300rpx"
:closeable="true">
<view>
<view class="padding">
<view>修改库存</view>
<view>
<u-input v-model="typeperature2" placeholder="请填写" type="number" />
</view>
</view>
<view class="addguiges" @click="bindclose2()">确定</view>
</view>
</u-popup>
<!-- 多选操作菜单 -->
<u-action-sheet :list="tabIndex==2?lists1:lists" @click="click" v-model="show"></u-action-sheet>
</view>
</template>
<script>
import empty from '@/components/empty.vue'
export default {
components: {
empty
},
data() {
return {
goodsIds:[],
shows3:false,
paixu:0,
shows2:false,
typeperature2:'',
checkedz:false,
show: false,
lists: [{
text: '批量下架'
}, {
text: '修改库存'
}, {
text: '批量删除'
}],
lists1: [{
text: '批量上架',
}, {
text: '修改库存'
}, {
text: '批量删除'
}],
tab: [{
name: '出售中',
}, {
name: '已售完',
}, {
name: '已下架'
}],
tabIndex: 0,
list: [{
name: '奶茶热饮'
}, {
name: '鲜榨果汁'
}, {
name: '牛奶系列'
}, {
name: '超低折扣'
}],
counts: '',
classifyId: '',
page: 1,
limit: 10,
shopId: '',
goodsName: '',
goodsList: [],
totalCount: 0,
shows: false,
typeperature: '',
goodsId: '',
checked: false,
pageList: [],
closeable: true
}
},
onLoad(option) {
uni.showLoading({
title: '加载中......',
icon: 'loading'
})
// this.shopId = option.shopId
this.shopId = this.$queue.getData("shopId")
this.getClassifyList()
},
onShow() {
this.getGoodsList()
},
methods: {
// 批量库存
bindclose2(index){
if (!this.typeperature2) {
uni.showToast({
title: '请填写规格数量',
icon: 'none',
duration: 1000
})
return
}
if(this.typeperature2<0){
uni.showToast({
title: '库存数量不得小于0',
icon: 'none',
duration: 1000
})
return
}
let data = {
goodsIds: this.goodsIds.join(),
inventory: this.typeperature2
}
let that = this
that.shows2 = false
uni.showModal({
title:'提示',
content:'确认已选中的商品批量修改库存?',
complete:function(ret){
if(ret.confirm){
that.$Request.getA("/admin/goods/updateBatchInventory", data).then(res => {
if (res.code == 0) {
that.shows2 = false
uni.showToast({
title: '修改成功',
icon: 'none'
})
that.typeperature2 = ''
that.checkedz = false
that.goodsIds = []
that.page = 1
that.getGoodsList()
}
});
}
}
})
},
bindclose3(){
let data = {
sort:this.paixu,
goodsId:this.goodsId
}
this.$Request.getA('/admin/goods/updateSort', data).then(res => {
if(res.code==0){
uni.showToast({
title:'修改成功'
})
this.goodsId = ''
this.shows3 = false
this.page = 1
this.getGoodsList();
}else{
uni.showToast({
title:res.msg,
icon:'none'
})
}
})
},
//排序
goodsSort(item){
if(item.sort){
this.paixu = item.sort
}else{
this.paixu = 0
}
this.shows3 = true
this.goodsId = item.goodsId
},
selectczan(){
if(this.goodsIds.length==0){
uni.showToast({
title:'请选择商品后操作',
icon:'none'
})
}else{
this.show = true
}
},
//全选
checkboxChanges(){
this.goodsIds = []
if(this.checkedz==false){//全选把总复选框选中并把goodsid赋给数组
this.goodsList.map(item=>{
item.checkeds = true
this.goodsIds.push(item.goodsId)
})
console.log(this.goodsList)
}else{//全不选
this.goodsList.map(item=>{
item.checkeds = false
})
}
},
//批量操作
caozuos(url,datas,data){
let that = this
uni.showModal({
title:'提示',
content:'确认'+data+'已选中的商品?',
complete:function(ret){
if(ret.confirm){
that.$Request.getA(url, datas).then(res => {
if(res.code==0){
uni.showToast({
title:data+'成功'
})
that.checkedz=false
that.goodsIds = []
that.page = 1
that.getGoodsList();
}else{
uni.showToast({
title:res.msg,
icon:'none'
})
}
})
}
}
})
},
//选择的操作
click(e) {
let data = this.lists[e].text
if(this.tabIndex==2){
if(data == '批量下架'){
data = '批量上架'
}
}
switch (data) {
case '批量下架':
let datas = {
goodsIds:this.goodsIds.join(','),
status:1
}
this.caozuos('/admin/goods/updateBatchStatus',datas,data)
break;
case '修改库存':
this.shows2 = true
break;
case '批量删除':
let datas2 = {
goodsIds:this.goodsIds.join(','),
}
this.caozuos('/admin/goods/deleteBatchIds',datas2,data)
break;
case '批量上架':
let datas1 = {
goodsIds:this.goodsIds.join(','),
status:0
}
this.caozuos('/admin/goods/updateBatchStatus',datas1,data)
break;
default:
break;
}
},
// 选中某个复选框时由checkbox时触发
checkboxChange(e) {
if(this.goodsIds.indexOf(e.goodsId)==-1){//如果没有选中则把goodsid增加到数组中
this.goodsIds.push(e.goodsId)
}else{//如果找到了则把goodsid删除
this.goodsIds.splice(this.goodsIds.indexOf(e.goodsId),1)
}
if(this.goodsIds.length==this.goodsList.length){ //判断是否全部选中
this.checkedz = true
}else{
this.checkedz = false
}
},
//修改商品
goUpdate(item) {
uni.navigateTo({
url: '/my/publish/goods?goodsId=' + item.goodsId
})
},
goAdd() {
uni.navigateTo({
url: '/my/publish/goods'
})
},
//搜索
search() {
this.getGoodsList()
},
bindindex(index) {
console.log(index)
uni.showLoading({
title: '加载中......',
icon: 'loading'
})
this.page = 1
this.tabIndex = index
this.getGoodsList()
},
getGoodsList() {
let data = {
page: this.page,
limit: this.limit,
goodsName: this.goodsName,
// shopId: this.shopId,
classifyId: this.classifyId,
shopId: uni.getStorageSync('shopId'),
status: this.tabIndex == 1 ? 2 : (this.tabIndex == 2 ? 1 : this.tabIndex)
}
this.$Request.getA("/admin/goodsShop/selectGoodsByShopId", data).then(res => {
if (res.code == 0) {
uni.hideLoading()
if (res.data.list.length > 0) {
for (var i in res.data.list) {
if (res.data.list[i].status == 1) {
res.data.list[i].checked = false
} else {
res.data.list[i].checked = true
}
}
console.log('res.data.list', res.data.list)
if (this.page == 1) {
this.goodsList = res.data.list
} else {
this.goodsList = [...this.goodsList, ...res.data.list]
}
this.totalCount = res.data.totalCount
} else {
if (this.page == 1) {
this.goodsList = []
} else {
this.goodsList = this.goodsList
}
}
}
uni.stopPullDownRefresh();
uni.hideLoading()
});
},
//删除商品
goodupdete(e) {
console.log(e)
let that = this
uni.showModal({
title: '提示',
content: '确定要删除当前商品吗?刪除后无法恢复',
cancelText: "取消", // 取消按钮的文字
confirmText: "确定", // 确认按钮文字
showCancel: true, // 是否显示取消按钮,默认为 true
confirmColor: '#f55850',
cancelColor: '#39B54A',
success: (res) => {
if (res.confirm) {
let data = {
shopId: uni.getStorageSync('shopId'),
goodsId: e.goodsId,
}
that.$Request.postA("/admin/goodsShop/deleteGoodsByShopId", data).then(res => {
if (res.code == 0) {
uni.showToast({
title: "删除成功",
icon: 'none'
})
that.page = 1
that.getGoodsList();
} else {
uni.showToast({
title: res.msg,
icon: 'none'
})
}
});
} else {
}
}
})
},
// 商品类型
getClassifyList() {
this.$Request.getA("/admin/goods/selectAllClassify?shopId=" + this.shopId).then(res => {
if (res.code == 0) {
let data = [{
classifyName: '全部',
classifyId: ''
}]
this.list = [...data, ...res.data]
this.classifyId = this.list[0].classifyId
this.getGoodsList()
}
});
},
//库存弹框
bindclose(index) {
if (!this.typeperature) {
uni.showToast({
title: '请填写规格数量',
icon: 'none',
duration: 1000
})
return
}
let data = {
shopId: uni.getStorageSync('shopId'),
goodsId: this.goodsId,
inventory: this.typeperature
}
this.$Request.postJson("/admin/goodsShop/updateGoodsByShopId", data).then(res => {
if (res.code == 0) {
this.shows = false
this.typeperature = ''
uni.showToast({
title: '修改成功',
icon: 'none'
})
this.getGoodsList()
}
});
},
//编辑库存
deitor(e) {
this.shows = true
this.goodsId = e.goodsId
},
add(item) {
let that = this
let data = [{
goodsId: item.goodsId,
shopId: this.shopId
}]
this.$Request.postJsonA("/admin/goodsShop/addGoodsByShopId", data).then(res => {
if (res.code == 0) {
this.page = 1
this.getGoodsList()
uni.showToast({
title: '添加成功',
icon: 'none'
})
this.getGoodsList()
}
});
},
goDet(e) {
uni.navigateTo({
url: '/my/store/goodDetail?goodsId=' + e.goodsId + "&shopId=" + this.shopId + '&type=2'
})
},
bindDetail() {
uni.navigateTo({
url: './goodDetail'
})
},
bindTabs(index, e) {
console.log(e)
uni.showLoading({
title: '加载中......',
icon: 'loading'
})
this.counts = index
this.classifyId = e.classifyId
this.page = 1
this.getGoodsList()
},
bindAddgood() {
uni.navigateTo({
url: './addgood'
})
},
// 上下架商品
changeKg(index, row) {
console.log(row.status)
var datas = {}
datas.goodsIds = row.goodsId
if (row.status == 0) {
datas.status = 1
}
if (row.status == 1) {
datas.status = 0
}
// datas.status = row.status
// this.$Request.postJsonA("/admin/goods/update", datas).then(res => {
this.$Request.getT("/admin/goods/updateBatchStatus", datas).then(res => {
if (res.code == 0) {
this.page = 1
uni.showToast({
title: '操作成功',
icon: 'none'
})
this.getGoodsList()
}
});
}
},
onReachBottom: function() {
this.page = this.page + 1;
this.getGoodsList();
if (this.totalCount == this.goodsList.length) {
uni.showToast({
title: '已经到底了~',
icon: 'none'
})
}
},
onPullDownRefresh: function() {
this.page = 1;
this.getGoodsList();
},
}
</script>
<style lang="scss" scoped>
page {
background: #EDF1F7;
}
.selectcz {
width: 100%;
background-color: #FFFFFF;
position: fixed;
bottom: 0upx;
left: 0;
right: 0;
z-index: 9;
}
.tabse {
width: 50rpx;
height: 10rpx;
background-color: #FCD202;
position: absolute;
bottom: 0;
left: 45%;
transform: translate(-100%, -100%);
}
.tabse1 {
width: 50rpx;
height: 10rpx;
background-color: #FCD202;
position: absolute;
bottom: 0;
left: 70%;
transform: translate(-100%, -100%);
}
.tabse2 {
width: 50rpx;
height: 10rpx;
background-color: #FCD202;
position: absolute;
bottom: 0;
left: 95%;
transform: translate(-100%, -100%);
}
.bg {
background: #FFFFFF;
}
.boxs {
width: 150upx;
height: 55upx;
border: 2upx solid #CCCCCC;
border-radius: 28upx;
text-align: center;
line-height: 55upx;
color: #999999;
margin-right: 30rpx;
display: inline-block;
}
.actives {
width: 150upx;
height: 55upx;
border: 2upx solid #FFCC00;
border-radius: 28upx;
text-align: center;
line-height: 55upx;
color: #000000;
margin-right: 30rpx;
}
.btn {
width: 120upx;
height: 64upx;
border: 2upx solid #999999;
border-radius: 8upx;
text-align: center;
line-height: 64rpx;
color: #000000;
}
.box {
width: 131upx;
height: 45rpx;
background: #FFEAF0;
border-radius: 4upx;
text-align: center;
line-height: 45rpx;
font-size: 24upx;
font-weight: 500;
color: #FE215B;
}
.page-box {
position: relative;
// left: 0;
height: 100vh;
z-index: 0;
top: -20px;
}
.centre {
position: absolute;
left: 0;
top: 0;
right: 0;
bottom: 0;
margin: auto;
height: 400rpx;
text-align: center;
// padding: 200rpx auto;
font-size: 32rpx;
image {
width: 387rpx;
height: 341rpx;
// margin-bottom: 20rpx;
margin: 0 auto 20rpx;
// border: 1px dotted #000000;
}
.tips {
font-size: 32rpx;
color: #2F3044;
margin-top: 20rpx;
font-weight: 700;
}
.btn {
margin: 80rpx auto;
width: 600rpx;
border-radius: 32rpx;
line-height: 90rpx;
color: #ffffff;
font-size: 34rpx;
background: #5074FF;
}
}
.boxIndex {
height: 78upx;
line-height: 78upx;
}
.tans {
background: #fff;
}
.addguige {
width: 38%;
color: #ffffff;
text-align: center;
height: 88upx;
line-height: 88upx;
}
.addguigezz{
border-radius: 16upx 0 0 0;
background-color: #999999;
box-shadow: 0px 10upx 20upx 0px #999999;
}
.addguigezzs{
border-radius: 0 16upx 0 0;
background: #FCD202;
box-shadow: 0px 10upx 20upx 0px #FCD202;
}
.addguiges {
width: 90%;
margin: 0 auto;
background: #FCD202;
box-shadow: 0px 10upx 20upx 0px #FFD9B3;
border-radius: 16upx;
text-align: center;
height: 88upx;
line-height: 88upx;
/* position: fixed;
bottom: 25upx;
left: 0;
right: 0; */
}
</style>

311
my/store/editor.vue Normal file
View File

@@ -0,0 +1,311 @@
<template>
<view class="padding">
<view class="padding bg radius">
<view class="">
<view class="text-df text-bold">规格标题</view>
<view>
<u-input v-model="shopName" placeholder="请输入规格标题" />
</view>
</view>
</view>
<view class="bg margin-tb padding-sm radius" v-for="(item,index) in shopList" :key='index'>
<view class="">
<view style="display: flex;width: 100%;">
<view style="width: 70%;" class="text-df text-bold">规格</view>
<view style="width: 30%;text-align: right;" class="text-df text-bold" v-if="index != 0" @tap="delteItem(index)">删除</view>
</view>
<view>
<u-input v-model="item.value" placeholder="请填写" />
</view>
</view>
<view class="">
<view class="text-df text-bold">规格值</view>
<!-- <view>
<u-input v-model="detailName" placeholder="请填写" />
</view> -->
</view>
<view class="flex align-center flex-wrap margin-bottom-sm">
<view v-for="(item1,index1) in item.detail" :key="index1" class="btn flex align-center margin-top"
:class="listIndex1 == index1&&listIndex==index?'active':''" @click="bindqie(index1,item1,index)">
<view>{{item1}}</view>
<view class="margin-left-sm" @tap.stop="bindupdata(index1,item1,index)">x</view>
</view>
<view class="btns margin-top" @click="addtype(1,item1,index)">+添加</view>
</view>
</view>
<u-button class="margin-top addguiges" :custom-style="customStyle" shape="square" :hair-line="false"
@click="addguige()">添加规格
</u-button>
<view class="margin-top">
<u-button @click="submit" class=" addguige" :custom-style="customStyle" shape="square" :hair-line="false">确认
</u-button>
</view>
<!-- 添加规格弹框 -->
<u-popup v-model="show" mode="center" border-radius="14" width="500rpx" height="300rpx">
<view>
<view class="padding">
<view>添加规格类型</view>
<view>
<u-input v-model="typeName" placeholder="请填写" clearable="false" />
</view>
</view>
<view class="addguiges" @click="bindclose(aa)">确定</view>
</view>
</u-popup>
</view>
</template>
<script>
import configdata from '@/common/config.js';
export default {
data() {
return {
shopName: '',
customStyle: {
backgroundColor: '#FFCC00',
color: '#000000',
border: 0
},
shopList: [{
value: '',
detail: [],
}],
listIndex1: 0,
listIndex: 0,
show: false,
typeName: '',
ruleValues: [],
id: '',
guigeLIst: {},
detailName: '',
guigeIndex: 0,
guigezhiIndex: 0,
aa: '',
shopId: '',
}
},
onLoad(option) {
this.id = option.id
this.shopId = this.$queue.getData("shopId")
if (option.id) {
this.guigeLIst = uni.getStorageSync('guige')
this.shopName = this.guigeLIst.ruleName
this.shopList = this.guigeLIst.ruleValue
for (var i = 0; i < this.shopList.length; i++) {
// #ifdef APP
this.shopList[i].detail = this.shopList[i].detail.split(',')
// #endif
// #ifndef APP
this.shopList[i].detail = this.shopList[i].detail.split('/')
// #endif
}
}
},
onShow() {
},
methods: {
delteItem(index){
this.shopList.splice(index, 1)
},
//删除规格
bindupdata(index1, item1, index) {
this.shopList[index].detail.splice(index1, 1)
},
bindqie(index1, item1, index) {
this.listIndex = index
this.listIndex1 = index1
this.shopList[index].detail[index1] = item1
this.typeName = item1
this.aa = index1
this.show = true
},
addtype(index1, item, index) {
this.guigeIndex = index
this.guigezhiIndex = index1
if (index1 == 1) {
this.typeName = ''
this.aa = ''
this.show = true
}
},
bindclose(index) {
if (!this.typeName) {
uni.showToast({
title: '请填写规格',
icon: 'none',
duration: 1000
})
return
}
console.log('aaaaaaa', index)
if (index === '') {
this.show = false
// this.list.push(this.typeName)
this.shopList[this.guigeIndex].detail.push(this.typeName)
} else {
this.show = false
this.shopList[this.guigeIndex].detail[this.aa] = this.typeName
}
},
// 发布
submit() {
if (!this.shopName) {
uni.showToast({
title: '请填写规格标题',
icon: 'none',
duration: 1000
})
return
}
if(this.shopList.length == 0){
uni.showToast({
title: '请选择规格',
icon: 'none',
duration: 1000
})
return
}
var arrLength = this.shopList[this.shopList.length - 1]
if (arrLength.value == '' || arrLength.detail.length == 0) {
uni.showToast({
title: '请填写规格或是规格值',
icon: 'none'
})
return
}
let guigeList = {}
let shopList = JSON.parse(JSON.stringify(this.shopList))
for (var i in shopList) {
shopList[i].detail = shopList[i].detail.toString()
}
console.log(shopList)
guigeList.ruleName = this.shopName
guigeList.ruleValue = shopList
guigeList.shopId = this.shopId
if (this.id) {
guigeList.id = this.id
this.$Request.postJson("/selfGoodsRule/update", guigeList).then(res => {
if (res.code == 0) {
uni.showToast({
title: '修改成功',
icon: 'none'
})
uni.navigateBack()
} else {
uni.showToast({
title: res.msg,
icon: 'none'
})
// this.shopList = this.shopList[this.guigeIndex].detail.split(',')
// console.log(this.shopList,2222)
}
})
} else {
this.$Request.postJson("/selfGoodsRule/save", guigeList).then(res => {
if (res.code == 0) {
uni.navigateBack()
}
})
}
},
// 添加规格
addguige() {
var arrLength = this.shopList[this.shopList.length - 1]
if (arrLength.value == '' || arrLength.detail.length == 0) {
uni.showToast({
title: '请填写规格或是规格值',
icon: 'none'
})
} else {
var data = {
value: '',
detail: [],
}
this.shopList.push(data)
console.log(this.shopList, 11111)
}
}
}
}
</script>
<style>
page {
background-color: #F5F5F5;
}
.bg {
background-color: #FFFFFF;
}
.btn {
border: 1upx solid #CCCCCC;
border-radius: 28px;
padding: 15rpx 30rpx;
margin-right: 25rpx;
}
.btns {
border: 1upx dashed #333333;
border-radius: 28px;
padding: 10rpx 30rpx;
margin-right: 25rpx;
}
.active {
/* background: #FCD202; */
/* border: none; */
}
.addguige {
width: 90%;
margin: 0 auto;
background: #FCD202;
box-shadow: 0px 10upx 20upx 0px #FFD9B3;
border-radius: 16upx;
text-align: center;
height: 88upx;
line-height: 88upx;
/* position: fixed;
bottom: 25upx;
left: 0;
right: 0; */
}
.addguiges {
width: 90%;
margin: 0 auto;
background: #FCD202;
box-shadow: 0px 10upx 20upx 0px #FFD9B3;
border-radius: 16upx;
text-align: center;
height: 88upx;
line-height: 88upx;
/* position: fixed;
bottom: 25upx;
left: 0;
right: 0; */
}
</style>

232
my/store/fenlei.vue Normal file
View File

@@ -0,0 +1,232 @@
<template>
<view>
<view v-for="(item,index) in list" :key="index" class="flex padding justify-between">
<view class="flex align-center">
<view class="text-bold text-xl">{{index+1}}.</view>
<view class="margin-left-xs">{{item.classifyName}}</view>
</view>
<view class="flex align-center">
<view class="btn margin-right-sm" @click="addtype(2,item)">修改</view>
<view class="btn" @click="bindupdata(item)">删除</view>
</view>
</view>
<empty v-if="list.length == 0" content="暂无数据"></empty>
<view class="addguige text-bold" @click="addtype(1)">添加</view>
<!-- 添加规格弹框 -->
<u-popup v-model="show" mode="center" border-radius="14" width="500rpx" height="400rpx">
<view>
<view class="padding" style="margin-bottom: 20rpx;">
<view>商品分类</view>
<view class="flex align-center" style="margin-top: 15rpx;">
<label style="margin-right: 10rpx;">分类名称</label><u-input v-model="typeName" placeholder="请填写分类名称" clearable="false" />
</view>
<view class="flex align-center" style="margin-top: 15rpx;">
<label style="margin-right: 10rpx;">分类排序</label><u-number-box v-model="sort" placeholder="请填写分类排序"></u-number-box>
</view>
</view>
<view class="addguiges" @click="bindAdd()">确定</view>
</view>
</u-popup>
</view>
</template>
<script>
import empty from '@/components/empty.vue'
export default {
components: {
empty
},
data() {
return {
list: [{
id: 1,
name: '清爽夏日',
}, {
id: 2,
name: '牛奶系列',
}, {
id: 3,
name: '鲜榨果汁',
}],
show: false,
typeName: '',
sort:0,
classifyId: '',
shopId: '',
shopName: '',
}
},
onLoad() {
uni.showLoading({
title: '数据加载中...',
mask: false
})
this.shopId = this.$queue.getData("shopId")
this.shopName = this.$queue.getData("shopUserName")
this.getlist()
},
methods: {
addtype(index, item) {
console.log(index, item)
if (index == 1) {
this.show = true
this.typeName = ''
this.classifyId = ''
this.sort = 0
} else if (index == 2) {
this.show = true
this.typeName = item.classifyName
this.classifyId = item.classifyId
if(item.sort){
this.sort = item.sort
}else{
this.sort = 0
}
}
},
//添加商品类型
bindAdd() {
if (!this.typeName) {
uni.showToast({
title: '请填写商品类型',
icon: 'none',
duration: 1000
})
return
}
console.log(this.classifyId)
if (this.classifyId) {
let data = {
classifyId: this.classifyId,
classifyName: this.typeName,
shopId: this.shopId,
shopName: this.shopName,
sort:this.sort,
}
this.$Request.postJson("/admin/goods/updateClassify", data).then(res => {
if (res.code == 0) {
// this.list = res.data
this.show = false
this.typeName = ''
this.classifyId = ''
this.sort = 0
this.getlist()
}
})
} else {
let data = {
classifyName: this.typeName,
shopId: this.shopId,
shopName: this.shopName,
sort:this.sort
}
this.$Request.postJson("/admin/goods/insertClassify", data).then(res => {
if (res.code == 0) {
// this.list = res.data
this.show = false
this.typeName = ''
this.classifyId = ''
this.sort = 0
this.getlist()
}
})
}
},
//获取分类列表
getlist() {
let data = {
shopId: this.shopId
}
this.$Request.getA("/admin/goods/selectAllClassify", data).then(res => {
uni.hideLoading()
if (res.code == 0) {
this.list = res.data
}
})
},
//删除商品类型
bindupdata(e) {
console.log(e)
uni.showModal({
title: '提示',
content: '确定要删除当前类型吗?',
cancelText: "取消", // 取消按钮的文字
confirmText: "确定", // 确认按钮文字
showCancel: true, // 是否显示取消按钮,默认为 true
confirmColor: '#f55850',
cancelColor: '#39B54A',
success: (res) => {
if (res.confirm) {
let data = {
classifyId: e.classifyId
}
this.$Request.getA("/admin/goods/deleteClassify", data).then(res => {
if (res.code == 0) {
uni.showToast({
title: "删除成功",
icon: 'none'
})
this.getlist();
} else {
uni.showToast({
title: res.msg,
icon: 'none'
})
}
});
}
}
})
}
}
}
</script>
<style>
page {
background: #FFFFFF;
}
.btn {
border: 2upx solid #999999;
border-radius: 24px;
color: #333333;
padding: 5rpx 30rpx;
}
.addguige {
width: 90%;
margin: 0 auto;
background: #FCD202;
box-shadow: 0px 10upx 20upx 0px #FFD9B3;
border-radius: 16upx;
text-align: center;
height: 88upx;
line-height: 88upx;
position: fixed;
bottom: 25upx;
left: 0;
right: 0;
}
.addguiges {
width: 90%;
margin: 0 auto;
background: #FCD202;
box-shadow: 0px 10upx 20upx 0px #FFD9B3;
border-radius: 16upx;
text-align: center;
height: 88upx;
line-height: 88upx;
/* position: fixed;
bottom: 25upx;
left: 0;
right: 0; */
}
</style>

473
my/store/goodDetail.vue Normal file
View File

@@ -0,0 +1,473 @@
<template>
<view>
<!-- <view class="detail-banner ">
<swiper class="swiper" :autoplay="true" interval="2000" duration="500" :circular="true" style="width: 100%;height: 410rpx;">
<swiper-item v-for="(item,index) in dataCentre.goodsPicture" :key='index' >
<image :src="item" mode="scaleToFill" style="width: 100%;"></image>
</swiper-item>
</swiper>
</view> -->
<view class="flex padding bg-white">
<image :src="dataCentre.goodsCover" style="width:200rpx;height:200rpx;border-radius: 10rpx;"></image>
<view class="flex flex-direction justify-between margin-left">
<view class="text-black text-bold text-lg">{{dataCentre.goodsName}}</view>
<view class="flex">
<view v-if="dataCentre.goodsLabel1.length>0" class="btn margin-right-xs"
v-for="(item,index) in dataCentre.goodsLabel1" :key='index'>{{item}}</view>
</view>
<view v-if="type==1">库存{{dataCentre.inventory?dataCentre.inventory:0}}</view>
<view class="text-lg text-red"><text class="text-sm">¥</text>{{dataCentre.goodsMoney}}</view>
</view>
</view>
<!-- <view class="detail">
<view class="detail_text">{{dataCentre.goodsName}}</view>
<view class="detail_biao" v-if="dataCentre.goodsLabel.length">
<view class="detail_biao_sty" v-for="(ite, ind) in dataCentre.goodsLabel" :key='ind'>{{ite}}</view>
</view>
<view class="margin-top" v-for="(item,index) in attrList" :key="index" >
<view class="text-bold text-black">{{item.value}}</view>
<view class="flex margin-tb-sm flex-wrap">
<view v-for="(ite, ind) in item.detail" :key="ind" @click="skuSel(ite,index,ind)"
class="margin-bottom-sm">
<view class="btn" :class="item.goodsId == index && item.attrId == ind?'active': ''">
{{ite.name}}
</view>
</view>
</view>
</view>
</view> -->
<view class="padding bg-white">
<text class="text-bold text-black text-lg ">商品介绍</text>
<u-parse class='margin-top' :html="dataCentre.goodsDescribe"></u-parse>
</view>
<view class="padding margin-top-sm bg-white">
<view class="text-bold text-black text-lg ">其他信息</view>
<view class="flex justify-between align-center margin-tb-sm">
<view style="font-size:30upx;color:#999999;">商品售价</view>
<view class="text-black">{{dataCentre.goodsMoney?dataCentre.goodsMoney:'暂无'}}</view>
</view>
<view class="flex justify-between align-center margin-tb-sm">
<view style="font-size:30upx;color:#999999;">打包费</view>
<view class="text-black">{{dataCentre.packMoney?dataCentre.packMoney:'0'}}</view>
</view>
<view class="flex justify-between align-center margin-tb-sm">
<view style="font-size:30upx;color:#999999;">标签</view>
<view class="text-black">{{dataCentre.goodsLabel?dataCentre.goodsLabel:'暂无'}}</view>
</view>
<view class="flex justify-between align-center margin-tb-sm">
<view style="font-size:30upx;color:#999999;">创建时间</view>
<view class="text-black">{{dataCentre.createTime}}</view>
</view>
</view>
<view class="padding margin-top-sm bg-white" v-if="type==1">
<view class="text-bold text-black text-lg ">其他设置</view>
<view class="flex justify-between align-center margin-tb-sm">
<view>商品状态</view>
<u-switch @change="change" active-color="#FFCC00" v-model="checked"></u-switch>
</view>
<view class="flex justify-between align-center margin-tb-sm">
<view>库存编辑</view>
<input type="number" placeholder="请输入修改库存数" style="text-align: right;" v-model="inventory" />
</view>
</view>
<!-- <view class="bg padding">
<view class="flex justify-between ">
<view style="font-size:40upx;"><text class="text-sm"></text>12.00</view>
<view style="color:#999999;" class="text-sm">库存236</view>
</view>
<view class="text-lg text-bold padding-tb-xs">草莓沫沫酸奶奶昔</view>
<view class="flex">
<view class="btn">人气爆款</view>
<view class="btn">福利必点系列</view>
</view>
<view class="text-sm padding-tb-sm">规格</view>
<view class="flex">
<view class="box" v-for="(item,index) in list" :key="index" @click="bindge(index)"
:class="count == index?'boxs':''">{{item.name}}</view>
</view>
<view class="text-sm padding-tb-sm">甜度</view>
<view class="flex">
<view class="box" v-for="(item,index) in lists" :key="index" @click="bindtd(index)"
:class="counts == index?'boxs':''">{{item.name}}</view>
</view>
</view>
<view class="margin-top-sm padding-lr bg">
<view class="text-sm padding-top-sm">规格</view>
<view class="text-sm padding-tb-sm">蜂蜜黄油辣辣海苔2款口味可选精选优质新鲜马铃薯使用低
温真空油炸VF技术锁鲜香甜不腻咖哧酥脆净含量50</view>
</view> -->
<!-- <view class="bg padding margin-top-sm">
<view class="flex justify-between padding-tb-sm">
<view>打包费</view>
<view>5</view>
</view>
<view class="flex justify-between padding-tb-sm">
<view>折扣价</view>
<view>9.9</view>
</view>
</view> -->
<view v-if="type==1" class="addgood" @click="save()">保存</view>
<view v-if="type==2" class="addgood" @click="goAdd(dataCentre.goodsId)">修改商品</view>
<view v-if="type==1" class="addgood" @click="del()">删除</view>
</view>
</template>
<script>
export default {
data() {
return {
list: [{
name: '标准'
}],
count: 0,
lists: [{
name: '无糖'
}, {
name: '少糖'
}, {
name: '半糖'
}],
counts: 0,
goodsId: '',
good: {},
dataCentre: {},
checked: false,
shopId: '',
inventory: '',
type: 1,
status: 1,
attrList: [],
skuList: [],
}
},
onLoad(option) {
uni.showLoading({
title: '加载中......',
icon: 'loading'
})
console.log(option)
this.goodsId = option.goodsId
this.shopId = uni.getStorageSync('shopId')
this.type = option.type
this.getGoodDet()
},
onShow() {
this.getGoodDet()
},
methods: {
goAdd(goodsId) {
uni.navigateTo({
url: '/my/publish/goods?goodsId='+goodsId
})
},
change(e) {
console.log()
let that = this
let data = {
shopId: that.shopId,
goodsId: that.goodsId,
status: e ? 0 : 1
}
that.$Request.postA("/admin/goodsShop/soldOutOrPutaway", data).then(res => {
if (res.code == 0) {
// that.getGoodsList()
uni.showToast({
title: e ? '上架成功' : '下架成功',
icon: 'none'
})
uni.setStorageSync('updata', true)
setTimeout(function() {
let pages = getCurrentPages(); // 当前页面
let beforePage = pages[pages.length - 2]; // 上一页
uni.navigateBack();
}, 1000)
}
});
},
getGoodDet() {
if (this.type == 1) {
let data = {
goodsId: this.goodsId,
shopId: this.shopId
}
this.$Request.getA("/admin/goodsShop/selectGoodsByShopIdAndGoodsId", data).then(res => {
if (res.code == 0) {
uni.hideLoading()
this.dataCentre = res.data
this.attrList.forEach(res => {
let data = {
name: ''
}
// this.checkStateList.push(data);
let detail = [];
res.detail.split(',').forEach(d => {
let data = {
name: '',
state: ''
}
data.name = d;
detail.push(data);
});
res.detail = detail;
})
console.log(this.attrList)
}
});
} else {
let data = {
goodsId: this.goodsId
}
this.$Request.getA("/admin/goods/selectGoodsById", data).then(res => {
if (res.code == 0) {
uni.hideLoading()
this.dataCentre = res.data
this.attrList.forEach(res => {
let data = {
name: ''
}
// this.checkStateList.push(data);
let detail = [];
res.detail.split(',').forEach(d => {
let data = {
name: '',
state: ''
}
data.name = d;
detail.push(data);
});
res.detail = detail;
})
console.log(this.attrList)
}
});
}
},
// 修改库存
save() {
let data = {
goodsId: this.goodsId,
shopId: this.shopId,
inventory: this.inventory
}
this.$Request.postJsonA("/admin/goodsShop/updateGoodsByShopId", data).then(res => {
if (res.code == 0) {
uni.showToast({
title: '保存成功',
icon: 'none'
})
uni.setStorageSync('updata', true)
setTimeout(function() {
uni.navigateBack({
delta: 1
})
}, 1000)
}
});
},
// 添加
add(e) {
let data = [{
goodsId: this.goodsId,
shopId: this.shopId
}]
this.$Request.postJsonA("/admin/goodsShop/addGoodsByShopId", data).then(res => {
if (res.code == 0) {
// this.page = 1
// this.getGoodsList()
uni.showToast({
title: '添加成功',
icon: 'none'
})
uni.setStorageSync('updata', true)
setTimeout(function() {
uni.navigateBack({
delta: 2
})
}, 1000)
}
});
},
// 删除
del(e) {
let that = this
uni.showModal({
title: '提示',
content: '确认删除商品吗',
success: function(res) {
if (res.confirm) {
console.log('用户点击确定');
let data = {
shopId: that.shopId,
goodsId: this.goodsId,
}
that.$Request.postA("/admin/goodsShop/deleteGoodsByShopId", data).then(res => {
if (res.code == 0) {
// that.getGoodsList()
uni.showToast({
title: '删除成功',
icon: 'none'
})
setTimeout(function() {
let pages = getCurrentPages(); // 当前页面
let beforePage = pages[pages.length - 2]; // 上一页
uni.navigateBack({
success: function() {
beforePage
.onLoad(); // 执行上一页的onLoad方法
}
});
}, 1000)
}
});
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
},
}
}
</script>
<style>
page {
background: #EDF1F7;
}
.bg {
background: #FFFFFF;
}
.btn {
background: rgba(216, 2, 4, 0.2);
opacity: 0.6;
border-radius: 4upx;
color: #D80204;
padding: 8rpx 13rpx;
font-size: 23rpx;
margin-right: 16rpx;
}
.box {
border: 2upx solid #CCCCCC;
/* opacity: 0.6; */
border-radius: 8upx;
color: #999999;
font-size: 30upx;
padding: 13rpx 44rpx;
margin-right: 35rpx;
}
.boxs {
background: rgba(252, 210, 2, 0.2);
border: 2upx solid #FCD202;
/* opacity: 0.6; */
border-radius: 8upx;
color: #333333 !important;
font-size: 30upx;
padding: 13rpx 44rpx;
}
.addgood {
width: 685upx;
height: 88upx;
background: #FFCC00;
border-radius: 8upx;
text-align: center;
line-height: 88rpx;
margin: 40rpx auto;
/* position: fixed;
bottom: 35rpx;
left: 0;
right: 0; */
font-size: 32rpx;
font-weight: bold;
color: #FFFFFF;
}
.detail-banner {
width: 100%;
height: 410rpx;
}
.detail-banner image {
width: 100%;
height: 410rpx;
}
.detail {
width: 100%;
padding: 3%;
overflow: hidden;
/* position: relative; */
/* top: -20rpx; */
background-color: #FFFFFF;
border-radius: 32rpx 0 0 0;
}
.detail_text {
font-size: 36rpx;
font-weight: 800;
color: #333333;
}
.detail_biao {
display: flex;
padding: 2% 0;
}
.detail_biao_sty {
/* padding: 1% 1.5%; */
padding: 10rpx 20rpx;
background: rgba(216, 2, 4, 0.2);
opacity: 0.6;
color: #D80204;
border-radius: 8rpx;
font-size: 24rpx;
margin-right: 2%;
}
.detail_text2 {
font-size: 24rpx;
font-family: PingFang SC;
color: #333333;
margin-top: 1%;
}
.detail_biao2 {
display: flex;
padding: 1% 0;
font-size: 30rpx;
}
.detail_biao2_sty {
padding: 1% 2.5%;
/* width: 13%; */
text-align: center;
background: rgba(252, 210, 2, 0.2);
border: 2rpx solid #FCD202;
opacity: 0.6;
border-radius: 8rpx;
margin-right: 2%;
}
.detail_biao2_sty2 {
padding: 1% 2.5%;
/* width: 13%; */
text-align: center;
border: 2rpx solid #999999;
opacity: 0.6;
color: #999999;
border-radius: 8rpx;
margin-right: 3%;
}
</style>

194
my/store/guige.vue Normal file
View File

@@ -0,0 +1,194 @@
<template>
<view style="padding-bottom: 70px;">
<view>
<view class="" >
<view class="bg btnbox" v-for="(item,index) in list" :key="index" v-if="list.length>0">
<view class="padding-sm" style="color:#666666;">创建时间 {{item.createTime}}</view>
<view style="width:100%;border-top: 1upx solid #E6E6E6;"></view>
<view class="padding-sm">
<view class="text-lg text-bold" style="color:#333333;">{{item.ruleName}}</view>
<view v-for="(name,index) in item.ruleValue">
<view class="flex align-center padding-top">
<view style="color:#999999;">{{name.value}}:</view>
<view v-for="(ite,index) in name.detail" :key="index">{{ite}}
</view>
</view>
</view>
</view>
<view class="flex justify-end padding-tb">
<view class="btn " @click="bindupdete(item)">删除</view>
<view class="btn1" @click="bindeditor(item)">重新编辑</view>
</view>
</view>
</view>
<view class="addguige text-bold" @click="goEditor()">添加</view>
</view>
<empty v-if="!list.length" style="z-index:0"></empty>
</view>
</template>
<script>
import empty from '@/components/empty.vue'
export default {
components: {
empty
},
data() {
return {
list: [],
shopId:'',
shopName:'',
}
},
onLoad() {
uni.showLoading({
title: '加载中...'
})
this.shopId = this.$queue.getData("shopId")
this.shopName = this.$queue.getData("shopUserName")
this.getlist()
},
onShow() {
this.getlist()
},
methods: {
goEditor() {
uni.navigateTo({
url: '/my/store/editor'
})
},
getlist() {
let data = {
shopId: this.shopId
}
this.$Request.getA("/selfGoodsRule/list", data).then(res => {
uni.hideLoading()
if (res.code == 0) {
this.list = res.data
for (var i = 0; i < this.list.length; i++) {
for (var a = 0; a < this.list[i].ruleValue.length; a++) {
// this.list[i].ruleValue[a].detail = this.list[i].ruleValue[a].detail.split(',')
this.list[i].ruleValue[a].detail = this.list[i].ruleValue[a].detail.replaceAll(',','/')
}
}
}
});
},
//重新编辑
bindeditor(e) {
console.log(e)
uni.setStorageSync('guige', e)
uni.navigateTo({
url: '/my/store/editor?id=' + e.id
})
},
//删除
bindupdete(e) {
uni.showModal({
title: '提示',
content: '确定要删除当前规格吗?',
cancelText: "取消", // 取消按钮的文字
confirmText: "确定", // 确认按钮文字
showCancel: true, // 是否显示取消按钮,默认为 true
confirmColor: '#f55850',
cancelColor: '#39B54A',
success: (res) => {
if (res.confirm) {
let data = {
id: e.id
}
this.$Request.getA("/selfGoodsRule/delete", data).then(res => {
if (res.code == 0) {
uni.showToast({
title: "删除成功",
icon: 'none'
})
this.getlist();
}else{
uni.showToast({
title: res.msg,
icon: 'none'
})
}
});
} else {
}
}
})
console.log(e)
},
},
onReachBottom: function() {
// this.page = this.page + 1;
// this.getlist();
// if (this.totalCount == this.getlist.length) {
// uni.showToast({
// title: '已经到底了~',
// icon: 'none'
// })
// }
},
onPullDownRefresh: function() {
// this.page = 1;
// this.getlist();
},
}
</script>
<style>
page {
background: #F2F2F2;
}
.bg {
background: #FFFFFF;
}
.btnbox {
margin: 20rpx 30rpx;
border-radius: 20rpx;
}
.btn {
border-radius: 25px;
padding: 6rpx 30rpx;
border: 1px solid #686868;
color: #686868;
margin-right: 30rpx;
}
.btn1 {
border-radius: 25px;
padding: 6rpx 30rpx;
background: #FCD202;
/* color: #686868; */
margin-right: 30rpx;
}
.addguige {
width: 90%;
margin: 0 auto;
background: #FCD202;
box-shadow: 0px 10upx 20upx 0px #FFD9B3;
border-radius: 16upx;
text-align: center;
height: 88upx;
line-height: 88upx;
position: fixed;
bottom: 25upx;
left: 0;
right: 0;
z-index: 99;
}
</style>

147
my/store/hdInfo.vue Normal file
View File

@@ -0,0 +1,147 @@
<template>
<view>
<!-- swiper -->
<view class="sw">
<swiper :indicator-dots="false" style="width: 100%;height: 100%;" :autoplay="true" :interval="3000"
:duration="300">
<swiper-item v-for="(item,index) in imgs">
<image :src="item" style="width: 100%;height: 100%;" mode="aspectFill"></image>
</swiper-item>
</swiper>
</view>
<!-- 活动标题 -->
<view class="title flex justify-center align-center">
<view class="title-box flex align-center">
{{info.activityTitle}}
</view>
</view>
<!-- 活动内容 -->
<view class="info flex justify-center">
<view class="info-box" v-html="content">
</view>
</view>
<!-- 加入按钮 -->
<view class="submit flex justify-center align-center">
<view class="submit-box flex justify-center align-center" @click="joinHd()">
加入活动
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
activityId: '',
info: {},
content: '',
imgs: [],
};
},
onLoad(option) {
console.log()
this.activityId = option.activityId
this.getInfo()
},
methods: {
//加入活动
joinHd() {
let data = {
activityId: this.activityId,
shopId: uni.getStorageSync('shopId')
}
this.$Request.get("/app/activityManage/shopJoinActivity", data).then(res => {
if (res.code == 0) {
uni.showModal({
title: '提示',
content: '确定加入该活动?',
complete(ret) {
if (ret.confirm) {
uni.showToast({
title: '加入成功'
})
setTimeout(() => {
uni.navigateBack()
}, 1000)
}
}
})
} else {
uni.showToast({
title: res.msg,
icon: 'none'
})
}
});
},
//活动详情
getInfo() {
let data = {
activityId: this.activityId
}
this.$Request.get("/app/activityManage/getActivityInfo", data).then(res => {
if (res.code == 0) {
this.content = res.data.activityContent.replace(new RegExp("img", "g"),
'img style="width:100%;height:auto;"')
this.info = res.data
this.imgs = res.data.activityImage.split(',')
}
});
},
}
}
</script>
<style lang="scss">
page {
background-color: #ffffff;
}
.sw {
width: 100%;
height: 300rpx;
}
.title {
width: 100%;
height: 100rpx;
background-color: #ffffff;
.title-box {
width: 686rpx;
height: 100%;
font-size: 32rpx;
font-weight: bold;
}
}
.info {
width: 100%;
height: auto;
.info-box {
width: 686rpx;
height: 100%;
}
}
.submit {
width: 100%;
height: 160rpx;
position: fixed;
bottom: 0;
background-color: #ffffff;
.submit-box {
width: 686rpx;
height: 88rpx;
background-color: #FCD202;
border-radius: 40rpx;
}
}
</style>

227
my/store/huodong.vue Normal file
View File

@@ -0,0 +1,227 @@
<template>
<view>
<!-- swiper -->
<view class="myswiper flex justify-center align-center" v-if="myhd.length!=0">
<swiper :indicator-dots="false" style="width: 100%;height: 100%;" :autoplay="true" :interval="3000" :duration="300">
<swiper-item v-for="(item,index) in myhd" :key="index">
<view class="swiper-item">
<image :src="item" style="width: 100%;height: 340rpx;" mode="aspectFill"></image>
</view>
</swiper-item>
</swiper>
</view>
<!-- 活动列表 -->
<view :style="myhd.length==0?'margin-top: 20rpx;':'margin-top: -40rpx;'" class="list flex justify-center flex-wrap">
<view class="list-box flex justify-center" v-if="item.no != '是'" v-for="(item,index) in huodongList" :key="index" @click="item.se!='是'?gotoinfo(item.activityId):''">
<view class="list-box-c flex justify-between align-center">
<view class="list-box-c-l flex align-center">
<image :src="item.activityImage.split(',')[0]" style="width: 100rpx;height: 100rpx;" mode="aspectFill"></image>
<view class="list-box-c-l-txt">
{{item.activityTitle}}
</view>
</view>
<view class="list-box-c-r" v-if="item.se!='是'" @click.stop="joinHd(item.activityId)">
加入
</view>
<view class="list-box-c-r" v-else>
已加入
</view>
</view>
</view>
<u-loadmore :status="status" v-if="huodongList.length>0" :icon-type="iconType" :load-text="loadText" />
</view>
<view class="flex justify-center flex-wrap" v-if="huodongList.length==0">
<image src="../../static/images/img/empty.png" style="width: 387rpx;height: 341rpx;margin-top: 100rpx;" mode=""></image>
<view class="" style="width: 100%;text-align: center;margin-top: 20rpx;">
暂无数据
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
myhd:[],
page: 1,
limit: 10,
huodongList: [],
total: 1,
status: 'loadmore',
iconType: 'flower',
activityId:'',
loadText: {
loadmore: '上拉加载更多',
loading: '努力加载中',
nomore: '实在没有了'
}
};
},
onLoad() {
//我参与的活动
this.getMyHuoDong()
//活动列表
this.getHuoDongList();
},
onShow() {
//我参与的活动
this.getMyHuoDong()
//活动列表
this.getHuoDongList();
},
//加载更多
onReachBottom() {
if(this.page < this.total){
this.page += 1
this.status = 'loading'
this.getHuoDongList()
}
},
//下拉刷新
onPullDownRefresh() {
this.page = 1
this.getHuoDongList()
this.getMyHuoDong()
},
methods: {
//加入活动
joinHd(activityId) {
let that = this
let data = {
activityId: activityId,
shopId: uni.getStorageSync('shopId')
}
this.$Request.get("/app/activityManage/shopJoinActivity", data).then(res => {
if (res.code == 0) {
uni.showModal({
title: '提示',
content: '加入该活动将自动退出当前活动,确定加入该活动?',
complete(ret) {
if (ret.confirm) {
uni.showToast({
title: '加入成功'
})
//我参与的活动
that.getMyHuoDong()
//活动列表
that.getHuoDongList();
}
}
})
} else {
uni.showToast({
title: res.msg,
icon: 'none'
})
}
});
},
gotoinfo(activityId){
uni.navigateTo({
url:'./hdInfo?activityId='+activityId
})
},
// 我参与的活动
getMyHuoDong() {
let data = {
shopId:uni.getStorageSync('shopId')
}
this.$Request.get("/app/goods/getShopActivity", data).then(res => {
if (res.code == 0) {
this.activityId = res.data.activityId
this.myhd = res.data.activityImage.split(',')
}
});
},
getHuoDongList() {
let data = {
page: this.page,
limit: this.limit
}
this.$Request.getT("/app/activityManage/getActivityList", data).then(res => {
uni.stopPullDownRefresh()
if (res.code == 0) {
res.data.records.map(item=>{
if(item.activityId==14){
item.no = '是'
}
if(item.activityId==this.activityId){
item.se = '是'
}else{
item.se = '否'
}
})
this.total = res.data.pages
if (this.page == 1) {
this.huodongList = res.data.records
} else {
this.huodongList = [...this.huodongList, ...res.data.records]
}
if(this.page == this.total){
this.status = 'nomore'
}else{
this.status = 'loadmore'
}
}
});
},
}
}
</script>
<style lang="scss">
.myswiper {
width: 100%;
height: 340rpx;
z-index: 0;
}
.list {
width: 100%;
height: 160rpx;
.list-box {
width: 686rpx;
height: 100%;
border-radius: 24rpx;
background-color: #ffffff;
margin-bottom: 20rpx;
z-index: 999;
.list-box-c {
width: 646rpx;
height: 100%;
}
.list-box-c-l {
image {
width: 100rpx;
height: 100rpx;
border-radius: 16rpx;
}
.list-box-c-l-txt {
width: 50vw;
height: 100rpx;
margin-left: 20rpx;
font-size: 26rpx;
overflow: hidden;
line-height: 100rpx;
}
}
.list-box-c-r {
// border: 1rpx solid #FCD202;
background: #FCD202;
padding: 10rpx 30rpx 10rpx 30rpx;
// color: #ffffff;
font-size: 26rpx;
border-radius: 24rpx;
}
}
}
</style>

596
my/store/index.vue Normal file
View File

@@ -0,0 +1,596 @@
<template>
<view class="padding">
<view class="text-white padding bg radius">
<u-form :model="shop" label-position="top">
<u-form-item label="店铺名称 ">
<text class="text-sm" @click="gokefu()"
style="color: red;position: absolute;top: 20rpx;left:135rpx;">*请联系客服修改</text>
<u-input v-model="shop.shopName" placeholder="请输入店铺名称" :disabled="true" />
</u-form-item>
<u-form-item label="开店时间">
<!-- #ifdef MP-WEIXIN -->
<u-input v-model="shop.businessHours" placeholder="请填写" :disabled="true"
@click="startShow = true" />
<!-- #endif -->
<!-- #ifndef MP-WEIXIN -->
<view style="width: 100%;">
<picker mode="time" :value="shop.businessHours" placeholder="请填写" start="00:00" end="23:59"
@change="bindTimeChange">
<view class="uni-input">{{shop.businessHours?shop.businessHours:'请填写'}}</view>
</picker>
</view>
<!-- #endif -->
</u-form-item>
<u-form-item label="闭店时间">
<!-- #ifdef MP-WEIXIN -->
<u-input v-model="shop.lockHours" :disabled="true" placeholder="请填写" @click="endShow = true" />
<!-- #endif -->
<!-- #ifndef MP-WEIXIN -->
<view style="width: 100%;">
<picker mode="time" :value="shop.lockHours" placeholder="请填写" start="00:00" end="23:59"
@change="bindTimeChanges">
<view class="uni-input">{{shop.lockHours?shop.lockHours:'请填写'}}</view>
</picker>
</view>
<!-- #endif -->
</u-form-item>
<u-form-item label="店铺地址">
<text class="text-sm" @click="gokefu()"
style="color: red;position: absolute;top: 20rpx;left:135rpx;">*请联系客服修改</text>
<!-- @click="bindOpen()" -->
<u-input v-model="shop.detailedAddress" :disabled="true" placeholder="请填写" />
</u-form-item>
<u-form-item label="店铺公告">
<textarea v-model="shop.shopNotice" rows="3" placeholder="请填写" maxlength="50" />
</u-form-item>
<u-form-item label="配送费(元)">
<text class="text-sm" @click="gokefu()"
style="color: red;position: absolute;top: 20rpx;left:155rpx;">*请联系客服修改</text>
<u-input v-model="shop.errandMoney" placeholder="请输入配送费" :disabled="true" />
</u-form-item>
<u-form-item label="最低起送金额(元)">
<u-input v-model="shop.minimumDelivery" placeholder="请输入最低起送金额" />
</u-form-item>
<u-form-item label="减免配送费最小订单金额(元)">
<u-input v-model="shop.exemptMinMoney" placeholder="请输入减免配送费最小订单金额" />
</u-form-item>
<u-form-item label="最大配送距离(千米)">
<text class="text-sm" @click="gokefu()"
style="color: red;position: absolute;top: 20rpx;left:285rpx;">*请联系客服修改</text>
<u-input v-model="distributionDistance" placeholder="请输入最大配送距离(单位:km)" :disabled="true" />
</u-form-item>
<u-form-item label="是否上线">
<u-radio-group v-model="shop.putawayFlag">
<u-radio name=0>上班啦</u-radio>
<u-radio name=1>打烊啦</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item label="是否开启平台配送">
<u-radio-group v-model="shop.autoSendOrder">
<u-radio name=0>开启</u-radio>
<u-radio name=1>关闭</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item label="是否开启自动接单">
<u-radio-group v-model="shop.autoAcceptOrder">
<u-radio name=0>开启</u-radio>
<u-radio name=1>关闭</u-radio>
</u-radio-group>
</u-form-item>
</u-form>
</view>
<view class="text-white padding bg radius margin-tb">
<u-form :model="shop" label-position="top">
<u-form-item label="打印机">
<text class="text-sm"
style="color: red;position: absolute;top: 25rpx;left: 105rpx;">*一个打印机只能绑定一个商家</text>
<u-radio-group v-model="shop.facility">
<!-- <u-radio name=0>上线</u-radio> -->
<u-radio name=1>飞鹅</u-radio>
</u-radio-group>
</u-form-item>
<u-form-item label="设备sn编码">
<u-input v-model="shop.snCode" placeholder="请输入设备sn编码" />
</u-form-item>
<u-form-item label="设备key秘钥">
<u-input v-model="shop.value" placeholder="请输入设备key秘钥" />
</u-form-item>
</u-form>
</view>
<view class="text-white padding bg radius margin-tb">
<view>
<view class="text-lg margin-top-sm text-black">店铺logo</view>
<view class="flex" style="overflow: hidden;flex-wrap: wrap;">
<view v-if="shop.shopCover.length">
<view class="margin-top flex margin-right-sm flex-wrap">
<view class="flex"
style="width: 200rpx;height: 200rpx;margin-right: 2rpx;position: relative;">
<image :src="shop.shopCover" style="width: 100%;height: 100%;"></image>
<view style="z-index: 9;position: absolute;top: -15rpx;right: -15rpx;"
@click="removeImgs()">
<u-icon name="close-circle-fill" color="#2979ff" size="50rpx"></u-icon>
</view>
</view>
</view>
</view>
<view class="margin-top" @click="addImage()" v-if="shop.shopCover.length<=0">
<view style="width: 200rpx;height: 200rpx;background: #f4f5f6;"
class="flex justify-center align-center">
<view>
<view class="text-center">
<image src="../static/addimg.png" style="width: 65rpx;height: 55rpx;">
</image>
</view>
<view class="text-center text-black">添加图片</view>
</view>
</view>
</view>
</view>
</view>
<view>
<view class="text-lg margin-top-sm text-black">店铺活动广告图可多张</view>
<view class="flex" style="overflow: hidden;flex-wrap: wrap;">
<view v-if="shopBanner.length">
<view class="margin-top flex margin-right-sm flex-wrap">
<view class="flex"
style="width: 200rpx;height: 200rpx;margin-right: 2rpx;position: relative;"
v-for="(image,index) in shopBanner" :key="index">
<image :src="image" style="width: 100%;height: 100%;"></image>
<view style="z-index: 9;position: absolute;top: -15rpx;right: -15rpx;"
@click="removeImg(index)">
<u-icon name="close-circle-fill" color="#2979ff" size="50rpx"></u-icon>
</view>
</view>
</view>
</view>
<view class="margin-top" @click="addImages(2)" v-if="shopBanner.length<6">
<view style="width: 200rpx;height: 200rpx;background: #f4f5f6;"
class="flex justify-center align-center">
<view>
<view class="text-center">
<image src="../static/addimg.png" style="width: 65rpx;height: 55rpx;">
</image>
</view>
<view class="text-center text-black">添加图片</view>
</view>
</view>
</view>
</view>
</view>
</view>
<!-- 时间筛选 -->
<u-picker v-model="startShow" mode="time" :params="params" @confirm="getStarttime()"></u-picker>
<u-picker v-model="endShow" mode="time" :params="paramss" @confirm="getEndtime()"></u-picker>
<u-button @click="submit" class="margin-top" :custom-style="customStyle" shape="square" :hair-line="false">提交
</u-button>
</view>
</template>
<script>
import configdata from '@/common/config.js';
export default {
data() {
return {
shop: {
shopName: '',
businessHours: '',
lockHours: '',
detailedAddress: '',
shopNotice: '',
putawayFlag: 1,
latitude: '',
longitude: '',
shopCover: '',
//详情图
shopBanner: [],
shopId: uni.getStorageSync('shopId'),
errandMoney: '',
minimumDelivery: '',
exemptMinMoney: '',
distributionDistance: '',
autoSendOrder: 1,
autoAcceptOrder: 1,
facility: 1,
snCode: '',
value: ''
},
// facility:1,
startShow: false,
endShow: false,
customStyle: {
backgroundColor: '#FFCC00',
color: '#000000',
border: 0
},
status: 1,
customStyle1: {
color: '#000000',
position: "fixed",
bottom: "15rpx",
left: "0rpx",
right: "0rpx",
margin: "0rpx 50rpx",
backgroundColor: '#FFCC00',
},
selarr: [],
show: false,
//详情图
shopBanner: [],
params: {
year: false,
month: false,
day: false,
hour: true,
minute: true,
second: false
},
paramss: {
year: false,
month: false,
day: false,
hour: true,
minute: true,
second: false
},
shopId: '',
page: 1,
limit: 100,
list: [{
name: '上线',
disabled: false
},
{
name: '下线',
disabled: false
}
],
distributionDistance: ''
}
},
onLoad(option) {
uni.showLoading({
title: '加载中......',
icon: 'loading'
})
// console.log(option, '店铺id')
this.shopId = option.shopId
this.getShopList()
},
onShow() {
},
methods: {
gokefu() {
uni.navigateTo({
url: '/pages/my/chat'
})
},
bindTimeChange: function(e) {
console.log(e)
this.shop.businessHours = e.target.value
},
bindTimeChanges: function(e) {
console.log(e)
this.shop.lockHours = e.target.value
},
//上线 下线
radioChange(e) {
// console.log(e)
},
// 店铺信息
getShopList() {
let data = {
shopId: this.$queue.getData('shopId')
}
this.$Request.getA("/app/shop/selectShopMessage", data).then(res => {
if (res.code == 0) {
uni.hideLoading()
this.shop.shopName = res.data.shopName
this.shop.detailedAddress = res.data.detailedAddress
this.shop.businessHours = res.data.businessHours
this.shop.lockHours = res.data.lockHours
this.shop.shopCover = res.data.shopCover
this.shop.shopNotice = res.data.shopNotice
this.shop.putawayFlag = res.data.putawayFlag ? res.data.putawayFlag : 0
this.shop.errandMoney = res.data.errandMoney
this.shop.minimumDelivery = res.data.minimumDelivery
this.shop.exemptMinMoney = res.data.exemptMinMoney
if (res.data.shopBanner) {
this.shop.shopBanner = res.data.shopBanner.split(',')
this.shopBanner = res.data.shopBanner.split(',')
}
this.shop.distributionDistance = res.data.distributionDistance
this.distributionDistance = res.data.distributionDistance / 1000
this.shop.autoSendOrder = res.data.autoSendOrder ? res.data.autoSendOrder : 0;
this.shop.autoAcceptOrder = res.data.autoAcceptOrder ? res.data.autoAcceptOrder : 0;
this.shop.snCode = res.data.snCode //设备sn编码
this.shop.value = res.data.value //设备key秘钥
// this.shop.facility = res.data.facility // 设备类型
}
});
},
getStarttime(e) {
console.log(e, '1111111111')
this.shop.businessHours = e.hour + ':' + e.minute
},
getEndtime(e) {
console.log(e)
this.shop.lockHours = e.hour + ':' + e.minute
},
// 详情图删除
removeImg(index) {
this.shopBanner.splice(index, 1)
},
// 店铺logo删除
removeImgs() {
this.shop.shopCover = ''
},
bindOpen(e) {
console.log(e)
let that = this
uni.chooseLocation({
success: function(res) {
console.log('位置名称:' + res.name);
console.log('详细地址:' + res.address);
console.log('纬度:' + res.latitude);
console.log('经度:' + res.longitude);
that.shop.detailedAddress = res.address
that.shop.shopLat = res.latitude
that.shop.shopLng = res.longitude
}
});
},
// 图片上传
addImages(e) {
let that = this
uni.chooseImage({
count: 6,
sourceType: ['album', 'camera'],
success: res => {
for (let i = 0; i < res.tempFilePaths.length; i++) {
that.$queue.showLoading("上传中...");
uni.uploadFile({ // 上传接口
url: that.config("APIHOST1") + '/alioss/upload', //真实的接口地址
filePath: res.tempFilePaths[i],
name: 'file',
success: (uploadFileRes) => {
if (that.shopBanner.length < 6) {
that.shopBanner.push(JSON.parse(uploadFileRes.data).data)
}
console.log(that.shopBanner)
uni.hideLoading();
}
});
}
}
})
},
// 图片上传
addImage() {
let that = this
uni.chooseImage({
count: 1,
sourceType: ['album', 'camera'],
success: res => {
for (let i = 0; i < res.tempFilePaths.length; i++) {
that.$queue.showLoading("上传中...");
uni.uploadFile({ // 上传接口
url: that.config("APIHOST1") + '/alioss/upload', //真实的接口地址
// url: 'https://jiazheng.xianmxkj.com/sqx_fast/alioss/upload',
filePath: res.tempFilePaths[i],
name: 'file',
success: (uploadFileRes) => {
that.shop.shopCover = JSON.parse(uploadFileRes.data).data
uni.hideLoading();
}
});
}
}
})
},
config: function(name) {
var info = null;
if (name) {
var name2 = name.split("."); //字符分割
if (name2.length > 1) {
info = configdata[name2[0]][name2[1]] || null;
} else {
info = configdata[name] || null;
}
if (info == null) {
let web_config = cache.get("web_config");
if (web_config) {
if (name2.length > 1) {
info = web_config[name2[0]][name2[1]] || null;
} else {
info = web_config[name] || null;
}
}
}
}
return info;
},
// 发布
submit() {
console.log(this.distributionDistance)
this.shop.shopBanner = this.shopBanner
this.shop.shopBanner = this.shop.shopBanner.toString();
this.shop.distributionDistance = this.distributionDistance * 1000
// this.shop.distributionDistance = this.shop.distributionDistance * 1000
// if (!this.shop.shopName) {
// uni.showToast({
// title: '请填写店铺名称',
// icon: 'none',
// duration: 1000
// })
// return
// }
if (!this.shop.businessHours) {
uni.showToast({
title: '请填写开店时间',
icon: 'none',
duration: 1000
})
return
}
if (!this.shop.lockHours) {
uni.showToast({
title: '请填写闭店时间',
icon: 'none',
duration: 1000
})
return
}
// if (!this.shop.detailedAddress) {
// uni.showToast({
// title: '请填写店铺地址',
// icon: 'none',
// duration: 1000
// })
// return
// }
if (!this.shop.shopNotice) {
uni.showToast({
title: '请填写店铺公告',
icon: 'none',
duration: 1000
})
return
}
// if (!this.shop.snCode) {
// uni.showToast({
// title: '请填写设备sn编码',
// icon: 'none',
// duration: 1000
// })
// return
// }
// if (!this.shop.value) {
// uni.showToast({
// title: '请填写设备key秘钥',
// icon: 'none',
// duration: 1000
// })
// return
// }
if (!this.shop.shopCover) {
uni.showToast({
title: '请上传店铺logo',
icon: 'none',
duration: 1000
})
return
}
if (!this.shop.shopBanner) {
uni.showToast({
title: '请上传店铺轮播图',
icon: 'none',
duration: 1000
})
return
}
// console.log('this.shop.putawayFlag',this.shop.putawayFlag)
// return
if (this.shop.putawayFlag == 0) {
// if (!this.shop.errandMoney) {
// uni.showToast({
// title: '请填写配送费',
// icon: 'none',
// duration: 1000
// })
// return
// }
if (!this.shop.minimumDelivery) {
this.shop.minimumDelivery = 0;
// uni.showToast({
// title: '请填写最低起送金额',
// icon: 'none',
// duration: 1000
// })
// return
}
if (!this.shop.exemptMinMoney) {
this.shop.exemptMinMoney = 0;
// uni.showToast({
// title: '请填写减免配送费最小订单金额',
// icon: 'none',
// duration: 1000
// })
// return
}
console.log(this.shop.distributionDistance)
// if (!this.shop.distributionDistance) {
// uni.showToast({
// title: '请填写最大配送距离',
// icon: 'none',
// duration: 1000
// })
// return
// }
}
console.log(this.shop)
// uni.setStorageSync('shopId', this.shop.shopId)
this.$Request.postJsonA("/app/shop/updateShopMessage", this.shop).then(res => {
if (res.code == 0) {
uni.showToast({
title: '修改成功',
icon: 'none'
})
setTimeout(function() {
uni.navigateBack()
// uni.navigateTo({
// url: '/my/publish/index'
// })
}, 1000)
} else {
uni.showToast({
title: res.msg,
icon: 'none'
})
}
});
},
}
}
</script>
<style>
page {
background-color: #F5F5F5;
}
.bg {
background-color: #FFFFFF;
}
.tabBox {
border: 1rpx solid #999999;
padding: 15rpx 20rpx;
border-radius: 15rpx;
font-size: 28rpx;
}
.btnnum {
color: #005DFF;
border: 1rpx solid #005DFF;
}
</style>

369
my/store/pingjia.vue Normal file
View File

@@ -0,0 +1,369 @@
<template>
<view>
<view class="flex margin-lr padding-tb-sm u-border-bottom" v-if="shopDet.shopScore">
<view class="flex padding-right">
<view class="text-sl" style="color: #FD6416;">{{shopDet.shopScore}}</view>
<view class="flex flex-direction justify-around margin-left-sm">
<view>商家评分</view>
<view class="flex">
<u-icon v-for="ite in shopDet.shopScore1" :key='ite' color="#FCD202" name="star-fill"></u-icon>
</view>
</view>
</view>
<view class="flex-sub flex justify-around u-border-left padding-left">
<view class="flex flex-direction justify-around text-center">
<view>好评</view>
<view>{{EvaluateData.goodReputation}}</view>
</view>
<view class="flex flex-direction justify-around text-center">
<view>中评</view>
<view>{{EvaluateData.mediumReview}}</view>
</view>
<view class="flex flex-direction justify-around text-center">
<view>差评</view>
<view>{{EvaluateData.negativeComment}}</view>
</view>
</view>
</view>
<view class="padding-tb-sm margin-lr">
<u-button hover-class='none' @click="sel(0)" type="primary" shape="circle" size="mini" :plain="false"
:custom-style="count==0?customStyle:customStyle1">全部评论</u-button>
<u-button hover-class='none' @click="sel(1)" type="primary" shape="circle" size="mini" :plain="false"
:custom-style="count==1?customStyle:customStyle1">
好评({{EvaluateData.goodReputation}})</u-button>
<u-button hover-class='none' @click="sel(2)" type="primary" shape="circle" size="mini" :plain="false"
:custom-style="count==2?customStyle:customStyle1">
中评({{EvaluateData.mediumReview}})</u-button>
<u-button hover-class='none' @click="sel(3)" type="primary" shape="circle" size="mini" :plain="false"
:custom-style="count==3?customStyle:customStyle1">
差评({{EvaluateData.negativeComment}})</u-button>
</view>
<view class="padding-tb-sm margin-lr u-border-bottom" v-for="(item, index) in EvaluateList" :key='index'>
<view class="flex justify-between align-center">
<view class="flex align-center">
<u-avatar :src="item.avatar" size="65"></u-avatar>
<view class=" margin-left-sm" style="line-height: 46upx;">{{item.userName?item.userName:'匿名'}}
</view>
<view class="flex margin-left-sm">
<u-icon v-for="ite in item.score" :key='ite' color="#FCD202" name="star-fill">
</u-icon>
</view>
</view>
<view>{{item.createTime}}</view>
</view>
<view style="display: flex;">
<view class="margin-top-sm" :style="!item.shopReplyMessage ? 'width: 90%;' : ''">{{item.evaluateMessage}}</view>
<view class="flex padding-top-sm margin-right" @tap="goShow(index)" v-if="!item.shopReplyMessage">
<image src="../../static/images/order/pinglun.png" style="width: 20px;height: 20px;"></image>
</view>
</view>
<view class="margin-top-sm" v-if="item.shopReplyMessage">
<view class="flex align-center">
<view class=" flex align-center text-df" style="color: #999999;">
<view class="text-df">商家回复:</view>{{item.shopReplyMessage}}
</view>
</view>
<!-- <view class="text-lg padding-left margin-left-xl">{{dataDet.shopReplyMessage}}</view> -->
</view>
<view class="flex" style="width: 100%;margin-top: 20rpx;flex-wrap: wrap;" v-if="item.pictures">
<image @click="lookImgs(ind,item.pictures)" :src="ite" v-for="(ite,ind) in item.pictures" :key="ind" style="width: 200rpx;height: 200rpx;margin-right: 10rpx;margin-bottom: 10rpx;" mode=""></image>
</view>
</view>
<empty v-if="EvaluateList.length<=0"></empty>
<!-- 评论弹框 -->
<u-popup v-model="show" mode="bottom" border-radius="14" :closeable="closeable">
<view>
<view class="margin padding-tb">
<u-input v-model="pinglun" type="textarea" height="200" placeholder="请填写回复的内容" maxlengt="200"
:clearable="false" style="background:#F5F5F5;" />
</view>
<view class="btn" @click="bindEvaluate()">提交</view>
</view>
</u-popup>
</view>
</template>
<script>
import empty from '../../components/empty.vue'
export default {
components:{
empty
},
data() {
return {
pinglun: '',
count: 0,
show: false,
customStyle: {
color: '#333333',
background: '#FCD202',
marginRight: '20rpx',
border: 0
},
customStyle1: {
color: '#333333',
background: '#F2F2F2',
marginRight: '20rpx',
border: 0
},
cashDeposit: [],
EvaluateData: {},
EvaluateList: [],
grade: '',
page: 1,
size: 10,
isShow: false,
oneData: [],
titleData: [],
shopDet: {}
}
},
onShow() {
this.getshanghuinfo();
this.getList()
},
onReachBottom: function() {
this.page = this.page + 1;
this.getList()
},
methods: {
//预览图片
lookImgs(index,imgs){
uni.previewImage({
current:index,
urls:imgs
})
},
goShow(index){
this.orderNumber = this.EvaluateList[index].orderNumber;
this.show = true;
},
getshanghuinfo() {
let data = {
shopId: uni.getStorageSync('shopId')
}
this.$Request.get("/app/shop/selectShopMessage", data).then(res => {
if (res.code == 0) {
this.shopDet = res.data;
this.shopDet.shopScore = parseFloat(this.shopDet.shopScore).toFixed(1)
this.shopDet.shopScore1 = Math.floor(this.shopDet.shopScore)
}
});
},
//评论
bindEvaluate() {
let data = {
shopReplyMessage: this.pinglun,
orderNumber: this.orderNumber
}
this.$Request.postT("/admin/order/shopReplyEvaluate", data).then(res => {
uni.hideLoading()
if (res.code == 0) {
this.show = false
this.page = 1
this.getList()
}
});
},
sel(e) {
this.grade = e
this.count = e
this.page = 1
this.getList()
},
open(data) {
console.log(data);
this.oneData = data;
this.titleData = data.goods
this.isShow = true;
},
close() {
this.isShow = false;
},
// 获取评价列表
getList() {
let data = {
shopId: uni.getStorageSync('shopId'),
page: this.page,
limit: this.size,
grade: this.grade
}
this.$Request.get("/app/goods/selectEvaluateByShopId", data).then(res => {
if (res.code == 0 && res.data) {
this.EvaluateData = res.data
res.data.pageUtils.list.map(item=>{
if(item.pictures){
item.pictures = item.pictures.split(',')
}else{
item.pictures = []
}
})
if (this.page == 1) {
this.EvaluateList = res.data.pageUtils.list
} else {
this.EvaluateList = [...this.EvaluateList, ...res.data.pageUtils.list]
}
}
});
}
}
}
</script>
<style lang="scss">
page {
background-color: #FFFFFF;
}
.box1 {
position: absolute;
background: #000000;
width: 750rpx;
height: 100vh;
opacity: 0.4;
}
.moudes {
width: 650rpx;
position: absolute;
background: #FFFFFF;
top: 0;
left: 0;
right: 0;
bottom: 0;
margin: auto;
height: 700rpx;
border-radius: 10rpx;
.bt {
font-size: 30rpx;
font-weight: bold;
}
.pjImg {
width: 200rpx;
height: 200rpx;
}
.navBox {
.avtiter {
width: 80rpx;
height: 80rpx;
border-radius: 40rpx;
margin-right: 15rpx
}
padding-left: 30rpx;
padding-top: 30rpx;
display: flex;
align-items: center;
.userName {
font-size: 28rpx;
font-weight: bold;
}
}
}
.nrTxt {
display: inline-block;
width: 500rpx;
}
.navList {
text-align: center;
margin-top: 30rpx;
padding-left: 30rpx;
padding-right: 30rpx;
display: flex;
justify-content: center;
.xq {
font-size: 30rpx;
font-weight: bolder;
text-align: center;
}
}
.contentTxt {
view {
margin-bottom: 30rpx;
display: flex;
align-items: center;
}
.title {
font-size: 30rpx;
font-weight: bold;
color: #000000;
margin-right: 15rpx;
}
.imgRsc {
width: 100rpx;
height: 100rpx;
border-radius: 10rpx;
}
}
.list_1 {
position: absolute;
}
.btn {
width: 690upx;
height: 88upx;
margin: 30upx auto;
background: #FCD202;
box-shadow: 0px 10upx 20upx 0upx #FFD9B3;
border-radius: 16upx;
display: flex;
align-items: center;
justify-content: center;
color: #000000;
}
.one {
background: #FFFFFF;
margin-top: 20rpx;
display: flex;
justify-content: space-between;
padding: 20rpx;
.imgSrc {
width: 100rpx;
height: 100rpx;
vertical-align: middle;
margin-right: 20rpx;
border-radius: 10rpx;
}
.name {
margin-top: 10rpx;
margin-bottom: 20rpx;
font-size: 24rpx;
color: #000000;
}
.timer {
font-size: 20rpx;
color: #b3b3c4;
}
.contentTxt {
font-size: 24rpx;
color: #000000;
}
}
</style>

189
my/yhq/add.vue Normal file
View File

@@ -0,0 +1,189 @@
<template>
<view>
<view class="from flex justify-center">
<view class="from-box flex justify-center">
<view class="from-box-c">
<u-form :model="form" label-position="top" ref="uForm">
<u-form-item label="优惠券名称">
<u-input v-model="form.couponName" placeholder="请输入优惠券名称" />
</u-form-item>
<u-form-item label="有效期天数">
<u-input v-model="form.endDate" type="number" placeholder="请选择有效期天数" />
</u-form-item>
<u-form-item label="可使用订单最低金额">
<u-input v-model="form.minMoney" type="number" placeholder="请输入可使用订单最低金额" />
</u-form-item>
<!-- <u-form-item label="所需积分数">
<u-input v-model="form.needIntegral" type="number" placeholder="请输入所需积分数" />
</u-form-item> -->
<u-form-item label="优惠券金额">
<u-input v-model="form.money" type="number" placeholder="请输入优惠券金额" />
</u-form-item>
<u-form-item label="优惠券图片">
<u-upload ref="uUpload" :multiple="false" max-count="1" :action="action" @on-remove="onRemove" @on-change="onChange"></u-upload>
</u-form-item>
</u-form>
</view>
</view>
</view>
<!-- 保存 -->
<view class="button flex justify-center align-center">
<view class="button-box flex justify-center align-center" @click="sumbit()">
保存
</view>
</view>
</view>
</template>
<script>
import config from '../../common/config.js'
export default {
data() {
return {
action: 'https://tcwm.xianmaxiong.com/sqx_fast/alioss/upload',
// action: config.APIHOST+'/alioss/upload',
fileList: [],
form: {
couponName: '',
endDate: '',
minMoney: '',
// needIntegral: '',
money: '',
shopId: uni.getStorageSync('shopId'),
couponPicture: '',
},
};
},
methods: {
onRemove(e){
this.form.couponPicture = ''
},
onChange(e){
if(e.data){
let obj = JSON.parse(e.data)
if(obj.code!=0){
uni.showToast({
title:'上传失败,请重新上传!',
icon:'none'
})
this.$refs.uUpload.clear()
}else{
this.form.couponPicture = obj.data
}
}else{
uni.showToast({
title:'上传失败,请重新上传!',
icon:'none'
})
this.$refs.uUpload.clear()
}
},
//提交
sumbit(){
if(!this.form.couponName){
uni.showToast({
title:'请输入优惠券名称',
icon:'none'
})
return
}
if(!this.form.endDate){
uni.showToast({
title:'请输入有效期天数',
icon:'none'
})
return
}
if(!this.form.minMoney){
uni.showToast({
title:'请输入可使用订单最低金额',
icon:'none'
})
return
}
// if(!this.form.needIntegral){
// uni.showToast({
// title:'请输入所需积分数',
// icon:'none'
// })
// return
// }
if(!this.form.money){
uni.showToast({
title:'请输入优惠券金额',
icon:'none'
})
return
}
if(!this.form.couponPicture){
uni.showToast({
title:'请上传优惠券图片',
icon:'none'
})
return
}
uni.showLoading({
title:'提交中...'
})
this.$Request.postJson("/admin/coupon/issueCoupon", this.form).then(res => {
if (res.code == 0) {
uni.showToast({
title:'发布成功'
})
setTimeout(()=>{
uni.navigateBack()
},1000)
}else{
uni.showToast({
title:res.msg,
icon:'none'
})
}
uni.hideLoading()
});
},
},
}
</script>
<style lang="scss">
.from {
width: 100%;
height: auto;
margin-top: 30rpx;
.from-box {
width: 686rpx;
height: 100%;
border-radius: 16rpx;
background-color: #ffffff;
.from-box-c {
width: 646rpx;
}
}
}
.button {
width: 100%;
height: 120rpx;
background-color: rgb(241, 241, 241);
position: fixed;
bottom: 0;
z-index: 999;
.button-box {
width: 686rpx;
height: 80rpx;
border-radius: 40rpx;
background-color: #FCD202;
}
}
</style>

207
my/yhq/edit.vue Normal file
View File

@@ -0,0 +1,207 @@
<template>
<view>
<view class="from flex justify-center">
<view class="from-box flex justify-center">
<view class="from-box-c">
<u-form :model="form" label-position="top" ref="uForm">
<u-form-item label="优惠券名称">
<u-input v-model="form.couponName" placeholder="请输入优惠券名称" />
</u-form-item>
<u-form-item label="有效期天数">
<u-input v-model="form.endDate" type="number" placeholder="请选择有效期天数" />
</u-form-item>
<u-form-item label="可使用订单最低金额">
<u-input v-model="form.minMoney" type="number" placeholder="请输入可使用订单最低金额" />
</u-form-item>
<!-- <u-form-item label="所需积分数">
<u-input v-model="form.needIntegral" type="number" placeholder="请输入所需积分数" />
</u-form-item> -->
<u-form-item label="优惠券金额">
<u-input v-model="form.money" type="number" placeholder="请输入优惠券金额" />
</u-form-item>
<u-form-item label="优惠券图片">
<u-upload ref="uUpload" :file-list="fileList" :multiple="false" max-count="1" :action="action" @on-remove="onRemove" @on-change="onChange"></u-upload>
</u-form-item>
</u-form>
</view>
</view>
</view>
<!-- 保存 -->
<view class="button flex justify-center align-center">
<view class="button-box flex justify-center align-center" @click="sumbit()">
保存
</view>
</view>
</view>
</template>
<script>
import config from '../../common/config.js'
export default {
data() {
return {
action: 'https://tcwm.xianmaxiong.com/sqx_fast/alioss/upload',
// action: config.APIHOST+'/alioss/upload',
fileList: [],
form: {
couponId:'',
couponName: '',
endDate: '',
minMoney: '',
// needIntegral: '',
money: '',
shopId: uni.getStorageSync('shopId'),
couponPicture: '',
},
};
},
onLoad(option) {
let info = JSON.parse(option.info)
this.fileList = [
{url:info.couponPicture}
]
this.form = {
couponId:info.couponId,
couponName: info.couponName,
endDate: info.endDate,
minMoney: info.minMoney,
// needIntegral: info.needIntegral,
money: info.money,
shopId: uni.getStorageSync('shopId'),
couponPicture: info.couponPicture,
},
console.log(this.form)
},
methods: {
onRemove(e){
this.form.couponPicture = ''
},
onChange(e){
if(e.data){
let obj = JSON.parse(e.data)
if(obj.code!=0){
uni.showToast({
title:'上传失败,请重新上传!',
icon:'none'
})
this.$refs.uUpload.clear()
}else{
this.form.couponPicture = obj.data
}
}else{
uni.showToast({
title:'上传失败,请重新上传!',
icon:'none'
})
this.$refs.uUpload.clear()
}
},
//提交
sumbit(){
if(!this.form.couponName){
uni.showToast({
title:'请输入优惠券名称',
icon:'none'
})
return
}
if(!this.form.endDate){
uni.showToast({
title:'请输入有效期天数',
icon:'none'
})
return
}
if(!this.form.minMoney){
uni.showToast({
title:'请输入可使用订单最低金额',
icon:'none'
})
return
}
// if(!this.form.needIntegral){
// uni.showToast({
// title:'请输入所需积分数',
// icon:'none'
// })
// return
// }
if(!this.form.money){
uni.showToast({
title:'请输入优惠券金额',
icon:'none'
})
return
}
if(!this.form.couponPicture){
uni.showToast({
title:'请上传优惠券图片',
icon:'none'
})
return
}
uni.showLoading({
title:'提交中...'
})
this.$Request.postJson("/admin/coupon/updateCoupon", this.form).then(res => {
if (res.code == 0) {
uni.showToast({
title:'修改成功'
})
setTimeout(()=>{
uni.navigateBack()
},1000)
}else{
uni.showToast({
title:res.msg,
icon:'none'
})
}
uni.hideLoading()
});
},
},
}
</script>
<style lang="scss">
.from {
width: 100%;
height: auto;
margin-top: 30rpx;
.from-box {
width: 686rpx;
height: 100%;
border-radius: 16rpx;
background-color: #ffffff;
.from-box-c {
width: 646rpx;
}
}
}
.button {
width: 100%;
height: 120rpx;
background-color: rgb(241, 241, 241);
position: fixed;
bottom: 0;
z-index: 999;
.button-box {
width: 686rpx;
height: 80rpx;
border-radius: 40rpx;
background-color: #FCD202;
}
}
</style>

186
my/yhq/yhq.vue Normal file
View File

@@ -0,0 +1,186 @@
<template>
<view>
<view class="list flex justify-center flex-wrap">
<view class="list-box flex justify-center flex-wrap" v-for="(item,index) in couponList" :key="index">
<view class="yhq-box-list-item" >
<view class="yhq-box-list-item-t flex align-center justify-between" style="border-bottom: 1px dashed #e5e5e5;padding-bottom: 26rpx;">
<view class="yhq-box-list-item-t-l flex align-center">
<image :src="item.couponPicture?item.couponPicture:'../../static/logo.png'" style="width: 120rpx;height: 120rpx;border-radius: 16rpx;" mode=""></image>
<view class="" style="margin-left: 20rpx;">
<view class="" style="font-weight: bold;">
<text>{{item.couponName}}</text>{{item.minMoney}}元使用
</view>
<view class="" style="color: gray;font-size: 24rpx;margin-top: 10rpx;">
购买后{{item.endDate}}天内使用
</view>
</view>
</view>
<view class="yhq-box-list-item-t-r" style="font-size: 32rpx;color: red;">
<text style="font-size: 24rpx;font-weight: bold;">¥</text>
{{item.money}}
</view>
</view>
<view class="yhq-box-list-item-b flex justify-end align-center" style="margin-top: 26rpx;">
<view class="" @click="updata(1,item)" style="padding: 5rpx 20rpx 5rpx 20rpx;border-radius: 24rpx;border: 1rpx solid gray;color: gray;">
编辑
</view>
<view class="" @click="updata(2,item)" style="padding: 5rpx 20rpx 5rpx 20rpx;border-radius: 24rpx;border: 1rpx solid red;color: red;margin-left: 20rpx;">
删除
</view>
</view>
</view>
</view>
<u-loadmore :status="status" :icon-type="iconType" :load-text="loadText" />
</view>
<!-- 添加优惠券 -->
<view class="button flex justify-center align-center">
<view class="button-box flex justify-center align-center" @click="gotoAdd()">
添加优惠券
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
couponList: [],
couponLists: [],
limit: 10,
page: 1,
status: 'loadmore',
iconType: 'flower',
loadText: {
loadmore: '轻轻上拉',
loading: '努力加载中',
nomore: '实在没有了'
},
};
},
onPullDownRefresh() {
this.page = 1
this.getList()
},
onReachBottom() {
if(this.couponLists.length==10){
this.page += 1
this.status = 'loading'
this.getList()
}else{
this.status = 'nomore'
}
},
onShow() {
this.page = 1
this.getList()
},
onLoad() {
this.getList()
},
methods: {
//1:编辑 2删除
updata(type,item){
if(type==1){
uni.navigateTo({
url:'./edit?info='+JSON.stringify(item)
})
}else{
let that = this
uni.showModal({
title:'提示',
content:'是否删除该优惠券?',
complete(ret) {
if(ret.confirm){
let data = {
couponId:item.couponId
}
that.$Request.postT("/admin/coupon/deleteCoupon", data).then(res => {
if (res.code == 0) {
uni.showToast({
title:'已删除'
})
that.page = 1
that.getList()
}else{
uni.showToast({
title:res.msg,
icon:'none'
})
}
});
}
}
})
}
},
//添加优惠券
gotoAdd(){
uni.navigateTo({
url:'./add'
})
},
//优惠券列表
getList() {
let data = {
shopId: uni.getStorageSync('shopId')
}
this.$Request.get("/admin/coupon/seleteAllCoupon", data).then(res => {
if (res.code == 0) {
this.couponLists = res.data
if (this.page == 1) {
this.couponList = res.data
} else {
this.couponList = [...this.couponList, ...res.data]
}
}
uni.stopPullDownRefresh()
});
}
}
}
</script>
<style lang="scss">
.list {
width: 100%;
// height: 500rpx;
margin-top: 20rpx;
padding-bottom: 200rpx;
.list-box {
width: 686rpx;
height: 100%;
border-radius: 16rpx;
background-color: #ffffff;
margin-bottom: 20rpx;
.yhq-box-list-item {
width: 646rpx;
// background-color: red;
padding: 20rpx 0 20rpx 0;
}
}
}
.button {
width: 100%;
height: 140rpx;
background-color: rgb(241, 241, 241);
position: fixed;
bottom: 0;
z-index: 999;
.button-box {
width: 686rpx;
height: 80rpx;
background-color: #FCD202;
border-radius: 40rpx;
}
}
</style>

313
pages.json Normal file
View File

@@ -0,0 +1,313 @@
{
"easycom": {
"^u-(.*)": "@/uview-ui/components/u-$1/u-$1.vue"
},
"pages": [ //pages数组中第一项表示应用启动页参考https://uniapp.dcloud.io/collocation/pages
{
"path": "pages/index/index",
"style": {
"navigationBarTitleText": "首页"
}
},
{
"path": "pages/order/index",
"style": {
"navigationBarTitleText": "订单中心"
}
},
{
"path": "pages/order/orderDet",
"style": {
"navigationBarTitleText": "订单详情"
}
},
{
"path": "pages/order/orderMap",
"style": {
"navigationBarTitleText": "骑手位置"
}
},
{
"path": "pages/my/index",
"style": {
"navigationBarTitleText": "我的"
}
},
{
"path": "pages/my/chat",
"style": {
"navigationBarTitleText": "联系客服"
}
}, {
"path": "pages/my/liaotian",
"style": {
"navigationBarTitleText": "聊天中心"
}
},
{
"path": "pages/my/im",
"style": {
"navigationBarTitleText": "聊天室"
}
},
{
"path": "pages/my/earnings",
"style": {
"navigationBarTitleText": "收益统计"
}
},
{
"path": "pages/my/comments",
"style": {
"navigationBarTitleText": "投诉"
}
},
{
"path": "pages/my/userinfo",
"style": {
"navigationBarTitleText": "用户信息"
}
}, {
"path": "pages/my/pwd",
"style": {
"navigationBarTitleText": "修改密码"
}
}, {
"path": "pages/my/forgetPwd",
"style": {
"navigationBarTitleText": "忘记密码"
}
}, {
"path": "pages/my/phoneSettled",
"style": {
"navigationBarTitleText": "商户信息修改"
}
},
{
"path": "pages/my/loginphone",
"style": {
"navigationBarTitleText": "登录"
}
}
],
"subPackages": [{
"root": "my",
"pages": [{
"path": "publish/index",
"style": {
"navigationBarTitleText": "商家入驻"
}
}, {
"path": "publish/guigeitem",
"style": {
"navigationBarTextStyle": "black",
"navigationBarTitleText": "商品属性",
"enablePullDownRefresh": false
}
},
{
"path": "store/index",
"style": {
"navigationBarTitleText": "店铺管理"
}
}, {
"path": "store/addgood",
"style": {
"navigationBarTitleText": "商品管理"
}
}, {
"path": "store/pingjia",
"style": {
"navigationBarTitleText": "店铺评价"
}
}, {
"path": "publish/goods",
"style": {
"navigationBarTitleText": "商品发布"
}
}, {
"path": "store/goodDetail",
"style": {
"navigationBarTitleText": "商品详情"
}
}, {
"path": "store/guige",
"style": {
"navigationBarTitleText": "商品规格"
}
}, {
"path": "store/fenlei",
"style": {
"navigationBarTitleText": "分类管理"
}
}, {
"path": "store/editor",
"style": {
"navigationBarTitleText": "规格编辑"
}
}, {
"path": "other/money",
"style": {
"navigationBarTitleText": "保证金"
}
}, {
"path": "other/detail",
"style": {
"navigationBarTitleText": "投诉详情"
}
},{
"path": "other/set",
"style": {
"navigationBarTitleText": "系统设置"
}
}, {
"path": "other/xieyi",
"style": {
"navigationBarTitleText": "用户协议"
}
}, {
"path": "other/mimi",
"style": {
"navigationBarTitleText": "隐私政策"
}
}, {
"path": "other/help",
"style": {
"navigationBarTitleText": "帮助中心"
}
}, {
"path": "other/helpDet",
"style": {
"navigationBarTitleText": "帮助中心"
}
}, {
"path": "other/tousu",
"style": {
"navigationBarTitleText": "我的投诉"
}
}, {
"path": "other/moneylist",
"style": {
"navigationBarTitleText": "保证金明细"
}
}, {
"path": "other/customer",
"style": {
"navigationBarTitleText": "联系客服"
}
}, {
"path": "other/about",
"style": {
"navigationBarTitleText": "关于我们"
}
}, {
"path": "feedback/index",
"style": {
"navigationBarTitleText": "意见反馈"
}
}, {
"path": "other/wallet",
"style": {
"navigationBarTitleText": "我的钱包"
}
}, {
"path": "other/zhifubao",
"style": {
"navigationBarTitleText": "提现账号"
}
}, {
"path": "other/cashList",
"style": {
"navigationBarTitleText": "钱包明细",
"enablePullDownRefresh": true
}
}, {
"path": "other/moneydetail",
"style": {
"navigationBarTitleText": "提现记录"
}
}, {
"path": "other/cashDetail",
"style": {
"navigationBarTitleText": "提现"
}
}
,{
"path" : "store/huodong",
"style" :
{
"navigationBarTitleText": "精选活动",
"enablePullDownRefresh": true
}
}
,{
"path" : "store/hdInfo",
"style" :
{
"navigationBarTitleText": "活动详情",
"enablePullDownRefresh": false
}
}
,{
"path" : "yhq/yhq",
"style" :
{
"navigationBarTitleText": "店铺优惠券",
"enablePullDownRefresh": true
}
}
,{
"path" : "yhq/add",
"style" :
{
"navigationBarTitleText": "添加优惠券",
"enablePullDownRefresh": false
}
}
,{
"path" : "yhq/edit",
"style" :
{
"navigationBarTitleText": "修改优惠券",
"enablePullDownRefresh": false
}
}
]
}],
"tabBar": {
"color": "#666666",
"selectedColor": "#FCD202",
"borderStyle": "black",
"backgroundColor": "#ffffff",
"list": [{
"pagePath": "pages/index/index",
"iconPath": "static/images/tabbar/index.png",
"selectedIconPath": "static/images/tabbar/index_.png",
"text": "首页"
},
{
"pagePath": "pages/order/index",
"iconPath": "static/images/tabbar/order.png",
"selectedIconPath": "static/images/tabbar/order_.png",
"text": "订单"
},
{
"pagePath": "pages/my/index",
"iconPath": "static/images/tabbar/my.png",
"selectedIconPath": "static/images/tabbar/my_.png",
"text": "我的"
}
]
},
"globalStyle": {
"navigationBarTextStyle": "black",
"navigationBarTitleText": "同城外卖",
"navigationBarBackgroundColor": "#FFFFFF",
"backgroundColor": "#FFFFFF"
}
}

770
pages/index/index.vue Normal file
View File

@@ -0,0 +1,770 @@
<template>
<view style="padding-bottom: 80upx;">
<view class=" u-flex padding-lr bg padding-top">
<view class="u-m-r-10">
<image :src="avatar" style="width: 100rpx;height: 100rpx;border-radius: 100rpx;"
@click="goNav('/my/store/index')"></image>
</view>
<view class="u-flex-1 u-m-l-10" v-if="!isLogin">
<view class="u-font-18 text-bold">
<view class="margin-left-sm margin-top-xs">
<view class="flex align-end">{{userName}}
<view class="margin-left-sm" v-if="shop" @click="changePutaWayFlag">
<image
:src="shop.putawayFlag==0?'../../static/images/index/shangban.png':'../../static/images/index/dayang.png'"
style="width: 30rpx;height: 30rpx;"></image>
</view>
<!-- <view>
<image src="../../static/images/index/dayang.png" style="width: 30rpx;height: 30rpx;"></image>
</view> -->
</view>
<!-- <text @click="changePutaWayFlag"
:style="shop.putawayFlag==0?'margin-left: 16upx;font-size: 28upx;color: #E10A07;':'margin-left: 16upx;font-size: 28upx;color: #999999;'"
v-if="shop">{{shop.putawayFlag==0?'上班中':'打烊啦'}}
</text> -->
</view>
</view>
</view>
<view v-else class="text-xl u-p-l-20 text-bold" @click="goLogin('/pages/my/loginphone')">
登录
</view>
</view>
<view class="flex align-center padding-left">
<image src="../../static/images/img/data.png" style="width: 26upx;height: 26upx;"></image>
<view class="margin-left-xs flex align-center" style="color: #999999;">
<view @click="bindData(1)">{{startTime?startTime:'开始时间'}}</view>
<view @click="bindData(2)">{{endTime?endTime:'结束时间'}}</view>
</view>
</view>
<view class="flex align-center box justify-between text-center">
<view @click="goNav('/my/other/cashList')">
<text class="text-bold text-xl">{{allMoney?allMoney:'0'}}</text>
<view>总收益</view>
</view>
<view class="">
<text class="text-bold text-xl">{{allCount?allCount:'0'}}</text>
<view>总销量</view>
</view>
<view @click="goNav('/my/store/pingjia')">
<text class="text-bold text-xl">{{countTakingByUserId?countTakingByUserId:'0'}}</text>
<view>用户评价</view>
</view>
<!-- <view class="">
<text class="text-bold text-xl">{{putaway+soldOut}}</text>
<view>用户发布</view>
</view> -->
</view>
<view class="padding">
<view class="text-bold text-lg margin-bottom-sm">订单数据</view>
<view class="orderbox ">
<view class="">
<text class="text-bold text-xl">{{orderMoney?orderMoney:'0'}}</text>
<view class="margin-top-xs">订单收入</view>
</view>
<view class="">
<text class="text-bold text-xl">{{sumCountOrder?sumCountOrder:'0'}}</text>
<view class="margin-top-xs">总订单数</view>
</view>
<view class="">
<text class="text-bold text-xl">{{refundMoney?refundMoney:'0'}}</text>
<view class="margin-top-xs">退款金额</view>
</view>
<view class="">
<text class="text-bold text-xl">{{countByUserId?countByUserId:'0'}}</text>
<view class="margin-top-xs">访客人数</view>
</view>
</view>
</view>
<view style="padding: 0upx 30upx;">
<view class="text-bold text-lg margin-bottom-sm flex justify-between">
<view>订单管理</view>
<view @click="goDetail(1)">
<text style="color: #666666;font-size: 26upx;margin-right: 10upx;">查看全部</text>
<image src="../../static/images/my/right.png" style="width: 12upx;height: 20upx;"></image>
</view>
</view>
<view class="orderbox ">
<!-- <view class="">
<text class="text-bold text-xl">{{i1}}</text>
<view class="margin-top-xs">待付款</view>
</view> -->
<view class="">
<text class="text-bold text-xl">{{i5}}</text>
<view class="margin-top-xs">待接单</view>
</view>
<view class="">
<text class="text-bold text-xl">{{i2}}</text>
<view class="margin-top-xs">制作中</view>
</view>
<view class="">
<text class="text-bold text-xl">{{i3}}</text>
<view class="margin-top-xs">待取餐</view>
</view>
<view class="">
<text class="text-bold text-xl">{{i4}}</text>
<view class="margin-top-xs">已完成</view>
</view>
</view>
</view>
<view class="padding">
<view class="text-bold text-lg margin-bottom-sm flex justify-between">
<view>我的商品</view>
<view @click="goDetail(2)">
<text style="color: #666666;font-size: 26upx;margin-right: 10upx;">查看全部</text>
<image src="../../static/images/my/right.png" style="width: 12upx;height: 20upx;"></image>
</view>
</view>
<view class="orderbox ">
<view class="">
<text class="text-bold text-xl">{{putawayCount}}</text>
<view class="margin-top-sm">上架中</view>
</view>
<view class="">
<text class="text-bold text-xl">{{soldoutCount}}</text>
<view class="margin-top-sm">已下架</view>
</view>
<view @click="bindFb()">
<image src="../../static/images/index/add.png" style="width: 46upx;height: 46upx;"></image>
<view class="margin-top-xs">添加商品</view>
</view>
</view>
</view>
<u-popup v-model="Authorization" mode="center" close-icon="close-circle" close-icon-pos="top-right"
close-icon-color="#8f9298" close-icon-size="50">
<view class="contentview">
<view class="title">隐私保护指引</view>
<view class="des" @click="openPrivacyContract">
在使用当前小程序服务之前请仔细阅读<text
style="color: #FF7F00;">{{privacyContractName}}</text>如你同意{{privacyContractName}}请点击同意开始使用
</view>
<view class="btns">
<button class="item reject" @click="exitMiniProgram">拒绝</button>
<button id="agree-btn" class="item agree" open-type="agreePrivacyAuthorization"
@agreeprivacyauthorization="handleAgreePrivacyAuthorization">同意</button>
</view>
</view>
</u-popup>
<!-- 开始时间 -->
<u-picker v-model="startshow" mode="time" :params="paramsStart" @confirm="startData"></u-picker>
<!-- 结束时间 -->
<u-picker v-model="endshow" mode="time" :params="paramsEnd" @confirm="endData"></u-picker>
</view>
</template>
<script>
export default {
data() {
return {
Authorization: false,
privacyContractName: '',
avatar: '../../static/logo.png',
isLogin: true,
userName: '匿名',
startshow: false,
endshow: false,
paramsStart: {
year: true,
month: true,
day: true,
hour: false,
minute: false,
second: false
},
paramsEnd: {
year: true,
month: true,
day: true,
hour: false,
minute: false,
second: false
},
startTime: '',
endTime: '',
allMoney: 0, //总收益
allCount: 0, //总销量
countTakingByUserId: 0, //用户评价数
orderMoney: 0, //订单收入
sumCountOrder: 0, //总订单数
refundMoney: 0, //退款金额
countByUserId: 0, //访客人数
i1: 0, //待付款
i2: 0, //制作中
i3: 0, //待取餐
i4: 0, //已完成
i5: 0, //商家待接单
putawayCount: 0, //上架中
soldoutCount: 0, //下架中
page: 1,
limit: 10,
longitude: '',
latitude: '',
userId: '',
shop: '',
arr:[],
errCount: 0
}
},
onLoad() {
this.userId = uni.getStorageSync('userId')
if (this.userId) {
this.getFb()
}
this.$Request.getT('/app/common/type/354').then(res => { //订单取消通知
if (res.code == 0) {
if (res.data && res.data.value) {
this.arr.push(res.data.value)
}
}
})
this.$Request.getT('/app/common/type/353').then(res => { //订单取消通知
if (res.code == 0) {
if (res.data && res.data.value) {
this.arr.push(res.data.value)
}
}
})
this.$Request.getT('/app/common/type/352').then(res => { //新订单通知
if (res.code == 0) {
if (res.data && res.data.value) {
this.arr.push(res.data.value)
}
}
})
// #ifdef MP-WEIXIN
try {
let that = this;
wx.getPrivacySetting({
success: res => {
console.log("是否需要授权:", res.needAuthorization, "隐私协议的名称为:", res.privacyContractName)
if (res.needAuthorization) {
that.privacyContractName = res.privacyContractName;
// this.$refs.popusAuthorization.open();
that.Authorization = true;
}
},
fail: () => {},
complete: () => {},
})
} catch (e) {
//TODO handle the exception
}
// #endif
},
onShow() {
this.userId = uni.getStorageSync('userId')
if (this.userId) {
this.isLogin = false
this.getUserInfo()
this.getFb()
// this.getTodayOrder()
this.getcity()
this.getShopInfo();
// #ifdef MP-WEIXIN
//订阅
if (!uni.getStorageSync('sendindexMsg')) {
this.openMsg();
}
// #endif
} else {
this.isLogin = true
// this.userName = '匿名'
this.avatar = '../../static/logo.png'
this.allMoney = 0 //总收益
this.putawayCount = 0 //上架中
this.soldoutCount = 0 //下架中
this.allCount = 0 //总销量
this.countTakingByUserId = 0 //用户评价
this.orderMoney = 0 //订单收入
this.sumCountOrder = 0 //总订单数
this.refundMoney = 0 //退款金额
this.countByUserId = 0 //访客人数
this.i1 = 0 //待付款
this.i3 = 0 //待取餐
this.i2 = 0 //制作中
this.i4 = 0 //已完成
this.i5 = 0 //商家待接单
}
let that = this
if (that.userId) {
setInterval(function() {
// 订单消息提醒
// newsSelect() {
let data = {
shopIds: that.$queue.getData("shopId")
}
that.$Request.post('/admin/ordermessage/selectReadFlagCount', data).then(res => {
if (res.code === 0) {
// that.errCount = res.data
if (res.data > 0) {
if (that.errCount != res.data) {
that.errCount = res.data
that.aplayAudio()
uni.showModal({
title: '消息',
content: '有' + res.data + '条订单,请前往订单中心处理。',
success: (ret) => {
if (ret.confirm) {
uni.switchTab({
url: '/pages/order/index'
})
} else {
console.log('else', ret)
that.defineCallBack()
}
}
});
// this.chatNum = data.data
}
} else {
that.errCount = 0
}
}
});
}, 10000)
}
},
methods: {
// 打开隐私协议页面
openPrivacyContract() {
let that = this;
wx.openPrivacyContract({
fail: () => {
that.$queue.showToast('遇到错误无法打开!');
}
})
},
// 拒绝隐私协议
exitMiniProgram() {
// 直接退出小程序
wx.exitMiniProgram()
},
// 同意隐私协议
handleAgreePrivacyAuthorization() {
this.Authorization = false;
},
openMsg() {
var that = this
wx.getSetting({
withSubscriptions: true, //是否获取用户订阅消息的订阅状态默认false不返回
success(ret) {
if (ret.subscriptionsSetting.itemSettings) {
uni.setStorageSync('sendindexMsg', true)
uni.openSetting({ // 打开设置页
success(rea) {
console.log(rea.authSetting)
}
});
} else { // 用户没有点击“总是保持以上,不再询问”则每次都会调起订阅消息
uni.setStorageSync('sendindexMsg', false)
uni.showModal({
title: '提示',
content: '为了更好的体验,请绑定消息推送',
confirmText: '确定',
cancelText: '取消',
success: function(res) {
if (res.confirm) {
uni.requestSubscribeMessage({
tmplIds: that.arr,
success(re) {
// console.log(re,'**********')
var datas = JSON.stringify(re);
if (datas.indexOf("accept") != -1) {
console.log(re)
}
},
fail: (res) => {
console.log(res)
}
})
that.showModal = false
} else if (res.cancel) {
that.showModal = true
}
}
})
}
}
})
},
//切换店铺状态
changePutaWayFlag() {
if (this.shop.putawayFlag == 0) {
uni.showModal({
title: '提示',
content: '确定要打烊了吗?',
showCancel: true,
cancelText: '取消',
confirmText: '确定',
success: res => {
if (res.confirm) {
this.shop.putawayFlag = 1
this.updateShopInfo();
}
},
fail: () => {},
complete: () => {}
});
} else {
this.shop.putawayFlag = 0
this.updateShopInfo();
}
},
updateShopInfo() {
this.$Request.postJsonA("/app/shop/updateShopMessage", this.shop).then(res => {
if (res.code == 0) {
this.getShopInfo()
} else {
this.shop.putawayFlag = 1
uni.showToast({
title: res.msg,
icon: 'none'
})
}
});
},
getShopInfo() {
if (this.$queue.getData('shopId')) {
let data = {
shopId: this.$queue.getData('shopId')
}
this.$Request.getA("/app/shop/selectShopMessage", data).then(res => {
if (res.code == 0) {
uni.hideLoading()
this.shop = res.data
}
});
}
},
aplayAudio() {
// const audio = document.getElementById('audio')
// audio.play()
// console.log('语音提示')
const innerAudioContext = uni.createInnerAudioContext();
innerAudioContext.autoplay = true;
// innerAudioContext.src ='../../static/mpc/order.mp3';
innerAudioContext.src =
'https://pw.xianmxkj.com/file/uploadPath/2022/01/19/0753211f78d718d44ee6372e33eae9ee.mp3';
innerAudioContext.onPlay(() => {
console.log('开始播放');
});
innerAudioContext.onError((res) => {
console.log(res.errMsg);
console.log(res.errCode);
});
},
defineCallBack() {
let that = this
let data = {
shopIds: that.$queue.getData("shopId")
}
that.$Request.post('/admin/ordermessage/allcheckOrderMessage', data).then(res => {
if (res.code === 0) {
that.errCount = 0
}
});
},
getcity() {
let that = this
uni.getLocation({
type: 'wgs84',
success: function(res) {
// console.log('当前位置的经度:' + res.longitude);
// console.log('当前位置的纬度:' + res.latitude);
that.latitude = res.latitude
that.longitude = res.longitude
}
});
},
//获取用户发布
getFb() {
let data = {
startTime: this.startTime,
endTime: this.endTime,
shopId: this.$queue.getData("shopId")
}
this.$Request.getA("/app/shop/shopHomePage", data).then(res => {
if (res.code == 0) {
this.allMoney = res.data.allMoney //总收益
this.putawayCount = res.data.putawayCount //上架中
this.soldoutCount = res.data.soldoutCount //下架中
this.allCount = res.data.allCount //总销量
this.countTakingByUserId = res.data.countTakingByUserId //用户评价
this.orderMoney = res.data.orderMoney //订单收入
this.sumCountOrder = res.data.sumCountOrder //总订单数
this.refundMoney = res.data.refundMoney //退款金额
this.countByUserId = res.data.countByUserId //访客人数
this.i1 = res.data.i1 //待付款
this.i3 = res.data.i3 //待取餐
this.i2 = res.data.i2 //制作中
this.i4 = res.data.i4 //已完成
this.i5 = res.data.i5 //商家待接单
}
})
},
goDetail(index) {
// #ifdef MP-WEIXIN
if (uni.getStorageSync('sendindexMsg')) {
uni.requestSubscribeMessage({
tmplIds: this.arr,
success(re) {
// console.log(re,'**********')
var datas = JSON.stringify(re);
if (datas.indexOf("accept") != -1) {
console.log(re)
}
},
fail: (res) => {
console.log(res)
}
})
}
// #endif
if (index == 1) {
uni.switchTab({
url: '/pages/order/index'
})
} else if (index == 2) {
uni.navigateTo({
url: '/my/store/addgood'
})
}
},
bindFb() {
let userId = uni.getStorageSync('userId')
if (userId) {
uni.navigateTo({
url: '/my/publish/goods'
})
} else {
uni.showModal({
title: '提示',
content: '您还未登录,请先登录',
success: function(res) {
if (res.confirm) {
// console.log('用户点击确定');
uni.navigateTo({
url: '/pages/my/loginphone'
})
} else if (res.cancel) {
// console.log('用户点击取消');
}
}
})
}
},
//时间弹框开关
bindData(index) {
if (index == 1) {
this.startshow = true
} else if (index == 2) {
this.endshow = true
}
},
//开始时间
startData(e) {
this.startTime = e.year + '-' + e.month + '-' + e.day
},
// 结束时间
endData(e) {
this.endTime = e.year + '-' + e.month + '-' + e.day
this.getFb()
},
goNav(e, name) {
if (this.userId) {
// #ifdef MP-WEIXIN
if (uni.getStorageSync('sendindexMsg')) {
uni.requestSubscribeMessage({
tmplIds: this.arr,
success(re) {
// console.log(re,'**********')
var datas = JSON.stringify(re);
if (datas.indexOf("accept") != -1) {
console.log(re)
}
},
fail: (res) => {
console.log(res)
}
})
}
// #endif
uni.navigateTo({
url: e
})
} else {
uni.showModal({
title: '提示',
content: '您还未登录,请先登录',
success: function(res) {
if (res.confirm) {
console.log('用户点击确定');
uni.navigateTo({
url: '/pages/my/loginphone'
})
} else if (res.cancel) {
console.log('用户点击取消');
}
}
})
}
},
getUserInfo() {
this.$Request.getA("/sys/user/info").then(res => {
if (res.code == 0) {
// this.userName = res.user.userEntity.userName
this.userName = res.user.shopList[0].shopName
// this.avatar = res.user.userEntity.avatar ? res.user.userEntity.avatar : '../../static/logo.png'
this.avatar = res.user.shopList[0].shopCover ? res.user.shopList[0].shopCover :
'../../static/logo.png'
this.$queue.setData("userId", res.user.userId);
this.$queue.setData("shopId", res.user.shopList[0].shopId);
this.$queue.setData("mobile", res.user.mobile);
if (res.user.userEntity) {
this.$queue.setData("shopUserName", res.user.userEntity.userName);
}
}
});
},
goLogin(e) {
uni.navigateTo({
url: e
})
},
}
}
</script>
<style lang="scss">
page {
background-color: #FFFFFF;
}
.bg {
background-color: #FFFFFF;
}
.box {
width: 690upx;
margin: 0 auto;
height: 120rpx;
background: #FCD202;
border-radius: 16upx 16upx 0px 0px;
color: #333333;
padding: 0upx 30upx;
margin-top: 20upx;
}
.orderbox {
width: 690upx;
margin: 0 auto;
height: 153upx;
background: #FAFAFA;
border-radius: 16upx;
display: flex;
align-items: center;
justify-content: space-between;
text-align: center;
padding: 0upx 30upx;
}
.privacy {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
background: rgba(0, 0, 0, .5);
z-index: 9999999;
display: flex;
align-items: center;
justify-content: center;
}
.contentview {
width: 632rpx;
padding: 48rpx;
box-sizing: border-box;
background: #fff;
border-radius: 16rpx;
}
.contentview .title {
text-align: center;
color: #333;
font-weight: bold;
font-size: 32rpx;
}
.contentview .des {
font-size: 26rpx;
color: #666;
margin-top: 40rpx;
text-align: justify;
line-height: 1.6;
}
.contentview .des .link {
color: #07c160;
text-decoration: underline;
}
button::after {
border: none;
}
.btns {
margin-top: 48rpx;
display: flex;
}
.btns .item {
justify-content: space-between;
width: 244rpx;
height: 80rpx;
display: flex;
align-items: center;
justify-content: center;
border-radius: 16rpx;
box-sizing: border-box;
border: none;
}
.btns .reject {
background: #f4f4f5;
color: #909399;
}
.btns .agree {
background: #07c160;
color: #fff;
}
</style>

643
pages/my/chat.vue Normal file
View File

@@ -0,0 +1,643 @@
<template>
<view>
<view style="width: 100%;padding-bottom: 140rpx;">
<view style="display: flex;flex-direction: column;" v-for="(item,index) in ListItem" :key='index' >
<view style="margin-top: 15rpx;width: 100%;text-align: center;font-size: 26rpx;color: #999999;">
{{item.createTime}}</view>
<view v-if="item.sendType === 2" style="width: 83%;margin-right: 15%;">
<view class="chat-listitem" style="float: left;margin-left: 10rpx;">
<view>
<image src="../../static/images/img/kefu.png" class="chat-listitem-image"></image>
</view>
<view v-if="item.content && item.type === 1" class="chat-listitem-text"
style="margin-left: 20rpx;">{{item.content}}</view>
<image @tap="viewImg(item.content)" v-if="item.content && item.type === 2" :src="item.content"
style="height: 200rpx;width: 200rpx;margin-left: 20rpx;"></image>
</view>
</view>
<view v-if="item.sendType === 1" style="width: 83%;margin-left: 15%;">
<view class="chat-listitem" style="float: right;">
<view v-if="item.content && item.type === 1" @longpress="copy(item.content)"
class="chat-listitem-text" style="margin-right: 20rpx;">{{item.content}}</view>
<view v-if="item.content && item.type === 4" @click="goShop(item.content[3])"
style="width: 400rpx;background: #FFFFFF;height: max-content;margin-right: 20rpx;margin-top: 10rpx;border-radius: 20rpx;">
<image :src="item.content[0]" class="chat-listitem-image-type4"
style="width: 400rpx;height: 350rpx;"></image>
<view style="padding: 10rpx;padding-bottom: 20rpx;">
<view style="color: #ed5732;font-size: 34rpx;"><text style="font-size: 22rpx;"> </text>
{{item.content[2]}}</view>
<view
style="overflow: hidden;text-overflow: ellipsis;display: -webkit-box;-webkit-line-clamp: 2;-webkit-box-orient: vertical;width: 100%;height: 75upx;">
{{item.content[1]}}</view>
</view>
</view>
<view v-if="item.content && item.type === 3"
style="width: 500rpx;background: #FFFFFF;height: max-content;margin-right: 20rpx;margin-top: 10rpx;border-radius: 20rpx;padding: 15rpx 10rpx;">
<view style="color: #000000;font-weight: 600;margin-left: 10rpx;">你正在咨询的订单</view>
<view style="display: flex;">
<image :src="item.content[0]" class="chat-listitem-image-type4"
style="margin-left: 7rpx;margin-top: 20rpx;width: 110rpx;height: 110rpx;"></image>
<view
style="margin-top: 15rpx;padding: 10rpx 0rpx 5rpx 10rpx;width: 75%;background: #f5f5f5;margin-left: 10rpx;">
<view
style="font-size: 28rpx;overflow: hidden;text-overflow: ellipsis;display: -webkit-box;-webkit-line-clamp: 2;-webkit-box-orient: vertical;height: 75upx;width: 100%;">
{{item.content[1]}}</view>
<view style="color: #ed5732;font-size: 28rpx;"><text style="font-size: 22rpx;">
</text>{{item.content[5]}}
</view>
</view>
</view>
<view style="color: #999999;margin-top: 10rpx;margin-left: 12rpx;">
<view>订单编号{{item.content[3]}}</view>
<view style="margin-top: 10rpx;">创建时间{{item.content[4]}}</view>
</view>
<view
style="float: right;margin-right: 10rpx;margin-top: 15rpx;background: #F9221D;color: #FFFFFF;border-radius: 50rpx;width: 150rpx;height: 50rpx;font-size: 24rpx;text-align: center;line-height: 50rpx;"
@click="goDingdanDetail(item.content[2])">查看</view>
</view>
<image @tap="viewImg(item.content)" v-if="item.content && item.type === 2" :src="item.content"
style="height: 200rpx;width: 200rpx;margin-right: 20rpx;"></image>
<view>
<image v-if="item.chat.userHead" :src="item.chat.userHead" class="chat-listitem-image">
</image>
<image v-else src="../../static/logo.png" class="chat-listitem-image"></image>
</view>
</view>
</view>
<!-- <view v-if="item.sendType === 4" style="width: 83%;margin-left: 15%;">
<view class="chat-listitem" style="float: right;">
<view style="height: max-content;">
<image :src="type4[0]" mode=""></image>
</view>
<image @tap="viewImg(item.content)" v-if="item.content && item.type === 2" :src="item.content" style="height: 200rpx;width: 170rpx;margin-right: 20rpx;"></image>
<view>
<image :src="item.chat.userHead" class="chat-listitem-image"></image>
</view>
</view>
</view> -->
</view>
</view>
<view v-if="ShopState"
style="width: 95%;margin-left: 20rpx;height: 150upx;position: fixed;bottom: 120upx;z-index: 99;background-color: #FFFFFF;border-radius: 20rpx;">
<view style="display: flex;width: 100%;color: #000000;padding: 20rpx;">
<image :src="Shopimage" style="width: 110rpx;height: 110rpx;"></image>
<view style="margin-left: 20rpx;width: 400rpx;">
<view
style="font-size: 34rpx;color: #000000;overflow: hidden;text-overflow: ellipsis;flex-wrap: nowrap;white-space: nowrap;width: 98%;">
{{ShopTitle}}</view>
<view style="margin-top: 20rpx;color: #ed5732;font-size: 34rpx;">{{Shopmoney}}</view>
</view>
<view style="text-align: right;">
<image @click="ShopClose" src="../../static/images/img/close.png"
style="width: 30rpx;height: 30rpx;"></image>
<view
style="margin-top: 20rpx;background: #F9221D;color: #FFFFFF;border-radius: 50rpx;width: 150rpx;height: 50rpx;font-size: 24rpx;text-align: center;line-height: 50rpx;"
@click="goMaijia">发送给商家</view>
</view>
</view>
</view>
<view v-if="orderState"
style="width: 95%;margin-left: 20rpx;height: 150upx;position: fixed;bottom: 120upx;z-index: 99;background-color: #FFFFFF;border-radius: 20rpx;">
<view style="display: flex;width: 100%;color: #000000;padding: 20rpx;">
<image :src="orderimage" style="width: 110rpx;height: 110rpx;"></image>
<view style="margin-left: 20rpx;width: 400rpx;">
<view
style="font-size: 34rpx;color: #000000;overflow: hidden;text-overflow: ellipsis;flex-wrap: nowrap;white-space: nowrap;width: 98%;">
你可能想咨询该订单</view>
<view style="margin-top: 20rpx;color: #ed5732;font-size: 34rpx;">{{ordermoney}}</view>
</view>
<view style="text-align: right;">
<image @click="orderClose" src="../../static/images/img/close.png"
style="width: 30rpx;height: 30rpx;"></image>
<view
style="margin-top: 20rpx;background: #F9221D;color: #000000;border-radius: 50rpx;width: 150rpx;height: 50rpx;font-size: 24rpx;text-align: center;line-height: 50rpx;"
@click="goDingdan">发送订单</view>
</view>
</view>
</view>
<!-- 底部聊天输入框 -->
<view class="input-box">
<view class="justify-between padding-lr" style="display: flex;margin-top: 15rpx;width: 100%;background-color: #eee;padding-top: 4upx;">
<image src="../../static/images/img/add.png" @click="chooseImage(['album'])"
style="width: 50rpx;height: 50rpx;margin-top: 8rpx;margin-right: 12rpx;border-radius: 52upx;"></image>
<input confirm-type="send" @confirm='setChatSave(1)' type="text" v-model="content"
style="width: 72%;height: 70rpx;background: #fff;margin: 4rpx 10rpx 0;border-radius: 70rpx;padding-left: 10rpx;color: #000000;" />
<view class="save" @tap='setChatSave(1)'>发送</view>
</view>
</view>
</view>
</template>
<script>
import configdata from '../../common/config.js';
export default {
data() {
return {
connected: false,
connecting: false,
msg: false,
type4: [],
listRight: {
chat: {
userHead: ""
},
content: "",
sendType: 1,
type: 1
},
content: '',
chatId: '',
type: 1,
ListItem: [],
ShopState: false,
ShopordersId: '',
Shopimage: '',
Shopmoney: '',
ShopTitle: '',
orderState: false,
ordersId: '',
orderimage: '',
orderNum: '',
ordermoney: '',
orderTitle: '',
orderCreateTime: '',
className: '',
Shopsales: '',
hand: 1,
index: 0,
page: 0,
size: 1000,
countDown: ''
};
},
computed: {
showMsg() {
if (this.connected) {
if (this.msg) {
return '收到消息:' + this.msg
} else {
return '等待接收消息'
}
} else {
return '尚未连接'
}
}
},
onUnload() {
uni.closeSocket()
uni.hideLoading()
},
onLoad(d) {
if (d.className) {
this.className = d.className;
if (d.className === 'shop') {
this.ShopState = true;
this.ShopordersId = d.ordersId;
this.Shopimage = d.image;
this.Shopmoney = d.money;
this.Shopsales = d.sales;
this.ShopTitle = d.title;
} else if (d.className === 'order') {
this.orderState = true;
this.ordersId = d.id;
this.orderimage = d.image;
this.ordermoney = d.money;
this.orderTitle = d.title;
this.orderNum = d.orderNum;
this.orderCreateTime = d.createTime;
}
}
this.getChatSave();
this.connect();
},
onShow() {
if (this.connected || this.connecting) {
} else {
this.connect();
}
},
onHide() {
uni.closeSocket()
},
methods: {
copy(content) {
uni.showModal({
title: '温馨提示',
content: '确认要复制此文字吗?',
showCancel: true,
cancelText: '取消',
confirmText: '确认',
success: res => {
if (res.confirm) {
uni.setClipboardData({
data: content,
success: r => {
this.$queue.showToast('复制成功');
}
});
}
}
});
},
h5Copy(content) {
if (!document.queryCommandSupported('copy')) {
// 不支持
return false
}
let textarea = document.createElement("textarea")
textarea.value = content
textarea.readOnly = "readOnly"
document.body.appendChild(textarea)
textarea.select() // 选择对象
textarea.setSelectionRange(0, content.length) //核心
let result = document.execCommand("copy") // 执行浏览器复制命令
textarea.remove()
return result
},
getDateDiff(data) {
// 传进来的data必须是日期格式不能是时间戳
//var str = data;
//将字符串转换成时间格式
var timePublish = new Date(data);
var timeNow = new Date();
var minute = 1000 * 60;
var hour = minute * 60;
var day = hour * 24;
var month = day * 30;
var result = "2";
var diffValue = timeNow - timePublish;
var diffMonth = diffValue / month;
var diffWeek = diffValue / (7 * day);
var diffDay = diffValue / day;
var diffHour = diffValue / hour;
var diffMinute = diffValue / minute;
if (diffMonth > 3) {
result = timePublish.getFullYear() + "-";
result += timePublish.getMonth() + "-";
result += timePublish.getDate();
} else if (diffMonth > 1) { //月
result = data.substring(0, 10);
} else if (diffWeek > 1) { //周
result = data.substring(0, 10);
} else if (diffDay > 1) { //天
result = data.substring(0, 10);
} else if (diffHour > 1) { //小时
result = parseInt(diffHour) + "小时前";
} else if (diffMinute > 1) { //分钟
result = parseInt(diffMinute) + "分钟前";
} else {
result = "刚刚";
}
return result;
},
goDingdanDetail(id) {
uni.navigateTo({
url: '../member/orderdetail?id=' + id
});
},
goShop(ordersId) {
uni.navigateTo({
url: './commoditydetail?ordersId=' + ordersId
});
},
ShopClose() {
this.ShopState = false;
},
orderClose() {
this.orderState = false;
},
goDingdan() {
this.orderState = false;
this.setChatSave(3);
},
goMaijia() {
this.ShopState = false;
this.setChatSave(4);
},
connect() {
let userId = this.$queue.getData('userId');
if (this.connected || this.connecting) {
uni.showModal({
content: '正在连接或者已经连接,请勿重复连接',
showCancel: false
})
return false
}
let token = uni.getStorageSync('token')
this.connecting = true
uni.showLoading({
title: '连接中...'
})
uni.connectSocket({
// url: 'wss://game.shengqianxiong.com.cn/wss/websocket/' + userId,
// url: 'ws://74165o0188.uicp.fun/sqx_fast/websocket/' + userId,
url: this.config("WSHOST") + userId,
data() {
return {
msg: 'Hello'
}
},
header: {
'content-type': 'application/json',
'token': token
},
method: 'GET',
success(res) {
// 这里是接口调用成功的回调,不是连接成功的回调,请注意
},
fail(err) {
// 这里是接口调用失败的回调,不是连接失败的回调,请注意
}
})
uni.onSocketOpen((res) => {
this.connecting = false
this.connected = true
uni.hideLoading()
// uni.showToast({
// icon: 'none',
// title: '连接成功'
// })
console.log('onOpen', res);
})
uni.onSocketError((err) => {
this.connecting = false
this.connected = false
uni.hideLoading()
uni.showModal({
content: '网络较差,请稍后再试',
showCancel: false
})
console.log('onError', err);
})
uni.onSocketMessage((res) => {
// let that = this;
// let datas = JSON.parse(res.data)
// let data = {
// chat: {
// userHead: '../../static/logo.png'
// },
// content: datas.content,
// type: datas.type,
// sendType: datas.sendType
// }
// that.ListItem.push(data);
this.getTimeOrListItem1();
console.log('onMessage', res)
})
uni.onSocketClose((res) => {
this.connected = false
this.startRecive = false
this.msg = false
console.log('onClose', res)
})
},
close() {
uni.closeSocket()
},
getTimeOrListItem1() {
this.$Request.getT('/app/chats/list?chatId=' + this.chatId).then(
res => {
this.ListItem = [];
if (res.data) {
var time = '';
res.data.forEach(d => {
d.createTime = this.getDateDiff(d.createTime);
if (d.createTime === time) {
d.createTime = '';
} else {
time = d.createTime;
}
if (!d.chat.userHead) {
// d.chat.userHead = '../../static/logo.png';
let avatar = this.$queue.getData('avatar');
d.chat.userHead = avatar
}
if (d.type === 4) {
let data = d.content.split(',');
d.content = data;
}
if (d.type === 3) {
let data = d.content.split(',');
d.content = data;
}
this.ListItem.push(d);
});
setTimeout(() => {
uni.pageScrollTo({
scrollTop: 99999,
duration: 0
});
}, 50);
}
uni.hideLoading();
});
},
getChatSave() {
let userId = this.$queue.getData('userId');
let phone = this.$queue.getData('phone');
let userName = this.$queue.getData('userName');
if (!phone) {
phone = this.$queue.getData('userName');
}
let avatar = this.$queue.getData('avatar') ? this.$queue.getData('avatar') : '';
let shopUserName = this.$queue.getData('shopUserName') ? this.$queue.getData('shopUserName'): '';
let data = {
userId: userId,
userHead: avatar,
userName: shopUserName,
storeId: '0',
storeHead: '',
storeName: ''
}
this.$Request.postJson('/app/chats/save', data).then(res => {
if (res.status === 0) {
this.chatId = res.data.chatId;
uni.showLoading({
title: '加载中...'
});
this.getTimeOrListItem1();
}
});
},
setChatSave(type) {
//type:1文字 2图片
if (type === 1 && this.content == '') {
this.$queue.showToast('请输入聊天内容');
return;
}
if (this.chatId == '' || this.chatId == undefined) {
this.$queue.showToast('网络较差,请稍后再试');
return;
}
let userId = this.$queue.getData('userId');
if (type === 4) {
this.content = this.Shopimage + ',' + this.ShopTitle + ',' + this.Shopmoney + ',' + this.ShopordersId;
}
if (type === 3) {
this.content = this.orderimage + ',' + this.orderTitle + ',' + this.ordersId + ',' + this.orderNum +
',' + this.orderCreateTime +
',' + this.ordermoney
}
let avatar = this.$queue.getData('avatar') ? this.$queue.getData('avatar') : '';
let shopUserName = this.$queue.getData('shopUserName') ? this.$queue.getData('shopUserName'): '';
let data = {
userId: userId,
userHead: avatar,
userName: shopUserName,
content: this.content,
chatId: this.chatId,
type: type,
storeId: '0',
sendType: '1',
storeName: ''
}
data = JSON.stringify(data);
let that = this;
uni.sendSocketMessage({
data: data,
success(res) {
let avatar = that.$queue.getData('avatar');
if (!avatar) {
avatar = '../../static/logo.png';
}
setTimeout(() => {
that.getTimeOrListItem1();
}, 50);
console.log(that.content);
},
fail(err) {
console.log(err);
}
})
this.content = '';
},
//发送图片
chooseImage(sourceType) {
uni.chooseImage({
count: 1,
sourceType: ['album', 'camera'],
success: res => {
for (let i = 0; i < res.tempFilePaths.length; i++) {
this.$queue.showLoading("上传中...");
uni.uploadFile({ // 上传接口
url: this.config("APIHOST") + '/alioss/upload', //真实的接口地址
filePath: res.tempFilePaths[i],
name: 'file',
success: (uploadFileRes) => {
this.content = JSON.parse(uploadFileRes.data).data;
this.setChatSave(2);
uni.hideLoading();
}
});
}
}
})
},
config: function(name) {
var info = null;
if (name) {
var name2 = name.split("."); //字符分割
if (name2.length > 1) {
info = configdata[name2[0]][name2[1]] || null;
} else {
info = configdata[name] || null;
}
if (info == null) {
// let web_config = cache.get("web_config");
// if (web_config) {
// if (name2.length > 1) {
// info = web_config[name2[0]][name2[1]] || null;
// } else {
// info = web_config[name] || null;
// }
// }
}
}
return info;
},
//查看大图
viewImg(item) {
let imgsArray = [];
imgsArray[0] = item;
uni.previewImage({
current: 0,
urls: imgsArray
});
},
},
};
</script>
<style>
page {
/* background: #1c1b20; */
}
.input-box {
position: fixed;
bottom: 0;
left: 0;
height: 100rpx;
width: 100%;
display: flex;
box-sizing: content-box;
z-index: 999;
/* background-color: #ececec; */
/* padding: 0 5rpx; */
}
.chat-listitem {
display: flex;
margin-top: 20rpx;
padding: 10rpx;
}
.chat-listitem-text {
color: #000000;
background: #FFFFFF;
margin-top: 10rpx;
width: fit-content;
padding: 15rpx;
font-size: 30rpx;
height: max-content;
word-wrap: break-word;
word-break: break-all;
border-radius: 10rpx;
}
.chat-listitem-image-type4 {
color: #000000;
background: #FFFFFF;
width: fit-content;
font-size: 30rpx;
height: max-content;
word-wrap: break-word;
word-break: break-all;
border-top-left-radius: 20rpx;
border-top-right-radius: 20rpx;
}
.chat-listitem-image {
margin-top: 5rpx;
width: 75rpx;
height: 75rpx;
border-radius: 5rpx;
}
.save {
width: 130rpx;
text-align: center;
border-radius: 10rpx;
height: 70rpx;
color: #FFF;
background: #1789FD;
margin: 5rpx 10rpx 0;
line-height: 70rpx;
}
</style>

188
pages/my/comments.vue Normal file
View File

@@ -0,0 +1,188 @@
<template>
<view class="content">
<view class="online_box">
<view class="part1">
<view class="online_left">投诉类型</view>
<view class="online_right" @click="show = true">
{{complaintName?complaintName:'请选择投诉类型'}}
<image src="../../static/images/img/go.png"></image>
</view>
</view>
<u-line color="#E6E6E6" />
<view class="online">
<view class="tit">投诉理由</view>
<view class="text_box" style="margin-top: 20rpx;">
<u-input v-model="value" height="300" :type="type" :border="border" :clearable="false"
placeholder="请描述问题发生的情况" />
</view>
</view>
</view>
<view class="btn" @click="bindorder">立即提交</view>
<u-picker v-model="show" mode="selector" :range="typeList" range-key="illegal" @confirm='select'></u-picker>
</view>
</template>
<script>
export default {
data() {
return {
show: false,
value: '',
type: 'textarea',
border: true,
indentNumber: '',
complaintName: '',
typeList: [],
IllegalId: ''
}
},
onLoad(options) {
console.log(options)
this.indentNumber = options.indentNumber
console.log(options.indentNumber)
this.getTypeList()
},
methods: {
select(e) {
console.log(e)
this.complaintName = this.typeList[e].illegal
this.IllegalId = this.typeList[e].id
},
getTypeList() {
this.$Request.get('/shop/illegalType/selectIllegalTypeList').then(res => {
if (res.code == 0) {
this.typeList = res.data
}
});
},
bindorder() {
if (this.IllegalId == '') {
uni.showToast({
title: '请选择投诉类型',
icon: 'none'
})
return
}
if (this.value == '') {
uni.showToast({
title: '请填写投诉原因',
icon: 'none'
})
return
}
this.$Request.postJson('/app/tbindent/insertComplaint', {
// indentNumber:this.indentNumber,
indentNumber: this.indentNumber,
wrongExplain: this.value,
shopIllegalId: this.IllegalId,
type: '2',
indentType: '5',
shopId: uni.getStorageSync('shopId')
}).then(res => {
if (res.code == 0) {
uni.showToast({
title: '提交成功',
icon: 'none'
})
setTimeout(function() {
uni.navigateBack()
}, 1000)
} else {
console.log('失败:', res.data)
}
});
}
}
}
</script>
<style>
body {
background-color: #F5F5F5;
}
.content {
width: 100%;
}
.online_box {
width: 90%;
margin: 0 auto;
background: #FFFFFF;
border-radius: 20rpx;
margin-top: 30rpx;
padding-bottom: 40rpx;
}
.part1 {
width: 90%;
margin: 0 auto;
height: 80rpx;
display: flex;
align-items: center;
}
.online_left {
flex: 1;
font-size: 27rpx;
font-weight: bold;
letter-spacing: 2rpx;
}
.online_right {
color: #999999;
font-size: 22rpx;
flex: 1;
display: flex;
justify-content: flex-end;
align-items: center;
}
.online_right image {
width: 12rpx;
height: 21rpx;
margin-left: 10rpx;
}
.online_title {
font-size: 28rpx;
font-weight: bold;
letter-spacing: 2rpx;
width: 90%;
margin: 0 auto;
line-height: 80rpx;
}
.online {
width: 90%;
margin: 0 auto;
padding-bottom: 34rpx;
}
.tit {
font-size: 27rpx;
font-weight: bold;
letter-spacing: 2rpx;
margin-top: 19rpx;
}
.u-input--border {
border: none !important;
background: #F5F5F5 !important;
}
.btn {
width: 90%;
margin: 0 auto;
background: #FF7F00;
line-height: 90rpx;
text-align: center;
color: white;
border-radius: 15rpx;
margin-top: 20rpx;
font-size: 28rpx;
}
</style>

259
pages/my/earnings.vue Normal file
View File

@@ -0,0 +1,259 @@
<template>
<view>
<view class="bg padding-tb-xl">
<view class="box padding">
<view>
<!-- <view class="lins"></view> -->
<view class="margin-top marginlr" style="display: flex;font-size:32upx;">
<view style="width: 50%;">订单总金额</view>
<view style="width: 50%;">{{dataCentre.money?dataCentre.money:0}}<text class="text-sm"></text></view>
</view>
<view class="margin-top marginlr" style="display: flex;font-size:32upx;">
<view style="width: 50%;"> </view>
<view style="width: 50%;">{{dataCentre.count?dataCentre.count:0}}<text class="text-sm"></text></view>
</view>
<view class="margin-top marginlr" style="display: flex;font-size:32upx;">
<view style="width: 50%;">外卖订单金额</view>
<view style="width: 50%;">{{dataCentre.takeMoney1?dataCentre.takeMoney1:0}}<text class="text-sm"></text></view>
</view>
<view class="margin-top marginlr" style="display: flex;font-size:32upx;">
<view style="width: 50%;">外卖订单数</view>
<view style="width: 50%;">{{dataCentre.takeCount2?dataCentre.takeCount2:0}}<text class="text-sm"></text></view>
</view>
<view class="margin-top marginlr" style="display: flex;font-size:32upx;">
<view style="width: 50%;">退款订单金额</view>
<view style="width: 50%;">{{dataCentre.cancelOrderMoney?dataCentre.cancelOrderMoney:0}}<text class="text-sm"></text></view>
</view>
<view class="margin-top marginlr" style="display: flex;font-size:32upx;">
<view style="width: 50%;">退款订单数</view>
<view style="width: 50%;">{{dataCentre.cancelOrderCount?dataCentre.cancelOrderCount:0}}<text class="text-sm"></text></view>
</view>
<view class="margin-top marginlr" style="display: flex;font-size:32upx;">
<view style="width: 50%;">到店单金额</view>
<view style="width: 50%;">{{dataCentre.takeMoney?dataCentre.takeMoney:0}}<text class="text-sm"></text></view>
</view>
<view class="margin-top marginlr" style="display: flex;font-size:32upx;">
<view style="width: 50%;">到店订单数</view>
<view style="width: 50%;">{{dataCentre.takeCount?dataCentre.takeCount:0}}<text class="text-sm"></text></view>
</view>
</view>
</view>
</view>
<!-- <view class="page-box" v-if="orderList.length == 0" >
<view class="centre">
<image src="../../static/images/empty.png" mode=""></image>
<view class="tips">暂无内容</view>
</view>
</view> -->
<view style="margin: 10upx;">
<view class="boxs" v-for="(item,index) in orderList" :key='index' >
<view class="flex justify-between align-center padding">
<view class="textRed">已完成</view>
<view style="color:#999999;">{{item.payTime}}</view>
</view>
<view class="line"></view>
<view class="padding">
<view style="color:#333333;" class="text-lg text-bold">{{item.orderGoodsList[0].goodsName}}</view>
<view style="color:#333333;" class="padding-tb-sm"><text
style="color:#999999;">规格</text>{{item.orderGoodsList[0].skuMessage}}</view>
<view style="color:#333333;"><text style="color:#999999;">取餐号</text>{{item.orderCode}}</view>
</view>
<view class="line"></view>
<view class="flex justify-between padding">
<view style="color:#333333;" class="text-lg">
<text style="color:#999999;" class="text-df">实收:</text>{{item.payMoney}}
</view>
<view class="look" @click="getDet(item)" >查看详情</view>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
dataCentre: {},
page: 1,
limit: 10,
orderList: [],
shopId: '',
totalCount: 0
}
},
onLoad(option) {
this.shopId = option.shopId
this.getDataCentre()
this.getOrderList()
},
methods: {
getDet(item) {
uni.navigateTo({
url: '/shop/orderDet?orderNumber=' + item.orderNumber
})
},
// 收入
getDataCentre() {
this.$Request.getA("/admin/goodsShop/selectStoreData?shopId=" + this.shopId).then(res => {
if (res.code == 0) {
this.dataCentre = res.hashMap
}
});
},
getOrderList() {
let data = {
page: this.page,
limit: this.limit,
status: 4,
shopId: this.shopId
}
this.$Request.getA("/admin/order/selectAllOrder",data).then(res => {
if (res.code == 0) {
if(this.page == 1) {
this.orderList = res.data.list
} else {
this.orderList = [...this.orderList, ...res.data.list]
}
this.totalCount = res.data.totalCount
}
uni.stopPullDownRefresh();
uni.hideLoading()
});
}
},
onReachBottom: function() {
this.page = this.page + 1;
this.getOrderList();
if(this.totalCount == this.orderList.length) {
uni.showToast({
title: '已经到底了~',
icon: 'none'
})
}
},
onPullDownRefresh: function() {
this.page = 1;
this.getOrderList();
},
}
</script>
<style lang="scss" scoped>
page {
background: #EDF1F7;
}
.bg {
background: #FFFFFF;
}
.box {
width: 686upx;
// height: 329upx;
background: linear-gradient(90deg, #D0AA72 0%, #DBB984 100%);
border-radius: 16upx;
margin: 0 auto;
color: #ffffff;
}
.lins {
width: 1upx;
height: 60upx;
border: 1upx solid #FFFFFF;
}
.boxs {
// width: 686upx;
/* height: 363upx; */
background: #FFFFFF;
border-radius: 20upx;
margin: 0 auto;
margin-bottom: 20rpx;
}
.textRed {
font-size: 30upx;
font-family: PingFang SC;
font-weight: 500;
color: #D80204;
}
.line {
width: 686upx;
height: 1upx;
border: 1upx solid #E6E6E6;
}
.look {
width: 150upx;
height: 50upx;
background: #FCD202;
border-radius: 25upx;
line-height: 50upx;
text-align: center;
font-size: 24upx;
}
.page-box {
position: relative;
// left: 0;
height: 50vh;
z-index: 0;
top: 70px;
}
.centre {
position: absolute;
left: 0;
top: 0;
right: 0;
bottom: 0;
margin: auto;
height: 400rpx;
text-align: center;
// padding: 200rpx auto;
font-size: 32rpx;
image {
width: 387rpx;
height: 341rpx;
// margin-bottom: 20rpx;
margin: 0 auto 20rpx;
// border: 1px dotted #000000;
}
.tips {
font-size: 32rpx;
color: #2F3044;
margin-top: 20rpx;
font-weight: 700;
}
.btn {
margin: 80rpx auto;
width: 600rpx;
border-radius: 32rpx;
line-height: 90rpx;
color: #ffffff;
font-size: 34rpx;
background: #5074FF;
}
}
</style>

189
pages/my/forgetPwd.vue Normal file
View File

@@ -0,0 +1,189 @@
<template>
<view class="container">
<view class="wrapper">
<view class="input-content">
<view class="cu-form-group" style="border: 2upx solid whitesmoke;margin-bottom: 20px;border-radius: 30px">
<view class="title text-black">手机号</view>
<input type="number" :value="phone" placeholder="请输入手机号" maxlength="11" data-key="phone" @input="inputChange" />
</view>
<view class="cu-form-group" style="border: 2upx solid whitesmoke;margin-bottom: 20px;border-radius: 30px">
<text class="title text-black">验证码</text>
<input type="number" :value="code" placeholder="请输入验证码" maxlength="6" data-key="code" @input="inputChange"
@confirm="toLogin" />
<button class="send-msg" @click="sendMsg" :disabled="sending">{{sendTime}}</button>
</view>
<view class="cu-form-group" style="border: 2upx solid whitesmoke;margin-bottom: 20px;border-radius: 30px">
<text class="title text-black">设置密码</text>
<input type="password" :value="password" placeholder="请设置新密码" placeholder-class="input-empty" maxlength="20"
minlength="6" data-key="password" @input="inputChange" @confirm="toLogin" />
</view>
</view>
<button class="confirm-btn" @click="toLogin">立即找回</button>
</view>
</view>
</template>
<script>
export default {
data() {
return {
code: '',
phone: '',
password: '',
sending: false,
sendTime: '获取验证码',
count: 60,
logining: false
}
},
methods: {
sendMsg() {
const {
phone
} = this;
if (!phone) {
this.$queue.showToast("请输入手机号");
} else if (phone.length !== 11) {
this.$queue.showToast("请输入正确的手机号");
} else {
this.$queue.showLoading("正在发送验证码...");
this.$Request.getT("/app/Login/sendMsg/" + phone + "/forget").then(res => {
if (res.code === 0) {
this.sending = true;
this.$queue.showToast('验证码发送成功请注意查收');
this.countDown();
uni.hideLoading();
} else {
uni.hideLoading();
uni.showModal({
showCancel: false,
title: '短信发送失败',
content: res.msg ? res.msg : '请一分钟后再获取验证码'
});
}
});
}
},
countDown() {
const {
count
} = this;
if (count === 1) {
this.count = 60;
this.sending = false;
this.sendTime = '获取验证码'
} else {
this.count = count - 1;
this.sending = true;
this.sendTime = count - 1 + '秒后重新获取';
setTimeout(this.countDown.bind(this), 1000);
}
},
inputChange(e) {
const key = e.currentTarget.dataset.key;
this[key] = e.detail.value;
},
navBack() {
uni.navigateBack();
},
navTo(url) {
uni.navigateTo({
url
})
},
toLogin() {
const {
phone,
password,
code
} = this;
if (!phone) {
this.$queue.showToast("请输入手机号");
} else if (!password) {
this.$queue.showToast("请设置密码");
} else if (password.length < 6) {
this.$queue.showToast("密码位数必须大于六位");
} else {
this.logining = true;
this.$queue.showLoading("正在修改密码中...");
this.$Request.post("/app/Login/forgetPwd", {
pwd: password,
phone: phone,
msg: code
}).then(res => {
uni.hideLoading();
if (res.code === 0) {
uni.navigateTo({
url: '/pages/public/loginphone'
});
} else {
uni.showModal({
showCancel: false,
title: '密码找回失败',
content: res.msg,
});
}
});
}
},
},
}
</script>
<style lang='scss'>
page {
background: #F5F5F5 !important;
}
.send-msg {
border-radius: 30px;
/* color: white; */
height: 30px;
font-size: 14px;
line-height: 30px;
background: #FCD202;
}
.container {
padding-top: 32upx;
position: relative;
width: 100%;
height: 100%;
overflow: hidden;
background: #FFFFFF;
}
.wrapper {
position: relative;
z-index: 90;
background: #FFFFFF;
padding-bottom: 20px;
}
.input-content {
padding: 32upx 80upx;
}
.confirm-btn {
width: 600upx;
height: 80upx;
line-height: 80upx;
border-radius: 60upx;
margin-top: 32upx;
background: #FCD202;
/* color: #fff; */
font-size: 32upx;
&:after {
border-radius: 60px;
}
}
</style>

534
pages/my/im.vue Normal file
View File

@@ -0,0 +1,534 @@
<template>
<view>
<view style="width: 100%;padding-bottom: 140rpx;">
<view style="display: flex;flex-direction: column;" v-for="(item,index) in ListItem" :key='index'>
<view style="margin-top: 15rpx;width: 100%;text-align: center;font-size: 26rpx;color: #999999;">
{{item.createTime}}
</view>
<view v-if="item.shopId" style="width: 83%;margin-left: 15%;">
<view class="chat-listitem" style="float: right;">
<view v-if="item.content && item.messageType === 1" @longpress="copy(item.content)"
class="chat-listitem-text" style="margin-right: 20rpx;">{{item.content}}</view>
<image @tap="viewImg(item.content)" v-if="item.content && item.messageType === 2"
:src="item.content" style="height: 200rpx;width: 200rpx;margin-right: 20rpx;"></image>
<view>
<image v-if="item.shopCover" :src="item.shopCover" class="chat-listitem-image"></image>
<image v-else src="../../static/logo.png" class="chat-listitem-image"></image>
</view>
</view>
</view>
<view v-if="!item.shopId" style="width: 83%;margin-right: 15%;">
<view class="chat-listitem" style="float: left;margin-left: 10rpx;">
<view v-if="item.userId">
<image :src="item.userAvatar" class="chat-listitem-image"></image>
</view>
<view v-if="item.riderId">
<image :src="item.riderAvatar" class="chat-listitem-image"></image>
</view>
<view>
<!-- <view class="margin-left">{{item.userName}}</view> -->
<view v-if="item.content && item.messageType === 1" class="chat-listitem-text"
style="margin-left: 20rpx;">{{item.content}}</view>
<image @tap="viewImg(item.content)" v-if="item.content && item.messageType === 2"
:src="item.content" style="height: 200rpx;width: 200rpx;margin-left: 20rpx;"></image>
</view>
</view>
</view>
</view>
</view>
<!-- 跳转订单 -->
<view class="order" @click="bindorder()">
<image src="../../static/images/img/order.png"></image>
</view>
<!-- 底部聊天输入框 -->
<view class="input-box ">
<view class="justify-between padding-lr align-center"
style="display: flex;width: 100%;background-color: #EEEEEE;">
<image src="../../static/images/img/add.png" @click="chooseImage(['album'])"
style="width: 50rpx;height: 50rpx;margin-right: 12rpx;border-radius: 50upx;"></image>
<input confirm-type="send" @confirm='setChatSave(1)' type="text" v-model="content"
style="width: 72%;height: 70rpx;background: #fff;margin: 0 10rpx;border-radius: 5rpx;padding-left: 10rpx;" />
<view class="save" @tap='setChatSave(1)'>发送</view>
</view>
</view>
</view>
</template>
<script>
import configdata from '../../common/config.js';
export default {
data() {
return {
connected: false,
connecting: false,
msg: false,
type4: [],
listRight: {
chat: {
userHead: ""
},
content: "",
sendType: 1,
type: 1
},
content: '',
chatId: '',
type: 1,
ListItem: [],
ShopState: false,
ShopordersId: '',
Shopimage: '',
Shopmoney: '',
ShopTitle: '',
orderState: false,
ordersId: '',
userId: '',
orderimage: '',
orderNum: '',
teamId: '',
hand: 1,
index: 0,
page: 0,
size: 1000,
countDown: '',
ordersId: '',
byUserId: ''
};
},
computed: {
showMsg() {
if (this.connected) {
if (this.msg) {
return '收到消息:' + this.msg
} else {
return '等待接收消息'
}
} else {
return '尚未连接'
}
}
},
onUnload() {
// uni.closeSocket()
uni.hideLoading()
},
onLoad(d) {
this.userId = this.$queue.getData('userId');
// this.byUserId = d.byUserId
this.ordersId = d.orderId;
console.log(this.ordersId)
this.connect();
// if (d.teamName) {
// uni.setNavigationBarTitle({
// title: d.teamName
// });
// }
},
onShow() {
if (this.connected || this.connecting) {
} else {
this.connect();
}
},
onHide() {
// uni.closeSocket()
},
onUnload() {
this.close()
},
methods: {
// 跳转订单
bindorder() {
console.log(this.ordersId)
uni.navigateTo({
url: '/pages/order/orderDet?orderId=' + this.ordersId
})
},
copy(content) {
uni.showModal({
title: '温馨提示',
content: '确认要复制此文字吗?',
showCancel: true,
cancelText: '取消',
confirmText: '确认',
success: res => {
if (res.confirm) {
uni.setClipboardData({
data: content,
success: r => {
this.$queue.showToast('复制成功');
}
});
}
}
});
},
getDateDiff(data) {
// 传进来的data必须是日期格式不能是时间戳
//var str = data;
//将字符串转换成时间格式
var timePublish = new Date(data);
var timeNow = new Date();
var minute = 1000 * 60;
var hour = minute * 60;
var day = hour * 24;
var month = day * 30;
var result = "2";
var diffValue = timeNow - timePublish;
var diffMonth = diffValue / month;
var diffWeek = diffValue / (7 * day);
var diffDay = diffValue / day;
var diffHour = diffValue / hour;
var diffMinute = diffValue / minute;
if (diffMonth > 3) {
result = timePublish.getFullYear() + "-";
result += timePublish.getMonth() + "-";
result += timePublish.getDate();
} else if (diffMonth > 1) { //月
result = data.substring(0, 10);
} else if (diffWeek > 1) { //周
result = data.substring(0, 10);
} else if (diffDay > 1) { //天
result = data.substring(0, 10);
} else if (diffHour > 1) { //小时
result = parseInt(diffHour) + "小时前";
} else if (diffMinute > 1) { //分钟
result = parseInt(diffMinute) + "分钟前";
} else {
result = "刚刚";
}
return result;
},
connect() {
let that = this;
let userId = that.$queue.getData('userId');
if (that.connected || that.connecting) {
uni.showModal({
content: '正在连接或者已经连接,请勿重复连接',
showCancel: false
})
return false
}
that.connecting = true
uni.showLoading({
title: '连接中...'
})
console.log(userId, '*******************')
uni.connectSocket({
// url: 'ws://192.168.1.17:8881/gameTeamChat/' + userId + '_' + this.teamId,
// url: 'wss://game.shengqianxiong.com.cn/wss/gameTeamChat/' + userId + '_' + this.teamId,
// url: 'ws://74165o0188.uicp.fun/sqx_fast/chatSocket/' + userId,
url: this.config("WSHOST1") + this.ordersId,
data() {
return {
msg: 'Hello'
}
},
header: {
'content-type': 'application/json'
},
method: 'GET',
success(res) {
uni.hideLoading();
that.getTimeOrListItem1();
// 这里是接口调用成功的回调,不是连接成功的回调,请注意
},
fail(err) {
// 这里是接口调用失败的回调,不是连接失败的回调,请注意
console.log("--------------" + JSON.stringify(err))
}
});
uni.onSocketOpen((res) => {
that.connecting = false
that.connected = true
uni.hideLoading()
// uni.showToast({
// icon: 'none',
// title: '连接成功'
// })
console.log('onOpen', res);
});
uni.onSocketError((err) => {
that.connecting = false
that.connected = false
uni.hideLoading()
uni.showModal({
content: '网络较差,请稍后再试',
showCancel: false
})
console.log('onError', err);
});
uni.onSocketMessage(function(res) {
console.log('收到服务器内容:' + JSON.stringify(res));
setTimeout(() => {
that.getTimeOrListItem1();
}, 50);
});
uni.onSocketClose((res) => {
that.connected = false
that.startRecive = false
that.msg = false
console.log('onClose', res)
});
},
close() {
uni.closeSocket()
},
getTimeOrListItem1() {
console.log(this.ordersId)
this.$Request.get('/shop/ordersChat/selectGameChatDetails?page=1&limit=1000&ordersId=' +
this.ordersId).then(
res => {
this.ListItem = [];
if (res.data) {
var time = '';
res.data.list.forEach(d => {
if (!d.avatar) {
// d.chat.userHead = '../../static/logo.png';
let avatar = this.$queue.getData('avatar');
d.avatar = avatar
}
this.ListItem.push(d);
});
this.ListItem = this.ListItem.reverse();
setTimeout(() => {
uni.pageScrollTo({
scrollTop: 99999,
duration: 0
});
}, 50);
}
uni.hideLoading();
});
},
getChatSave() {
let userId = this.$queue.getData('userId');
let phone = this.$queue.getData('phone');
let userName = this.$queue.getData('userName');
if (!phone) {
phone = this.$queue.getData('userName');
}
let avatar = this.$queue.getData('avatar');
let data = {
userId: userId,
userHead: avatar,
userName: userName,
storeId: '0',
storeHead: '同城外卖商家',
storeName: ''
}
this.$Request.postJson('/chat/save', data).then(res => {
if (res.status === 0) {
this.chatId = res.data.chatId;
uni.showLoading({
title: '加载中...'
});
this.getTimeOrListItem1();
}
});
},
setChatSave(type) {
//type:1文字 2图片
if (type === 1 && this.content == '') {
this.$queue.showToast('请输入聊天内容');
return;
}
// if (this.chatId == '' || this.chatId == undefined) {
// this.$queue.showToast('网络较差,请稍后再试');
// return;
// }
let shopId = this.$queue.getData('shopId');
let userId = this.$queue.getData('userId');
let avatar = this.$queue.getData('avatar');
let phone = this.$queue.getData('phone');
let userName = this.$queue.getData('userName');
if (!phone) {
phone = this.$queue.getData('userName');
}
// console.log(this.byUserId)
let data = {
content: this.content,
messageType: type,
shopId: shopId,
ordersId: this.ordersId,
chatConversationId: this.chatConversationId,
userId: userId,
}
data = JSON.stringify(data);
let that = this;
uni.sendSocketMessage({
data: data,
success(res) {
let avatar = that.$queue.getData('avatar');
if (!avatar) {
avatar = '../../static/logo.png';
}
let data = {
chat: {
userHead: avatar
},
content: that.content,
type: type,
userId: userId
}
console.log(data, 'data99999999999999999')
// that.ListItem.push(data);
setTimeout(() => {
that.getTimeOrListItem1();
}, 50);
console.log(that.content);
},
fail(err) {
console.log(err);
}
})
this.content = '';
},
//发送图片
chooseImage(sourceType) {
uni.chooseImage({
count: 1,
sourceType: ['album', 'camera'],
success: res => {
for (let i = 0; i < res.tempFilePaths.length; i++) {
this.$queue.showLoading("上传中...");
uni.uploadFile({ // 上传接口
url: this.config("APIHOST1") + '/alioss/upload', //真实的接口地址
filePath: res.tempFilePaths[i],
name: 'file',
success: (uploadFileRes) => {
console.log(uploadFileRes)
this.content = JSON.parse(uploadFileRes.data).data;
this.setChatSave(2);
uni.hideLoading();
}
});
}
}
})
},
config: function(name) {
var info = null;
if (name) {
var name2 = name.split("."); //字符分割
if (name2.length > 1) {
info = configdata[name2[0]][name2[1]] || null;
} else {
info = configdata[name] || null;
}
if (info == null) {
// let web_config = cache.get("web_config");
// if (web_config) {
// if (name2.length > 1) {
// info = web_config[name2[0]][name2[1]] || null;
// } else {
// info = web_config[name] || null;
// }
// }
}
}
return info;
},
//查看大图
viewImg(item) {
let imgsArray = [];
imgsArray[0] = item;
uni.previewImage({
current: 0,
urls: imgsArray
});
},
},
};
</script>
<style>
page {
/* background: #1c1b20; */
}
.input-box {
position: fixed;
bottom: 0;
left: 0;
height: 120rpx;
width: 100%;
display: flex;
box-sizing: content-box;
z-index: 999;
/* background-color: #ececec; */
/* padding: 0 5rpx; */
}
.chat-listitem {
display: flex;
margin-top: 20rpx;
padding: 10rpx;
}
.chat-listitem-text {
color: #000000;
background: #FFFFFF;
margin-top: 10rpx;
width: fit-content;
padding: 15rpx;
font-size: 30rpx;
height: max-content;
word-wrap: break-word;
word-break: break-all;
border-radius: 10rpx;
}
.chat-listitem-image-type4 {
color: #000000;
background: #FFFFFF;
width: fit-content;
font-size: 30rpx;
height: max-content;
word-wrap: break-word;
word-break: break-all;
border-top-left-radius: 20rpx;
border-top-right-radius: 20rpx;
}
.chat-listitem-image {
margin-top: 5rpx;
width: 75rpx;
height: 75rpx;
border-radius: 5rpx;
}
.save {
width: 130rpx;
text-align: center;
border-radius: 70rpx;
height: 70rpx;
color: #FFF;
background: #1789FD;
margin: 5rpx 10rpx 0;
line-height: 70rpx;
}
.order {
position: fixed;
bottom: 65px;
right: 15px;
}
.order image {
width: 120rpx;
height: 120rpx;
}
</style>

741
pages/my/index.vue Normal file
View File

@@ -0,0 +1,741 @@
<template>
<view style="padding-bottom: 100upx;">
<view class="bg padding-bottom">
<view class=" u-flex padding ">
<view class="u-m-r-10">
<!-- @click="goNav('/pages/my/userinfo')" -->
<image :src="shopCover" style="width: 100rpx;height: 100rpx;border-radius: 100rpx;"
@click="goNavs(list[0].url)"></image>
</view>
<view class="u-flex-1 u-m-l-10 flex justify-between align-center" v-if="!isLogin">
<view class="u-font-18 text-bold">
<!-- #ifdef MP-WEIXIN -->
<view class="margin-left-sm margin-top-xs" style="width: 180px;">{{shopName}}</view>
<!-- #endif -->
<!-- #ifndef MP-WEIXIN -->
<view class="margin-left-sm margin-top-xs" style="width: 180px;">{{shopName}}</view>
<!-- #endif -->
</view>
<view class="erweima" @click="shopQr()">生成二维码</view>
</view>
<view v-else class="text-xl u-p-l-20 text-bold" @click="goLogin('/pages/my/loginphone')">
登录
</view>
</view>
<view class="moneybox" v-if="XCXIsSelect != '否'">
<view class="padding" style="background: #FCD202;border-radius: 20upx 20upx 0upx 0upx;">
<view class="flex justify-between">
<view>
<view>累计收益()</view>
<view class="margin-top-xs" style="font-size: 40upx;">
<text style="font-size: 55upx;">{{sumMoney}}</text></view>
</view>
<view class="btn" @click="goQian()">立即提现</view>
</view>
<view class="flex justify-between align-center text-center margin-top">
<view>
<view>今日收益</view>
<view class="margin-top-xs" style="font-size: 38upx;">
<text style="font-size: 48upx;">{{dayMoney?dayMoney:'0'}}</text></view>
</view>
<view>
<view>本月收益</view>
<view class="margin-top-xs" style="font-size: 38upx;">
<text style="font-size: 48upx;">{{monthMoney?monthMoney:'0'}}</text></view>
</view>
<view>
<view>本月提现</view>
<view class="margin-top-xs" style="font-size: 38upx;">
<text style="font-size: 48upx;">{{cashMoney?cashMoney:'0'}}</text></view>
</view>
</view>
</view>
<view class="flex align-center justify-between padding-lr padding-tb-sm"
style="background: #FCB202;border-radius: 0upx 0upx 20upx 20upx;">
<view class="">每次提现平台将扣除相应手续费</view>
<view class="xflist" @click="goNav('/my/other/cashList')">钱包明细</view>
</view>
</view>
</view>
<view class="bg margin-top-sm">
<!-- 店铺管理 -->
<view class="flex padding-lr padding-tb dfs" @click="goNavs(list[0].url)">
<image :src="list[0].image" style="width: 50rpx;height: 50rpx;" mode=""></image>
<view class="flex-sub margin-left text-df" style="line-height: 50upx;">{{list[0].title}}</view>
<image src="../../static/images/my/right.png" class="images" mode=""></image>
</view>
<!-- 商品管理 -->
<view class="flex padding-lr padding-tb dfs" @click="goNavs(list[1].url)">
<image :src="list[1].image" style="width: 50rpx;height: 50rpx;" mode=""></image>
<view class="flex-sub margin-left text-df" style="line-height: 50upx;">{{list[1].title}}</view>
<image src="../../static/images/my/right.png" class="images" mode=""></image>
</view>
<!-- 订单管理 -->
<view class="flex padding-lr padding-tb" @click="goOrder()">
<image :src="list[2].image" style="width: 50rpx;height: 50rpx;" mode=""></image>
<view class="flex-sub margin-left text-df" style="line-height: 50upx;">{{list[2].title}}</view>
<image src="../../static/images/my/right.png" class="images" mode=""></image>
</view>
<!-- 分类管理 -->
<view class="flex padding-lr padding-tb" @click="goNavs(list[3].url)">
<image :src="list[3].image" style="width: 50rpx;height: 50rpx;" mode=""></image>
<view class="flex-sub margin-left text-df" style="line-height: 50upx;">{{list[3].title}}</view>
<image src="../../static/images/my/right.png" class="images" mode=""></image>
</view>
<!-- 规格管理 -->
<view class="flex padding-lr padding-tb" @click="goNavs(list[4].url)">
<image :src="list[4].image" style="width: 50rpx;height: 50rpx;" mode=""></image>
<view class="flex-sub margin-left text-df" style="line-height: 50upx;">{{list[4].title}}</view>
<image src="../../static/images/my/right.png" class="images" mode=""></image>
</view>
<!-- 保证金 -->
<view class="flex padding-lr padding-tb" @click="goNav(list[5].url)" v-if="XCXIsSelect != '否'">
<image :src="list[5].image" style="width: 50rpx;height: 50rpx;" mode=""></image>
<view class="flex-sub margin-left text-df" style="line-height: 50upx;">{{list[5].title}}</view>
<image src="../../static/images/my/right.png" class="images" mode=""></image>
</view>
<!-- 规格管理 -->
<view class="flex padding-lr padding-tb" @click="goNavs(list[13].url)">
<image :src="list[13].image" style="width: 50rpx;height: 50rpx;" mode=""></image>
<view class="flex-sub margin-left text-df" style="line-height: 50upx;">{{list[13].title}}</view>
<image src="../../static/images/my/right.png" class="images" mode=""></image>
</view>
<!-- 精选活动 -->
<view class="flex padding-lr padding-tb" @click="goNavs(list[14].url)">
<image :src="list[14].image" style="width: 50rpx;height: 50rpx;" mode=""></image>
<view class="flex-sub margin-left text-df" style="line-height: 50upx;">{{list[14].title}}</view>
<image src="../../static/images/my/right.png" class="images" mode=""></image>
</view>
<!-- 优惠券管理 -->
<view class="flex padding-lr padding-tb" @click="goNavs(list[15].url)">
<image :src="list[15].image" style="width: 50rpx;height: 50rpx;" mode=""></image>
<view class="flex-sub margin-left text-df" style="line-height: 50upx;">{{list[15].title}}</view>
<image src="../../static/images/my/right.png" class="images" mode=""></image>
</view>
</view>
<view class="bg margin-top-sm">
<!-- 聊天中心 -->
<view class="flex padding-lr padding-tb dfs" @click="goNav(list[12].url)">
<image :src="list[12].image" style="width: 50rpx;height: 50rpx;" mode=""></image>
<view class="flex-sub margin-left text-df" style="line-height: 50upx;">{{list[12].title}}</view>
<view class="flex align-center">
<view v-if="messageCount" class="bott">{{messageCount}}</view>
<image src="../../static/images/my/right.png" class="images" mode=""></image>
</view>
</view>
<!-- 联系客服 -->
<view class="flex padding-lr padding-tb dfs" @click="goNav(list[6].url)">
<image :src="list[6].image" style="width: 50rpx;height: 50rpx;" mode=""></image>
<view class="flex-sub margin-left text-df" style="line-height: 50upx;">{{list[6].title}}</view>
<image src="../../static/images/my/right.png" class="images" mode=""></image>
</view>
<!-- 关于我们 -->
<!-- <view class="flex padding-lr padding-tb dfs" @click="goNav(list[7].url)">
<image :src="list[7].image" style="width: 50rpx;height: 50rpx;" mode=""></image>
<view class="flex-sub margin-left text-df" style="line-height: 50upx;">{{list[7].title}}</view>
<image src="../../static/images/my/right.png" class="images" mode=""></image>
</view> -->
<!-- 意见反馈 -->
<view class="flex padding-lr padding-tb dfs" @click="goNav(list[8].url)" v-if="XCXIsSelect != '否'">
<image :src="list[8].image" style="width: 50rpx;height: 50rpx;" mode=""></image>
<view class="flex-sub margin-left text-df" style="line-height: 50upx;">{{list[8].title}}</view>
<image src="../../static/images/my/right.png" class="images" mode=""></image>
</view>
<!-- 我的投诉 -->
<view class="flex padding-lr padding-tb dfs" @click="goNav(list[9].url)">
<image :src="list[9].image" style="width: 50rpx;height: 50rpx;" mode=""></image>
<view class="flex-sub margin-left text-df" style="line-height: 50upx;">{{list[9].title}}</view>
<image src="../../static/images/my/right.png" class="images" mode=""></image>
</view>
<!-- #ifdef MP-WEIXIN -->
<view class="flex padding-lr padding-tb dfs" @click="gouser()">
<image :src="list[10].image" style="width: 50rpx;height: 50rpx;" mode=""></image>
<view class="flex-sub margin-left text-df" style="line-height: 50upx;">{{list[10].title}}</view>
<image src="../../static/images/my/right.png" class="images" mode=""></image>
</view>
<!-- #endif -->
<!-- 系统设置 -->
<view class="flex padding-lr padding-tb dfs" @click="goset()">
<image :src="list[11].image" style="width: 50rpx;height: 50rpx;" mode=""></image>
<view class="flex-sub margin-left text-df" style="line-height: 50upx;">{{list[11].title}}</view>
<image src="../../static/images/my/right.png" class="images" mode=""></image>
</view>
<!-- 退出登录 -->
<!-- <view class="flex padding-lr padding-tb dfs" @click="TuiLogin()" v-if="!isLogin">
<image :src="list[10].image" style="width: 50rpx;height: 50rpx;" mode=""></image>
<view class="flex-sub margin-left text-df" style="line-height: 50upx;">{{list[10].title}}</view>
<image src="../../static/images/my/right.png" class="images" mode=""></image>
</view> -->
</view>
<u-popup v-model="show" mode="center" border-radius="14" width="500rpx" height="500rpx" :closeable="closeable">
<view style="width: 180px;height: 180px;margin: 40px auto;">
<image :src="shopQrImg" style="width: 100%;height: 100%;" @click="previewImage"></image>
</view>
</u-popup>
</view>
</template>
<script>
export default {
data() {
return {
shopCover: '../../static/logo.png',
isLogin: true,
shopName: '匿名',
sumMoney: 0, //累计余额
dayMoney: 0, //今日收益
monthMoney: 0, //本月预估收益
cashMoney: 0, // 本月预估提现
shopToken: '',
isVip: false,
invitationCode: '', //邀请码
list: [{
image: '../../static/images/my/dianpu.png',
title: '店铺管理',
url: '/my/store/index'
}, {
image: '../../static/images/my/shangpin.png',
title: '商品管理',
url: '/my/store/addgood'
}, {
image: '../../static/images/my/order.png',
title: '订单管理',
url: '/pages/order/index'
}, {
image: '../../static/images/my/fenlei.png',
title: '分类管理',
url: '/my/store/fenlei'
}, {
image: '../../static/images/my/guige.png',
title: '规格管理',
url: '/my/store/guige'
}, {
image: '../../static/images/my/baozhengjin.png',
title: '保证金',
url: '/my/other/money'
}, {
image: '../../static/images/my/kefu.png',
title: '联系客服',
url: '/pages/my/chat'
}, {
image: '../../static/images/my/guanyu.png',
title: '关于我们',
url: '/my/other/about'
}, {
image: '../../static/images/my/yijian.png',
title: '意见反馈',
url: '/my/feedback/index'
}, {
image: '../../static/images/my/00.png',
title: '我的投诉',
url: '/my/other/tousu'
}, {
image: '../../static/images/my/user.png',
title: '前往用户端',
url: ''
}, {
image: '../../static/images/my/set1.png',
title: '系统设置',
url: '/my/other/set'
}, {
image: '../../static/images/my/liaotian.png',
title: '聊天中心',
url: '/pages/my/liaotian'
}, {
image: '../../static/images/order/pinglun.png',
title: '店铺评价',
url: '/my/store/pingjia'
}, {
image: '../../static/images/order/hd.png',
title: '精选活动',
url: '/my/store/huodong'
}, {
image: '../../static/images/order/yhq.png',
title: '优惠券管理',
url: '/my/yhq/yhq'
}],
renzheng: 0,
XCXIsSelect: '是',
isCashDeposit: '',
show: false,
shopQrImg: '',
closeable: true,
open: true,
arr:[],
messageCount: ''
}
},
onLoad() {
// this.messageCount = uni.getStorageSync('messageCount')
this.XCXIsSelect = this.$queue.getData("XCXIsSelect");
this.shopToken = uni.getStorageSync('shopToken') ? uni.getStorageSync('shopToken') : ''
this.userId = uni.getStorageSync('userId')
this.open = uni.getStorageSync('open')
this.$Request.getT('/app/common/type/354').then(res => { //订单取消通知
if (res.code == 0) {
if (res.data && res.data.value) {
this.arr.push(res.data.value)
}
}
})
this.$Request.getT('/app/common/type/353').then(res => { //订单取消通知
if (res.code == 0) {
if (res.data && res.data.value) {
this.arr.push(res.data.value)
}
}
})
this.$Request.getT('/app/common/type/352').then(res => { //新订单通知
if (res.code == 0) {
if (res.data && res.data.value) {
this.arr.push(res.data.value)
}
}
})
// let that= this
// if (this.open = true) {
// uni.showModal({
// title: '提示',
// content: '请先去完善店铺信息,上线店铺后同城外卖用户端首页展示您的店铺。',
// success: function(res) {
// if (res.confirm) {
// console.log('用户点击确定');
// that.open = false
// that.$queue.setData("open", that.open);
// } else if (res.cancel) {
// console.log('用户点击取消');
// that.open = false
// that.$queue.setData("open", that.open);
// }
// }
// })
// }
},
onShow() {
this.shopToken = uni.getStorageSync('shopToken') ? uni.getStorageSync('shopToken') : ''
if (this.shopToken) {
this.messageCount = uni.getStorageSync('messageCount')
this.isLogin = false
this.getUserInfo()
this.getshanghuinfo()
this.getAmount()
} else {
this.isLogin = true
this.shopName = '匿名'
this.shopCover = '../../static/logo.png'
this.sumMoney = 0 //累计余额
this.dayMoney = 0 //今日收益
this.monthMoney = 0 //本月收益
this.cashMoney = 0 //本月提现
}
},
methods: {
previewImage() {
var arr = [];
arr.push(this.shopQrImg);
//uniapp预览轮播图方法
uni.previewImage({
current: 0, //预览图片的下标
urls: arr //预览图片的地址,必须要数组形式
})
},
//跳转设置
goset() {
uni.navigateTo({
url: '/my/other/set'
})
},
//生成二维码
shopQr() {
// uni.showLoading({
// title: '二维码生成中',
// duration: 1000,
// icon: 'none'
// });
this.show = true
this.shopQrImg = 'https://tcwm.xianmaxiong.com/sqx_fast/invite/shopQr?shopId=' + uni.getStorageSync(
'shopId')
},
//跳转用户端
gouser() {
wx.navigateToMiniProgram({
appId: 'wxd6a3bf45c999d9cd',
path: '/pages/index/index',
envVersion: 'release', // 打开正式版
success(res) {
// 打开成功
},
fail: function(err) {
console.log(err);
}
})
},
goQian() {
if (this.shopToken) {
// #ifdef MP-WEIXIN
if (uni.getStorageSync('sendindexMsg')) {
uni.requestSubscribeMessage({
tmplIds: this.arr,
success(re) {
// console.log(re,'**********')
var datas = JSON.stringify(re);
if (datas.indexOf("accept") != -1) {
console.log(re)
}
},
fail: (res) => {
console.log(res)
}
})
}
// #endif
uni.navigateTo({
url: '/my/other/wallet'
})
} else {
uni.showModal({
title: '提示',
content: '您还未登录,请先登录',
success: function(res) {
if (res.confirm) {
console.log('用户点击确定');
uni.navigateTo({
url: '/pages/my/loginphone'
})
} else if (res.cancel) {
console.log('用户点击取消');
}
}
})
}
},
bindFb() {
let renzheng = uni.getStorageSync('renzheng')
console.log(this.userId, renzheng)
if (this.shopToken) {
// #ifdef MP-WEIXIN
if (uni.getStorageSync('sendindexMsg')) {
uni.requestSubscribeMessage({
tmplIds: this.arr,
success(re) {
// console.log(re,'**********')
var datas = JSON.stringify(re);
if (datas.indexOf("accept") != -1) {
console.log(re)
}
},
fail: (res) => {
console.log(res)
}
})
}
// #endif
uni.navigateTo({
url: '/my/publish/editor'
})
} else {
uni.showModal({
title: '提示',
content: '您还未登录,请先登录',
success: function(res) {
if (res.confirm) {
console.log('用户点击确定');
uni.navigateTo({
url: '/pages/my/loginphone'
})
} else if (res.cancel) {
console.log('用户点击取消');
}
}
})
}
},
goOrder() {
uni.switchTab({
url: '/pages/order/index'
})
},
//列表跳转
goNav(e, name) {
console.log(e)
if (this.shopToken) {
// #ifdef MP-WEIXIN
if (uni.getStorageSync('sendindexMsg')) {
uni.requestSubscribeMessage({
tmplIds: this.arr,
success(re) {
// console.log(re,'**********')
var datas = JSON.stringify(re);
if (datas.indexOf("accept") != -1) {
console.log(re)
}
},
fail: (res) => {
console.log(res)
}
})
}
// #endif
uni.navigateTo({
url: e
})
} else {
uni.showModal({
title: '提示',
content: '您还未登录,请先登录',
success: function(res) {
if (res.confirm) {
console.log('用户点击确定');
uni.navigateTo({
url: '/pages/my/loginphone'
})
} else if (res.cancel) {
console.log('用户点击取消');
}
}
})
}
},
//列表跳转
goNavs(e, name) {
console.log(e)
let cashDeposit = uni.getStorageSync("cashDeposit")
if (this.shopToken) {
// #ifdef MP-WEIXIN
if (uni.getStorageSync('sendindexMsg')) {
uni.requestSubscribeMessage({
tmplIds: this.arr,
success(re) {
// console.log(re,'**********')
var datas = JSON.stringify(re);
if (datas.indexOf("accept") != -1) {
console.log(re)
}
},
fail: (res) => {
console.log(res)
}
})
}
// #endif
if (cashDeposit == 0 || cashDeposit == 'null') {
uni.showModal({
title: '提示',
content: '您还未缴纳保证金,请先去缴纳保证金',
success: function(res) {
if (res.confirm) {
console.log('用户点击确定');
uni.navigateTo({
url: '/my/other/money'
})
} else if (res.cancel) {
console.log('用户点击取消');
}
}
})
} else {
uni.navigateTo({
url: e
})
}
} else {
uni.showModal({
title: '提示',
content: '您还未登录,请先登录',
success: function(res) {
if (res.confirm) {
console.log('用户点击确定');
uni.navigateTo({
url: '/pages/my/loginphone'
})
} else if (res.cancel) {
console.log('用户点击取消');
}
}
})
}
},
goLogin(e) {
uni.navigateTo({
url: e
})
},
//我的收益
getAmount() {
let data = {
shopId: uni.getStorageSync('shopId')
}
this.$Request.get("/app/shop/shopEarnings", data).then(res => {
if (res.code == 0) {
this.sumMoney = parseFloat(res.data.shopAllEarnings).toFixed(2) //累计余额
this.dayMoney = parseFloat(res.data.shopEarningsDay).toFixed(2) //今日收益
this.monthMoney = parseFloat(res.data.shopEarningsMonth).toFixed(2) //本月收益
this.cashMoney = parseFloat(res.data.cashMoney).toFixed(2) //本月提现
}
});
},
getshanghuinfo() {
let data = {
shopId: uni.getStorageSync('shopId')
}
this.$Request.get("/app/shop/selectShopMessage", data).then(res => {
if (res.code == 0) {
uni.setStorageSync('cashDeposit', res.data.cashDeposit)
}
});
},
selectShop(e) {
this.shop = e
this.show = false
},
goNav(url) {
if (this.shopToken) {
// #ifdef MP-WEIXIN
if (uni.getStorageSync('sendindexMsg')) {
uni.requestSubscribeMessage({
tmplIds: this.arr,
success(re) {
// console.log(re,'**********')
var datas = JSON.stringify(re);
if (datas.indexOf("accept") != -1) {
console.log(re)
}
},
fail: (res) => {
console.log(res)
}
})
}
// #endif
uni.navigateTo({
url
})
} else {
uni.navigateTo({
url: '/pages/my/loginphone'
})
}
},
getUserInfo() {
this.$Request.getA("/sys/user/info").then(res => {
if (res.code == 0) {
this.shopName = res.user.shopList[0].shopName
this.shopCover = res.user.shopList[0].shopCover ? res.user.shopList[0].shopCover :
'../../static/logo.png'
this.$queue.setData('avatar',res.user.shopList[0].shopCover);
this.$queue.setData("userId", res.user.userId);
this.$queue.setData("shopId", res.user.shopList[0].shopId);
this.$queue.setData("mobile", res.user.mobile);
this.$queue.setData("shopUserName", res.user.shopList[0].shopName);
if (res.user.userEntity) {
this.$queue.setData("zhiFuBao", res.user.userEntity.zhiFuBao);
this.$queue.setData("zhiFuBaoName", res.user.userEntity.zhiFuBaoName);
}
}
});
},
}
}
</script>
<style lang="scss">
page {
background-color: #F2F2F2;
}
.bg {
background: #FFFFFF;
}
.camera {
width: 54px;
height: 44px;
&:active {
background-color: #ededed;
}
}
.btn-bg {
width: 64px;
height: 28px;
background: linear-gradient(90deg, #CDA26E 0%, #DCB78A 100%);
border-radius: 28px;
text-align: center;
line-height: 28px;
margin-top: 4px;
color: '#604320'
}
.images {
width: 18rpx;
height: 30rpx;
}
.dfs {
display: flex;
align-items: center;
}
.moneybox {
width: 690upx;
margin: 0 auto;
// height: 369upx;
// background: #2FB57A;
border-radius: 20upx 20upx 20upx 20upx;
}
.btn {
width: 160upx;
height: 60upx;
background: linear-gradient(90deg, #3D3734 0%, #252323 100%);
border-radius: 50upx;
text-align: center;
line-height: 60upx;
color: #FFFFFF;
}
.xflist {
width: 150upx;
height: 50upx;
background: #211D2C;
color: #FFFFFF;
border-radius: 5upx;
text-align: center;
line-height: 50upx;
}
.erweima {
background: #FCD202;
padding: 5px 10px;
border-radius: 20px;
}
.bott {
background: red;
color: #ffffff;
width: 30upx;
height: 30upx;
text-align: center;
line-height: 26upx;
padding: 5rpx;
border-radius: 60%;
font-size: 23rpx;
margin-right: 15rpx;
}
</style>

201
pages/my/liaotian.vue Normal file
View File

@@ -0,0 +1,201 @@
<template>
<view class="">
<!-- <view v-if="msgList.length" class="margin-topW">
<view class="flex padding-tb radius padding-lr-sm bg" @click="goMsg" v-for="(item,index) in msgList"
:key='index'>
<view>
<image style="width: 80rpx;height: 80rpx;border-radius: 80rpx;"
src="../../static/images/msg/msg.png"></image>
</view>
<view class="flex-sub margin-left-sm">
<view class="flex justify-between">
<view class="text-white">{{item.title?item.title: '系统消息'}}</view>
<view v-if="messageCount>0"
style="height: 32rpx;width: 32rpx;border-radius: 100rpx;background-color: red;color: #FFF;text-align: center;">
{{messageCount}}</view>
</view>
<view>
<view class="text-grey">{{item.content}}</view>
</view>
</view>
</view>
</view> -->
<view v-if="chatList.length" class="content ">
<view class="radius padding-lr-sm bg" style="margin-top: 4rpx;" @click="goIM(item)"
v-for="(item,index) in chatList" :key='index' >
<view class="flex padding-tb " v-if="userId == item.userId">
<view>
<u-image shape="circle" width='80rpx' height="80rpx" :src="item.shopCover"></u-image>
</view>
<view class="flex-sub margin-left-sm">
<view class="flex justify-between">
<view style="width: 50%;">{{item.shopName}}</view>
<view class="text-grey">{{item.createTime}}</view>
</view>
<view class="flex justify-between">
<view class="text-grey">{{ item.messageType == 1? item.content : '[图片]'}}</view>
<view v-if="item.shopUnread"
style="height: 32rpx;width: 32rpx;border-radius: 100rpx;background-color: red;color: #FFF;text-align: center;">
{{item.shopUnread}}</view>
</view>
</view>
</view>
<view class="flex padding-tb" v-else>
<view>
<u-image shape="circle" width='80rpx' height="80rpx" :src="item.shopCover"></u-image>
</view>
<view class="flex-sub margin-left-sm">
<view class="flex justify-between">
<view style="width: 50%;">{{item.shopName}}</view>
<view class="text-grey">{{item.createTime}}</view>
</view>
<view class="flex justify-between">
<view class="text-grey">{{ item.messageType == 1? item.content : '[图片]'}}</view>
<view v-if="item.shopUnread"
style="height: 32rpx;width: 32rpx;border-radius: 100rpx;background-color: red;color: #FFF;text-align: center;">
{{item.shopUnread}}</view>
</view>
</view>
</view>
</view>
</view>
<empty v-if="!chatList.length && !msgList.length" content='暂无消息'></empty>
</view>
</template>
<script>
import empty from '../../components/empty.vue'
export default {
components: {
empty
},
data() {
return {
page: 1,
limit: 20,
chatList: [],
userId: '',
msgList: [],
time: '',
count: 0,
messageCount: 0
}
},
onLoad() {
this.getChatList()
let that = this
that.userId = uni.getStorageSync('userId')
if (that.userId) {
that.time = setInterval(function() {
that.getChatList()
// that.getMsgList()
that.$nextTick(function() {
that.messageCount = uni.getStorageSync('messageCount')
})
}, 10000)
} else {
that.chatList = []
that.msgList = []
}
},
onShow() {
let that = this
that.page = 1;
// that.chatList = []
// that.msgList = []
that.getChatList();
// let that = this
// that.userId = uni.getStorageSync('userId')
// if (that.userId) {
// that.time = setInterval(function() {
// that.getChatList()
// // that.getMsgList()
// that.$nextTick(function() {
// that.messageCount = uni.getStorageSync('messageCount')
// })
// }, 10000)
// } else {
// that.chatList = []
// that.msgList = []
// }
},
onHide() {
clearInterval(this.time)
},
methods: {
getChatList() {
this.$Request.get("/shop/ordersChat/selectOrdersChatPageShop", {
page: this.page,
limit: this.limit,
shopId: uni.getStorageSync('shopId')
}).then(res => {
if (res.code == 0) {
if (this.page == 1) {
this.chatList = [];
}
res.data.list.forEach(d => {
this.chatList.push(d);
});
this.count = res.data.totalCount;
// this.chatList = res.data.list
}
});
},
// getMsgList() {
// this.$Request.get("/app/message/selectMessageByUserIdLimit1").then(res => {
// if (res.code == 0) {
// this.msgList = res.data.list
// }
// });
// },
goIM(e) {
let userId = this.$queue.getData('userId');
if (e.userId == userId) {
userId = e.byUserId
} else {
userId = e.userId
}
uni.navigateTo({
url: '/pages/my/im?orderId=' + e.ordersId
})
// uni.navigateTo({
// url: '/pages/msg/im?chatConversationId=' + e.chatConversationId + '&byUserId=' + userId
// })
},
goMsg() {
uni.navigateTo({
url: '/pages/msg/message'
})
}
},
onReachBottom: function() {
if (this.chatList.length == this.count) {
uni.showToast({
title: '已经到底了',
icon: 'none'
})
} else {
this.page = this.page + 1;
this.getChatList();
}
}
}
</script>
<style>
page {
background-color: #F7F7F7;
}
.bg {
background: #FFFFFF;
}
</style>

407
pages/my/loginphone.vue Normal file
View File

@@ -0,0 +1,407 @@
<template>
<view class="container">
<view class="wrapper">
<view style="padding-left:60upx;" class="margin-tb-lg">
<view style="color:#333333;font-size:42upx;">商户登录体验更多功能</view>
<view style="color:#999999" class="text-sm margin-top-xs">未入驻过的请先申请入驻账号</view>
</view>
<view class="input-content">
<view class="cu-form-group margin-top" style="border-bottom: 1px solid #E6E6E6;">
<!-- <view class="title text-black">账号</view> -->
<input type="text" :value="phone" placeholder="请输入账号" maxlength="11" data-key="phone"
@input="inputChange" />
</view>
<view class="cu-form-group margin-top" style="border-bottom: 1px solid #E6E6E6;">
<!-- <view class="title text-black">密码</view> -->
<input type="password" placeholder="请输入密码" maxlength="20" :value="password" data-key="password"
@input="inputChange" @confirm="toLogin" />
<!-- <text class="send-msg" @click="forget">忘记密码</text> -->
</view>
<view class="cu-form-group flex justify-between align-center margin-top"
style="border-bottom: 1px solid #E6E6E6;">
<view>
<!-- <view class="title text-black">验证码</view> -->
<input type="text" placeholder="请输入图片验证码" maxlength="20" :value="captcha" data-key="captcha"
@input="inputChange" @confirm="toLogin" />
</view>
<view>
<image @click="getCaptcha" :src="captchaPath" style="width:160upx;height:64upx;"></image>
</view>
</view>
</view>
<button class="confirm-btn" @click="toLogin">立即登录</button>
<view class="flex">
<view class="ruzhu" @click="bindchat()">联系客服</view>
<!-- <view class="ruzhu" @click="xiupwd()">修改密码</view> -->
<view class="ruzhu" @click="show = true" v-if="XCXIsSelect != '否'">商家入驻</view>
</view>
<!-- <view class="ruzhu" @click="bindRuzhu()">商家入驻</view> -->
<!-- <view class="ruzhu" @click="show = true">商家入驻</view> -->
</view>
<!---->
<!-- 入驻弹框 -->
<u-popup v-model="show" mode="center" border-radius="14" width="500rpx" height="350rpx" closeable="true">
<view class="padding text-center">
<view class="padding-top margin-top-sm text-lg" @click="bindRuzhu()">商家申请入驻</view>
<view class="padding-top text-lg" @click="bindRuzhus()">商家信息修改</view>
<view class="text-sm text-gray margin-top-xs">申请入驻后修改入驻信息</view>
</view>
</u-popup>
</view>
</template>
<script>
import configurl from '../../common/config.js'
export default {
data() {
return {
openId:'',
weixinPhone: true,
phone: '',
password: '',
banners: [],
invitation: '',
loginName: '',
sending: false,
sendTime: '获取验证码',
count: 60,
captcha: '',
captchaPath: '',
uuid: '',
show: false,
open: true,
XCXIsSelect: '是',
}
},
onLoad() {
this.getCaptcha()
this.XCXIsSelect = this.$queue.getData("XCXIsSelect");
},
methods: {
//登录
login() {
let that = this;
// 1.wx获取登录用户code
uni.login({
provider: 'weixin',
success: function(loginRes) {
console.log(loginRes, '************')
let data = {
code: loginRes.code,
}
that.$Request.get('/app/Login/wxShopLogin', data).then(res => {
if (res.code == 0) {
uni.hideLoading()
that.openId = res.data.open_id;
that.xcxtoLogin();
// uni.setStorageSync('openId', res.data.open_id)
// uni.setStorageSync('unionId', res.data.unionId)
} else {
uni.showToast({
icon: 'none',
title: res.msg,
duration: 2000
});
console.log(res, '失败')
}
})
}
});
},
//修改密码
xiupwd() {
uni.navigateTo({
url: '/pages/my/pwd'
})
},
// 商家入驻引导弹框
bindshangjia() {
uni.showModal({
title: '提示',
content: '请前往同城外卖用户端【我的-商家入驻】进行入驻,再返回商家登录',
success: function(res) {
if (res.confirm) {
console.log('用户点击确定');
// #ifdef MP-WEIXIN
wx.navigateToMiniProgram({
appId: 'wxd6a3bf45c999d9cd',
path: '/pages/index/index',
envVersion: 'release', // 打开正式版
success(res) {
// 打开成功
},
fail: function(err) {
console.log(err);
}
})
// #endif
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
},
//联系客服
bindchat() {
uni.navigateTo({
url: '/my/other/customer'
})
},
//申请商户入驻
bindRuzhu() {
this.show = false;
uni.navigateTo({
url: '/my/publish/index'
})
},
bindRuzhus() {
this.show = false;
uni.navigateTo({
url: '/pages/my/phoneSettled'
})
},
// 获取验证码
getCaptcha() {
this.uuid = this.$queue.getUUID()
// this.captchaPath = this.$http.adornUrl(`/captcha.jpg?uuid=${this.uuid}`)
// this.captchaPath = this.$Request.getA('/captcha.jpg?uuid='+this.uuid).then(res => {
// });
console.log(this.uuid)
uni.downloadFile({
// url: 'https://diancanshop.xianmxkj.com/sqx_fast/captcha.jpg?uuid=' + this.uuid,
// url: 'https://tcwm.xianmaxiong.com/sqx_fast/captcha.jpg?uuid=' + this.uuid,
url: configurl.APIHOST + '/captcha.jpg?uuid=' + this.uuid,
success: (res) => {
console.log(res)
this.captchaPath = res.tempFilePath
}
})
},
forget() {
uni.navigateTo({
url: '/pages/my/forgetPwd'
});
},
register() {
uni.navigateTo({
url: '/pages/public/register'
});
},
inputChange(e) {
const key = e.currentTarget.dataset.key;
this[key] = e.detail.value;
},
navBack() {
uni.navigateBack();
},
xcxtoLogin() {
let that = this
that.$queue.loginClear();
let openid = that.$queue.getData("openid");
const {
phone,
password,
captcha
} = that;
if (!phone) {
that.$queue.showToast("请输入门店管理员账号");
} else if (!password) {
that.$queue.showToast("请输入门店管理员密码");
} else if (!captcha) {
that.$queue.showToast("请输入图片验证码");
} else {
that.$queue.showLoading("正在登录中...");
that.$Request.postJsonA("/sys/login", {
password: password,
username: phone,
captcha: captcha,
uuid: that.uuid,
openId: that.openId
}).then(res => {
if (res.code == 0) {
that.$queue.setData("shopToken", res.token);
uni.hideLoading()
setTimeout(function() {
that.getUserInfo()
}, 10)
} else {
that.getCaptcha()
uni.hideLoading();
that.$queue.showToast(res.msg);
}
});
}
},
toLogin() {
let that = this
that.$queue.loginClear();
let openid = that.$queue.getData("openid");
const {
phone,
password,
captcha
} = that;
if (!phone) {
that.$queue.showToast("请输入门店管理员账号");
} else if (!password) {
that.$queue.showToast("请输入门店管理员密码");
} else if (!captcha) {
that.$queue.showToast("请输入图片验证码");
} else {
// #ifdef MP-WEIXIN
that.login();
// #endif
// #ifndef MP-WEIXIN
that.$queue.showLoading("正在登录中...");
that.$Request.postJsonA("/sys/login", {
password: password,
username: phone,
captcha: captcha,
uuid: that.uuid,
}).then(res => {
if (res.code == 0) {
that.$queue.setData("shopToken", res.token);
uni.hideLoading()
setTimeout(function() {
that.getUserInfo()
}, 10)
} else {
that.getCaptcha()
uni.hideLoading();
that.$queue.showToast(res.msg);
}
});
// #endif
}
},
getUserInfo() {
this.$Request.getA("/sys/user/info").then(res => {
if (res.code == 0) {
this.$queue.setData("userId", res.user.userId);
this.$queue.setData("shopId", res.user.shopList[0].shopId);
this.$queue.setData("mobile", res.user.mobile);
if (res.user.userEntity && res.user.userEntity.openId) {
this.$queue.setData("openId", res.user.userEntity.openId);
}
// #ifdef APP-PLUS
if (uni.getSystemInfoSync().platform == 'android') {
let clientid = plus.push.getClientInfo().clientid;
let userId = this.$queue.getData('userId');
if (userId) {
this.$Request.postT('/user/updateShopClientId?clientId=' + clientid).then(
red => {});
}
}
//#endif
// uni.navigateBack()
// this.$queue.setData("avatar", res.user.avatar);
// this.$queue.setData("invitationCode", res.user.invitationCode);
this.$queue.setData("open", this.open);
uni.switchTab({
url: '/pages/my/index'
})
}
});
},
// getIsVip() {
// this.$Request.get("/app/UserVip/isUserVip").then(res => {
// if (res.code == 0) {
// // this.isVip = res.data
// console.log(res.data)
// this.$queue.setData("isVip", res.data);
// }
// });
// }
},
}
</script>
<style lang='scss'>
page {
height: 100%;
background: #FFFFFF !important;
}
.send-msg {
border-radius: 30px;
/* color: black; */
background: white;
height: 30px;
font-size: 14px;
line-height: 30px;
}
.container {
top: 0;
padding-top: 32upx;
position: relative;
width: 100%;
height: 100%;
overflow: hidden;
/* background: #1E1F31 !important; */
}
.wrapper {
position: relative;
z-index: 90;
/* background: #1E1F31; */
padding-bottom: 32upx;
}
.input-content {
/* margin-top: 300upx; */
/* padding-top: 300upx; */
padding: 40upx 60upx;
}
.confirm-btn {
width: 600upx;
line-height: 88upx;
height: 88upx;
border-radius: 10upx;
margin-top: 32upx;
background: #FCD202;
/* color: #fff; */
font-size: 32upx;
&:after {
border-radius: 10px;
}
}
.ruzhu {
width: 100%;
text-align: center;
color: #999999;
margin-top: 20upx;
}
.padding-top {
margin: 32upx 0;
background: #FCD202;
height: 72rpx;
/* line-height: 80rpx; */
padding: 13rpx 0;
font-size: 34rpx;
}
.margin-top-sm {
margin-top: 50rpx;
}
</style>

219
pages/my/phoneSettled.vue Normal file
View File

@@ -0,0 +1,219 @@
<template>
<view class="container">
<view class="wrapper">
<view style="padding-left:60upx;" class="margin-tb-lg">
<view style="color:#333333;font-size:42upx;">商户登录体验更多功能</view>
<view style="color:#999999" class="text-sm margin-top-xs">商户入驻信息修改获取已入驻的信息</view>
</view>
<view class="input-content">
<view class="cu-form-group margin-top" style="border-bottom: 1px solid #E6E6E6;">
<input type="text" :value="phone" placeholder="请输入入驻提交的手机号码" maxlength="11" data-key="phone"
@input="inputChange" />
</view>
<view class="cu-form-group margin-top" style="border-bottom: 1px solid #E6E6E6;">
<input type="number" placeholder="请输入验证码" maxlength="6" v-model="codes" @input="inputChange"
@confirm="toLogin" />
<button class="send-msg" @click="sendMsg">{{sendTime}}</button>
</view>
</view>
<button class="confirm-btn" @click="toLogin">立即查询</button>
</view>
</view>
</template>
<script>
export default {
data() {
return {
phone: '',
codes: '',
banners: [],
invitation: '',
loginName: '',
sending: false,
sendTime: '获取验证码',
count: 60,
captcha: '',
captchaPath: '',
uuid: '',
show: false
}
},
onLoad() {
// this.getCaptcha()
},
methods: {
//申请商户入驻
bindRuzhu() {
uni.navigateTo({
url: '/my/publish/index'
})
},
bindRuzhus() {
uni.navigateTo({
url: '/pages/my/phoneSettled'
})
},
// 获取验证码
sendMsg() {
const {
phone
} = this;
if (!phone) {
this.$queue.showToast("请输入手机号");
} else if (phone.length !== 11) {
this.$queue.showToast("请输入正确的手机号");
} else {
this.$queue.showLoading("正在发送验证码...");
this.$Request.getT("/app/Login/sendMsg/" + phone + "/selectShop").then(res => {
if (res.code === 0) {
this.sending = true;
this.$queue.showToast('验证码发送成功请注意查收');
this.countDown();
uni.hideLoading();
} else {
uni.hideLoading();
uni.showModal({
showCancel: false,
title: '短信发送失败',
content: res.msg ? res.msg : '请一分钟后再获取验证码'
});
}
});
}
},
countDown() {
const {
count
} = this;
if (count === 1) {
this.count = 60;
this.sending = false;
this.sendTime = '获取验证码'
} else {
this.count = count - 1;
this.sending = true;
this.sendTime = count - 1 + '秒后重新获取';
setTimeout(this.countDown.bind(this), 1000);
}
},
forget() {
uni.navigateTo({
url: '/pages/public/forgetPwd'
});
},
register() {
uni.navigateTo({
url: '/pages/public/register'
});
},
inputChange(e) {
const key = e.currentTarget.dataset.key;
this[key] = e.detail.value;
},
navBack() {
uni.navigateBack();
},
toLogin() {
// 获取入驻信息
const {
phone,
codes
} = this;
console.log(phone, codes)
if (!phone) {
this.$queue.showToast("请输入手机号");
} else if (phone.length !== 11) {
this.$queue.showToast("请输入正确的手机号");
} else if (!codes) {
this.$queue.showToast("请输入六位数验证码");
} else {
let data = {
msg: codes,
phone: phone
}
this.$Request.getA("/admin/goodsShop/selectGoodsShop", data).then(res => {
if (res.code == 0 && res.data) {
//0待审核 1通过 (你就可以直接弹框提示 您已审核通过,点击跳转登录)类似这种 2拒绝的话 就让他修改信息
if (res.data.status == 1) {
this.$queue.showToast('您已审核通过,可以直接登录!');
} else {
uni.setStorageSync("Settedlist", res.data)
uni.navigateTo({
url: '/my/publish/index'
})
}
} else {
this.$queue.showToast(res.msg);
}
});
}
}
},
}
</script>
<style lang='scss'>
page {
height: 100%;
background: #FFFFFF !important;
}
.send-msg {
border-radius: 30px;
/* color: #FFFFFF; */
background: #FCD202;
height: 30px;
font-size: 14px;
line-height: 30px;
}
.container {
top: 0;
padding-top: 32upx;
position: relative;
width: 100%;
height: 100%;
overflow: hidden;
/* background: #1E1F31 !important; */
}
.wrapper {
position: relative;
z-index: 90;
/* background: #1E1F31; */
padding-bottom: 32upx;
}
.input-content {
/* margin-top: 300upx; */
/* padding-top: 300upx; */
padding: 40upx 60upx;
}
.confirm-btn {
width: 600upx;
line-height: 88upx;
height: 88upx;
border-radius: 10upx;
margin-top: 32upx;
background: #FCD202;
/* color: #fff; */
font-size: 32upx;
&:after {
border-radius: 10px;
}
}
.ruzhu {
width: 100%;
text-align: center;
color: #999999;
margin-top: 20upx;
}
</style>

196
pages/my/pwd.vue Normal file
View File

@@ -0,0 +1,196 @@
<template>
<view class="container">
<view class="wrapper">
<view class="input-content">
<!-- <view class="cu-form-group" style="border: 2upx solid whitesmoke;margin-bottom: 20px;border-radius: 30px">
<text class="title">旧密码</text>
<input type="password" :value="oldPwd" placeholder="请输入旧密码" placeholder-class="input-empty" maxlength="20"
minlength="6" data-key="oldpassword" @input="inputChange" @confirm="toLogin" />
</view> -->
<view class="cu-form-group"
style="border: 2upx solid whitesmoke;margin-bottom: 20px;border-radius: 30px">
<text class="title">新密码</text>
<input type="password" :value="pwd" placeholder="请设置新密码" placeholder-class="input-empty"
maxlength="6" minlength="6" data-key="password" @input="inputChange" />
</view>
<view class="cu-form-group"
style="border: 2upx solid whitesmoke;margin-bottom: 20px;border-radius: 30px">
<text class="title">确认密码</text>
<input type="password" :value="newpwd" placeholder="请设置新密码" placeholder-class="input-empty"
maxlength="6" minlength="6" data-key="password" @input="inputChanges" />
</view>
</view>
<button class="confirm-btn" @click="toLogin">修改密码</button>
</view>
</view>
</template>
<script>
export default {
data() {
return {
code: '',
phone: '',
password: '',
oldpassword: '',
sending: false,
sendTime: '获取验证码',
count: 60,
logining: false,
oldPwd: '',
pwd: '',
newpwd: '',
username: ''
}
},
onLoad() {
this.getUserInfo()
},
methods: {
getUserInfo() {
this.$Request.getA("/sys/user/info").then(res => {
if (res.code == 0) {
this.phone = res.user.mobile
this.salt = res.user.salt
this.username = res.user.username
}
});
},
sendMsg() {
const {
phone
} = this;
if (!phone) {
this.$queue.showToast("请输入手机号");
} else if (phone.length !== 11) {
this.$queue.showToast("请输入正确的手机号");
} else {
this.$queue.showLoading("正在发送验证码...");
this.$Request.getT('/appLogin/sendMsg/' + phone + '/forget').then(res => {
if (res.code === 0) {
this.sending = true;
this.$queue.showToast('验证码发送成功请注意查收');
this.countDown();
uni.hideLoading();
} else {
uni.hideLoading();
uni.showModal({
showCancel: false,
title: '短信发送失败',
content: res.msg ? res.msg : '请一分钟后再获取验证码'
});
}
});
}
},
countDown() {
const {
count
} = this;
if (count === 1) {
this.count = 60;
this.sending = false;
this.sendTime = '获取验证码'
} else {
this.count = count - 1;
this.sending = true;
this.sendTime = count - 1 + '秒后重新获取';
setTimeout(this.countDown.bind(this), 1000);
}
},
inputChange(e) {
// console.log(e, '----------')
const key = e.currentTarget.dataset.key;
this.pwd = e.detail.value;
},
inputChanges(e) {
// console.log(e, '----------')
const key = e.currentTarget.dataset.key;
this.newpwd = e.detail.value;
},
navBack() {
uni.navigateBack();
},
toLogin() {
console.log(this.pwd.length)
if (this.pwd.length != 6) {
this.$queue.showToast("请输入六位数密码");
} else if (this.newpwd.length != 6) {
this.$queue.showToast("请再次输入六位数密码");
} else if (this.pwd != this.newpwd) {
this.$queue.showToast("密码不一致");
} else {
this.logining = true;
this.$queue.showLoading("正在修改密码中...");
let data = {
mobile: this.phone,
password: this.pwd,
salt: this.salt,
username: this.username
}
this.$Request.postJson("/sys/user/updateShop", data).then(res => {
uni.hideLoading();
if (res.code === 0) {
this.$queue.showToast('密码修改成功!下次请使用新密码登录!')
setTimeout(function() {
uni.navigateBack()
}, 1000)
} else {
uni.showModal({
showCancel: false,
title: '密码修改失败',
content: res.msg,
});
}
});
}
},
},
}
</script>
<style lang='scss'>
page {
height: 100%;
background: #FFFFFF !important;
}
.container {
/* padding-top: 32upx; */
position: relative;
width: 100%;
height: 100%;
overflow: hidden;
background: #FFFFFF !important;
}
.wrapper {
position: relative;
z-index: 90;
background: #ffffff;
padding-bottom: 20px;
}
.input-content {
padding: 32upx 80upx;
}
.confirm-btn {
width: 600upx;
height: 80upx;
line-height: 80upx;
border-radius: 60upx;
margin-top: 32upx;
background: #FCD202;
/* color: #fff; */
font-size: 32upx;
&:after {
border-radius: 60px;
}
}
</style>

308
pages/my/userinfo.vue Normal file
View File

@@ -0,0 +1,308 @@
<template>
<view>
<view class="usermain">
<view class="usermain-item ">
<view>头像</view>
<view @click="uploadImg()">
<image src="../../static/logo.png" v-if="avatar==null" mode=""
style="width: 111rpx;height: 111rpx;border-radius: 50%;"></image>
<image v-else :src="avatar" mode="" style="width: 111rpx;height: 111rpx;border-radius: 50%;">
</image>
</view>
</view>
<view class="usermain-item item-padding ">
<view>用户名</view>
<view>
<view class="cu-form-group">
<input v-model="userName" placeholder="请输入用户名" />
</view>
</view>
</view>
<view class="usermain-item item-padding ">
<view>年龄</view>
<view>
<view class="cu-form-group">
<input v-model="age" />
</view>
</view>
</view>
<!-- <view class="usermain-item item-padding">
<view >姓名</view>
<view class="cu-form-group">
<input v-model="realName" placeholder="请填写您的真实姓名" />
</view>
</view> -->
<view class="usermain-item item-padding ">
<view>手机</view>
<view>
<view class="cu-form-group">
<input v-model="phone" placeholder="请输入联系电话" />
</view>
</view>
</view>
<view class="usermain-item item-padding ">
<view>性别</view>
<view>
<view class="cu-form-group">
<u-radio-group v-model="sex">
<u-radio shape="circle" active-color="#2FB57A" :name="1" ></u-radio>
<u-radio shape="circle" active-color="#2FB57A" :name="2" ></u-radio>
</u-radio-group>
</view>
</view>
</view>
</view>
<view class="footer-btn">
<view class="usermain-btn" @click="messagebtn()">保存</view>
</view>
</view>
</template>
<script>
import configdata from '../../common/config.js';
export default {
data() {
return {
phone: '',
avatar: '../../static/logo.png',
userName: '',
nickName: '',
userId: '',
realName: '',
weChatId: "",
password: '',
platform: '',
createTime: '',
money: '',
jiFen: '',
status: '',
zhiFuBao: '',
zhiFuBaoName: '',
sex:1,
age: 0
};
},
onLoad(e) {
this.getUserInfo()
// this.avatar = uni.getStorageSync('avatar')
},
methods: {
goMyAddress() {
uni.navigateTo({
url: '../jifen/myaddress'
});
},
uploadImg() {
let token = uni.getStorageSync('token')
if (!token) {
this.goLoginInfo();
return;
}
let that = this;
var url = null;
uni.showActionSheet({
// itemList按钮的文字接受的是数组
itemList: ["查看头像", "从相册选择图片"],
success(e) {
var index = e.tapIndex
if (index === 0) {
// 用户点击了预览当前图片
// 可以自己实现当前头像链接的读取
let url = that.avatar;
let arr = []
arr.push(url)
uni.previewImage({
// 预览功能图片也必须是数组的
urls: arr
})
} else if (index === 1) {
uni.chooseImage({
count: 1, //默认9
sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
sourceType: ['album'], //从相册选择
success: function(res) {
uni.showLoading({
title: '上传中...'
});
let token = uni.getStorageSync('token');
let userId = uni.getStorageSync('userId');
uni.uploadFile({
url: that.config("APIHOST1") + '/alioss/upload', //真实的接口地址
filePath: res.tempFilePaths[0],
header: {
token: token
},
name: 'file',
success: uploadFileRes => {
url = JSON.parse(uploadFileRes.data);
that.avatar = url.data
uni.hideLoading();
}
});
}
});
}
}
})
},
config: function(name) {
var info = null;
if (name) {
var name2 = name.split("."); //字符分割
if (name2.length > 1) {
info = configdata[name2[0]][name2[1]] || null;
} else {
info = configdata[name] || null;
}
if (info == null) {
let web_config = cache.get("web_config");
if (web_config) {
if (name2.length > 1) {
info = web_config[name2[0]][name2[1]] || null;
} else {
info = web_config[name] || null;
}
}
}
}
return info;
},
getUserInfo() {
// let userId = uni.getStorageSync('userId')
this.$Request.get("/sys/user/info").then(res => {
if (res.code == 0) {
this.$queue.setData('avatar', res.user.userEntity.avatar);
this.$queue.setData('userId', res.user.userId);
this.$queue.setData('userName', res.user.userEntity.userName);
this.$queue.setData('phone', res.user.userEntity.phone);
this.$queue.setData('age', res.user.userEntity.age);
this.sex = res.user.userEntity.sex
this.age = res.user.userEntity.age
this.phone = res.user.userEntity.phone;
this.avatar = res.user.userEntity.avatar;
this.userName = res.user.userEntity.userName;
if (this.userName == null) {
this.userName = res.user.userEntity.nickName;
} else {
this.userName = res.user.userEntity.userName;
}
}
uni.hideLoading();
});
},
// 保存
messagebtn() {
let that = this
if (!that.userName) {
// this.$queue.showToast('用户名不能为空');
uni.showToast({
title: "用户名不能为空",
icon: "none"
})
} else if (!that.phone) {
// this.$queue.showToast('用户名不能为空');
uni.showToast({
title: "联系电话不能为空",
icon: "none"
})
} else {
uni.showModal({
title: '温馨提示',
content: '确定保存信息',
success: e => {
if (e.confirm) {
that.$Request.postJson("/shop/shopmoney/updateUser", {
userName: that.userName,
avatar: that.avatar,
phone: that.phone,
sex: that.sex,
age:that.age
}).then(res => {
if (res.code === 0) {
uni.showToast({
title: '保存成功',
icon: "none"
})
setTimeout(function() {
uni.navigateBack()
}, 1000)
} else {
uni.showToast({
title: res.msg,
icon: "none"
})
}
})
}
}
});
}
}
},
// userphone(){
// uni.navigateTo({
// url:'/pages/my/userphone'
// })
// }
};
</script>
<style>
page {
/* background: #1c1b20; */
}
.usermain {
background: #ffffff;
/* color: #fff; */
}
.usermain-item {
display: flex;
align-items: center;
margin: 0 40rpx;
padding: 10rpx 0;
justify-content: space-between;
border-bottom: 1rpx solid #e5e5e5;
/* border-bottom: 2rpx solid #f2f2f2; */
}
.usermain-item.item-padding {
/* padding: 0; */
}
.cu-form-group {
padding: 0;
background: #ffffff;
text-align: right;
}
.cu-form-group input {
background: #ffffff;
font-size: 28rpx;
/* color: #fff; */
}
.footer-btn {
margin-top: 150rpx;
}
.footer-btn .usermain-btn {
/* color: #FFFFFF; */
background: #FCD202;
text-align: center;
width: 450rpx;
height: 80rpx;
font-size: 28rpx;
line-height: 80rpx;
margin: 0 auto;
border-radius: 40rpx;
}
</style>

816
pages/order/detail.vue Normal file
View File

@@ -0,0 +1,816 @@
<template>
<view class="order_details">
<!-- 待支付 -->
<view class="part_one">
<view>
<!-- 订单状态 -->
<view class="rider_order" v-if="orderDetails.indentState == 0">待付款</view>
<view class="rider_order"
v-if="orderDetails.indentState == 1||orderDetails.indentState ==8||orderDetails.indentState ==9||orderDetails.indentState ==10">
已取消</view>
<view class="rider_order" v-if="orderDetails.indentState == 2">待接单</view>
<view class="rider_order" v-if="orderDetails.indentState == 5">待确认</view>
<view class="rider_order" v-if="orderDetails.indentState == 3">已接单</view>
<view class="rider_order" v-if="orderDetails.indentState ==4">派送中</view>
<view class="rider_order" v-if="orderDetails.indentState ==6||orderDetails.indentState ==7">已完成
</view>
<!-- 订单提示状态 -->
<view class="rider_tit" v-if="orderDetails.indentState == 2">请耐心等待骑手接单...</view>
<view class="rider_tit" v-if="orderDetails.indentState == 0">请及时支付订单否则将自动取消</view>
<view class="rider_tit"
v-if="orderDetails.indentState ==5||orderDetails.indentState ==6||orderDetails.indentState ==7">
<text v-if="orderDetails.evaluateMessage">评价内容{{orderDetails.evaluateMessage}}</text>
<text v-else>写下您的评价感受吧</text>
</view>
<view class="rider_tit"
v-if="orderDetails.indentState == 1||orderDetails.indentState ==8||orderDetails.indentState ==9||orderDetails.indentState ==10">
订单已被您取消</view>
<view class="rider_tit" v-if="orderDetails.indentState == 3||orderDetails.indentState ==4">骑手已接单尽快为您派送
</view>
<!-- 订单按钮状态 -->
<view style="display: flex;justify-content: flex-end;margin-top: 16upx;margin-right: 20rpx;">
<view class="btn1" @tap.stop="bindcomment(orderDetails)"
v-if="orderDetails.indentState ==7||orderDetails.indentState == 6&&!orderDetails.evaluateMessage">
去评论
</view>
<view class="btn1" v-if="orderDetails.indentState == 0||orderDetails.indentState == 2"
@tap.stop="bindorderOff(orderDetails)">取消订单</view>
<view class="btn1" @tap.stop="bindconfirm(orderDetails)" v-if="orderDetails.indentState == 5">确认订单
</view>
<view class="btn2" @tap.stop="bindorder(orderDetails)"
v-if="orderDetails.indentState == 1||orderDetails.indentState == 3||orderDetails.indentState ==8||
orderDetails.indentState ==9||orderDetails.indentState ==10||orderDetails.indentState == 4||orderDetails.indentState == 6">再来一单</view>
<view class="btn2" v-if="orderDetails.indentState == 0" @tap.stop="bindorderpay(orderDetails)">立即付款
</view>
</view>
</view>
</view>
<!-- 购买时间 -->
<view class="five_box" style="padding: 30rpx 30rpx;font-size: 30upx;">
<text>预约时间</text>
<text style="font-weight: bold;">{{orderDetails.sendOutTime}}</text>
</view>
<map v-if="orderDetails.indentState == 4 && latitude && longitude" id="map" @tap="goMap"
style="width: 95%; height: 300rpx;margin: 20rpx auto 0;" :markers="markers" :latitude="latitude"
:longitude="longitude"></map>
<!-- 同城购买-->
<view class="part_three" v-if="orderDetails.indentType == 3">
<view class="city_pay">
<view class="city_box">同城购买</view>
<text v-if="orderDetails.buyType == 0">就近购买</text>
<text v-else>指定购买</text>
</view>
<view class="pay_tit">{{orderDetails.productDetails}}</view>
</view>
<!-- 同城服务-->
<view class="part_three" v-if="orderDetails.indentType == 4">
<view class="city_pay">
<view class="city_box">同城服务</view>
<text>{{orderDetails.serviceType}}</text>
</view>
<view class="pay_tit">{{orderDetails.serviceDetails}}</view>
</view>
<!-- 骑手商家地址 -->
<view class="part_four">
<view class="city_pay" v-if="orderDetails.indentType !=3&&orderDetails.indentType !=4">
<view class="city_box" v-if="orderDetails.indentType == 1">帮我送</view>
<view class="city_box" v-if="orderDetails.indentType == 2">帮我取</view>
<text>{{orderDetails.itemType}}</text>
</view>
<view v-if="orderDetails.indentType !=3&&orderDetails.indentType != 4">
<u-line color="#F2F2F2" />
</view>
<!-- 发货地址 -->
<view class="one_box" v-if="orderDetails.indentType != 4" style="margin-top: 30rpx;">
<view class="box_dian">
<image src="../../../static/image/mai.png" v-if="orderDetails.indentType == 3"></image>
<image src="../../../static/image/icon_f.png" v-else></image>
</view>
<view class="box_addres">
<view class="add">
{{orderDetails.shipAddress?orderDetails.shipAddress:''}}{{orderDetails.shipAddressDetail}}
</view>
<view class="num">
<view class="name" v-if="orderDetails.indentType !=3">
{{orderDetails.shipUserName}} <text>{{orderDetails.shipUserPhone}}</text>
<!-- <view class="phone_bd" @click="bindphone(0)">拨打</view> -->
</view>
<view class="name" v-else>暂无信息</view>
</view>
</view>
</view>
<!-- 收获地址 -->
<view class="one_box" style="margin-top: 20rpx;margin-bottom: 30rpx;">
<view class="box_dian">
<image src="../../../static/image/icon_s.png"></image>
</view>
<view class="box_addres">
<view class="add">{{orderDetails.deliveryAddress}}{{orderDetails.deilveryAddressDetail}}</view>
<view class="num">
<view class="name">
{{orderDetails.deliveryUserName}}<text>{{orderDetails.deliveryUserPhone}}</text>
<!-- <view class="phone_bd" @click="bindphone()">联系TA</view> -->
</view>
</view>
</view>
</view>
<u-line color="#F2F2F2" />
<view class="address_pay">
<view class="runing_pay">
预估跑腿费
</view>
<view class="runing_distance">
<text v-if="orderDetails.distance">{{orderDetails.distance/1000}}公里</text>
<text>¥{{orderDetails.indentBasicsMoney}}</text>
</view>
</view>
</view>
<!-- 联系骑手 -->
<view class="rider_box"
v-if="orderDetails.indentState != 0&&orderDetails.indentState != 1&&orderDetails.indentState != 8&&orderDetails.indentState != 2&&orderDetails.indentState != 9&&orderDetails.indentState != 10">
<view class="flex justify-between align-center padding">
<view style="font-size: 31rpx;color: black;">联系骑手...</view>
<image @click="complaint" src="../../../static/image/order/tousu.png"
style="width: 43rpx;height: 39rpx;" mode=""></image>
</view>
<view>
<u-line color="#F2F2F2" />
</view>
<view style="padding: 20rpx 25rpx;display: flex;justify-content: space-between;align-items: center;">
<view style="display: flex;">
<view class="rider_left">
<image :src="orderDetails.avatar"></image>
</view>
<view style="margin-left: 10rpx;color: #333333;">
<view>{{orderDetails.riderNickName}}</view>
<view>{{orderDetails.phone}}</view>
</view>
</view>
<view class="phone" @click="bindphone()">联系TA</view>
</view>
</view>
<!-- 订单信息 -->
<view class="part_six">
<view class="order_info">
订单信息
</view>
<!-- 备注 -->
<view class="order_list">
<view class="order_name">订单编号</view>
<view class="order_nums">{{orderDetails.indentNumber}}</view>
</view>
<view class="order_list">
<view class="order_name">下单时间</view>
<view class="order_nums">{{orderDetails.createTime}}</view>
</view>
<view class="order_list">
<view class="order_name">支付方式</view>
<view class="order_nums">在线支付</view>
</view>
<view class="order_list" v-if="orderDetails.itemCode">
<view class="order_name" style="color: #FF6A04;">收货码</view>
<view class="order_nums" style="color: #FF6A04;">{{orderDetails.itemCode}}</view>
</view>
<view class="order_list"
v-if="orderDetails.indentType != 4&&orderDetails.indentType != 3&&orderDetails.remarks">
<view class="order_name">备注</view>
<view class="order_nums">{{orderDetails.remarks}}</view>
</view>
</view>
<!-- 订单下单详情 -->
<view class="part_sevens">
<view class="order_info">
费用说明
</view>
<view class="order_list">
<view class="order_name">预估跑腿费</view>
<view class="order_nums">¥{{orderDetails.indentBasicsMoney}}</view>
</view>
<view class="order_list" v-if="orderDetails.tip">
<view class="order_name">小费</view>
<view class="order_nums">¥{{orderDetails.tip}}</view>
</view>
<view class="order_list" v-if="orderDetails.prepayMoney">
<view class="order_name">预付价格</view>
<view class="order_nums">¥{{orderDetails.prepayMoney}}</view>
</view>
<view class="order_list" v-if="orderDetails.redPacketAmount">
<view class="order_name">红包</view>
<view class="order_nums">-¥{{orderDetails.redPacketAmount}}</view>
</view>
<view class="order_list" v-if="orderDetails.cargoInsuranceFlag == 0">
<view class="order_name">物品保价</view>
<view class="order_nums">¥{{orderDetails.cargoInsurance}}</view>
</view>
<view class="order_list">
<view class="order_name" style="color: black;font-size: 28rpx;">合计</view>
<view class="order_nums" style="color: red;font-size: 28rpx;">{{orderDetails.indentMoney}}</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
orderDetails: '',
latitude: '',
longitude: '',
markers: [], //标记点
}
},
onLoad(data) {
let that = this
console.log(data)
that.indentNumber = data.indentNumber
if (!data) {
that.orderDetails = JSON.stringify(data.data)
}
// console.log(that.orderDetails)
that.userList()
},
methods: {
getLocation(e) {
let data = {
riderUserId: e,
lat: this.orderDetails.deliveryAddressLatitude,
lng: this.orderDetails.deliveryAddressLongitude
}
this.$Request.getT('/timedtask/selectRiderLocation', data).then(res => {
if (res.code === 0) {
console.log(res.data, '经纬度')
this.latitude = res.data.riderLocation.lat;
this.longitude = res.data.riderLocation.lng;
this.markers = [{
id: 1,
latitude: res.data.riderLocation.lat,
longitude: res.data.riderLocation.lng,
iconPath: '../../static/images/order/rider.png',
width: '40',
height: '40'
}]
}
});
},
goMap() {
uni.navigateTo({
url: '/pages/order/orderDetail/orderMap?indentNumber=' + this.indentNumber
})
},
// 拨打电话
bindphone() {
uni.makePhoneCall({
phoneNumber: this.orderDetails.phone
});
},
userList() {
this.$Request.postT('/app/indent/userIndentMessage?indentNumber=' + this.indentNumber).then(res => {
console.log(res)
if (res.code == 0) {
this.orderDetails = res.data
this.getLocation(this.orderDetails.riderUserId)
}
});
},
// 再来一单
bindorder(e) {
console.log(e)
if (e.indentType == 1 || e.indentType == 2) {
let index = e.indentType
uni.navigateTo({
url: '/pages/Helpsend/Helpsend?indentNumber=' + e.indentNumber + '&index=' + index
})
} else if (e.indentType == 3) {
let index = e.indentType
let current = e.buyType
uni.navigateTo({
url: '/pages/Helppay/Helppay?indentNumber=' + e.indentNumber + '&index=' + index +
'&current=' + current
})
} else if (e.indentType == 4) {
let index = e.indentType
uni.navigateTo({
url: '/pages/Cityservice/Cityservice?indentNumber=' + e.indentNumber + '&index=' + index
})
}
},
// 去评论
bindcomment(e) {
console.log(e)
uni.navigateTo({
url: '/pages/order/comments/comments?indentNumber=' + e.indentNumber + '&riderUserId=' + e
.riderUserId
})
},
// 取消订单
bindorderOff(e) {
// console.log(e)this.orderDetails.userFine
let indentNumber = e.indentNumber
console.log(indentNumber)
uni.showModal({
title: '温馨提示',
content: '确定取消订单?',
showCancel: true,
cancelText: '取消',
confirmText: '确认',
success: res => {
if (res.confirm) {
this.$Request.postT('/app/indent/userCancleIndent?indentNumber=' + indentNumber)
.then(res => {
// console.log(res)
if (res.code == 0) {
uni.showToast({
title: '订单取消成功'
});
this.userList()
// setTimeout(function() {
// uni.navigateBack();
// }, 1000);
} else {
uni.hideLoading();
uni.showModal({
showCancel: false,
title: '订单失败',
content: res.msg
});
}
});
}
}
});
},
//确认订单
bindconfirm(e) {
// console.log(e)
let indentNumber = e.indentNumber
console.log(indentNumber)
this.$Request.postT('/app/indent/userDelivery?indentNumber=' + indentNumber).then(res => {
console.log(res)
if (res.code == 0) {
uni.showToast({
title: '订单确认成功'
});
this.userList()
// setTimeout(function() {
// uni.navigateBack();
// }, 1000);
} else {
uni.hideLoading();
uni.showModal({
showCancel: false,
title: '订单确认失败',
content: res.msg
});
}
});
},
// 立即付款
bindorderpay(e) {
console.log(e)
let indentNumber = e.indentNumber
uni.navigateTo({
url: '/pages/order/pay/pay?indentNumber=' + indentNumber
})
},
complaint() {
uni.navigateTo({
url: '/pages/order/complaint/complaint?indentNumber=' + this.orderDetails.indentNumber
})
}
}
}
</script>
<style>
body {
background: #F5F5F5;
}
/* #ifndef MP-WEIXIN */
page {
background: #F2EDED;
}
/* #endif */
.order_details {
width: 100%;
}
/* 待支付 */
.part_one {
width: 95%;
margin: 0 auto;
height: 230rpx;
background: #ffffff;
border-radius: 10rpx;
margin-top: 30rpx;
}
.city_box {
width: 110rpx;
line-height: 42rpx;
background: #c4e2ff;
color: #49A5FF;
text-align: center;
font-size: 30rpx;
height: 42rpx;
}
.city_pay {
width: 90%;
margin: 0 auto;
display: flex;
height: 80rpx;
justify-content: left;
align-items: center;
}
.city_pay text {
font-size: 30rpx;
letter-spacing: 2rpx;
margin-left: 15rpx;
}
.rider_order {
width: 90%;
margin: 0 auto;
font-size: 36rpx;
font-weight: bold;
padding-top: 20rpx;
letter-spacing: 2rpx;
}
.rider_tit {
width: 90%;
margin: 0 auto;
color: #999999;
font-size: 30upx;
margin-top: 10rpx;
letter-spacing: 2rpx;
}
.order_btn {
display: flex;
margin-top: 30rpx;
}
.close_order {
flex: 1;
display: flex;
justify-content: center;
align-items: center;
}
.close_btn {
border: 1rpx solid #CCCCCC;
width: 245rpx;
height: 70rpx;
line-height: 70rpx;
text-align: center;
border-radius: 75rpx;
font-size: 31rpx;
color: #999999;
letter-spacing: 2rpx;
}
.tip_order {
flex: 1;
display: flex;
justify-content: center;
align-items: center;
}
.close_tip {
width: 245rpx;
height: 70rpx;
line-height: 70rpx;
text-align: center;
border-radius: 75rpx;
font-size: 31rpx;
color: white;
letter-spacing: 2rpx;
background: #FF7F00;
}
/* 骑手商家地址 */
.part_four {
width: 95%;
margin: 0 auto;
margin-top: 20rpx;
background: #FFFFFF;
/* height: 390rpx; */
border-radius: 10rpx;
padding: 15rpx 15rpx;
}
.u-line {
border-bottom-width: 6rpx !important;
}
.one_box {
width: 100%;
/* height: 100rpx; */
/* background: #F5F5F5; */
margin: 0 auto;
border-radius: 12upx;
display: flex;
}
.box_dian {
/* flex: 1; */
width: 10%;
display: flex;
justify-content: center;
align-items: center;
}
.box_dian image {
width: 45rpx;
height: 45rpx;
}
.box_name {
flex: 5;
display: flex;
justify-content: left;
align-items: center;
color: #333333;
font-weight: 700;
}
.box_addres {
/* flex: 5; */
width: 85%;
font-size: 31rpx;
}
.add {
/* color: #333333;
font-size: 31rpx;
letter-spacing: 2upx;
font-weight: bold;
margin-top: 20upx; */
}
.name {
display: inline;
font-size: 30rpx;
color: #999999;
}
.name text {
color: #999999;
font-size: 30rpx;
margin-left: 30upx;
}
.address_pay {
display: flex;
justify-content: space-between;
width: 90%;
margin: 0 auto;
height: 80rpx;
line-height: 80rpx
}
.runing_pay {
/* flex: 1; */
color: #999999;
font-size: 30rpx;
letter-spacing: 1rpx;
}
.runing_distance {
/* flex: 1; */
color: #999999;
font-size: 30rpx;
letter-spacing: 1rpx;
text-align: end;
}
.runing_distance text {
font-size: 31rpx;
color: black;
margin-left: 35rpx;
}
/* 收货码 */
.five_box {
width: 95%;
margin: 0 auto;
background: #ffffff;
margin-top: 20rpx;
border-radius: 10rpx;
font-size: 35rpx;
display: flex;
justify-content: space-between;
}
.part_five {
/* height: 85rpx; */
display: flex;
justify-content: space-between;
padding: 20rpx 20rpx;
border-radius: 10rpx;
}
.take_number {
flex: 1;
display: flex;
justify-content: left;
align-items: center;
text-indent: 30rpx;
}
.numbers {
flex: 1;
display: flex;
justify-content: flex-end;
align-items: center;
margin-right: 30rpx;
}
/* 订单信息 */
.part_six {
width: 95%;
margin: 0 auto;
/* height: 275rpx; */
background: #ffffff;
margin-top: 20rpx;
border-radius: 10rpx;
/* margin-bottom: 100rpx; */
}
.order_info {
width: 90%;
margin: 0 auto;
height: 80rpx;
line-height: 80rpx;
font-size: 31rpx;
font-weight: bold;
letter-spacing: 3rpx;
}
.order_list {
width: 90%;
margin: 0 auto;
display: flex;
height: 60rpx;
}
.order_name {
flex: 1;
color: #999999;
font-size: 29rpx;
letter-spacing: 2rpx;
display: flex;
justify-content: left;
align-items: center;
}
.order_nums {
flex: 2;
color: #999999;
font-size: 28rpx;
letter-spacing: 2rpx;
display: flex;
justify-content: flex-end;
align-items: center;
}
/* 同城服务 */
.part_three {
width: 95%;
margin: 0 auto;
margin-top: 20rpx;
background: #FFFFFF;
border-radius: 10rpx;
padding-bottom: 30rpx;
}
.city_pay {
width: 90%;
margin: 0 auto;
display: flex;
/* height: 90rpx; */
justify-content: left;
align-items: center;
}
.city_pay text {
font-size: 28rpx;
letter-spacing: 2rpx;
margin-left: 30rpx;
}
.city_box {
width: 110rpx;
line-height: 42rpx;
background: #c4e2ff;
color: #49A5FF;
text-align: center;
font-size: 28rpx;
height: 42rpx;
}
.pay_tit {
width: 90%;
margin: 0 auto;
font-size: 27rpx;
}
.btn1 {
width: 170upx;
font-size: 28rpx;
line-height: 60upx;
text-align: center;
border: 1upx solid #9C9C9C;
border-radius: 20upx;
color: #9C9C9C;
margin-right: 30upx;
}
.btn2 {
width: 170upx;
line-height: 60upx;
color: white;
background: #FF6A04;
font-size: 22upx;
text-align: center;
margin-right: 10rpx;
border-radius: 20upx;
}
.phone_bd {
display: inline-block;
background: #FF6A04;
color: #ffffff;
padding: 0rpx 15rpx;
margin-left: 14rpx;
border-radius: 10rpx;
}
.part_seven {
padding: 20rpx;
display: flex;
justify-content: space-between;
align-items: center;
}
.part_sevens {
width: 95%;
margin: 0 auto;
/* height: 275rpx; */
background: #ffffff;
margin-top: 20rpx;
padding-bottom: 10upx;
border-radius: 10rpx;
margin-bottom: 100rpx;
}
/* 联系骑手 */
.rider_box {
width: 95%;
margin: 0 auto;
background: #ffffff;
margin-top: 20rpx;
border-radius: 10rpx;
}
.rider_left image {
width: 80rpx;
height: 85rpx;
border-radius: 60%;
}
.phone {
background: #FD6416;
color: #ffffff;
padding: 8rpx 15rpx;
border-radius: 13rpx;
font-size: 24rpx;
}
</style>

1283
pages/order/index.vue Normal file

File diff suppressed because it is too large Load Diff

872
pages/order/orderDet.vue Normal file
View File

@@ -0,0 +1,872 @@
<template>
<view class="pages">
<!-- 余额 -->
<view class="tosend">
<view class="tosend_text" v-if="dataDet.status == 6">制作中...</view>
<view class="tosend_text" v-if="dataDet.status == 3 && dataDet.orderType == 1">待取餐</view>
<view class="tosend_text" v-if="dataDet.status == 3 && dataDet.orderType == 2 && dataDet.riderUserId">配送中
</view>
<view class="tosend_text" v-if="dataDet.status == 3 && dataDet.orderType == 2 && dataDet.riderUserId==null">
待配送</view>
<view class="tosend_text" v-if="dataDet.status == 4">已完成</view>
<view class="tosend_text" v-if="dataDet.status == 5">已取消</view>
<view class="tosend_text" v-if="dataDet.status == 7">待接单</view>
<!-- <view class="btnCm" v-if="item.riderUserId">配送中</view>
<view class="btnCm" v-else>待派送</view> -->
<view class="tosend_cont" style="position: relative;margin-top: 20upx;" v-if="dataDet.orderType==2">
<image src="../../static/images/order/dizhi.png"
style="position: absolute;width: 32rpx;height: 40rpx;top: 50rpx;left: 32rpx;"></image>
<view class="tosend_header_text" style="margin-left: 64rpx;"
@tap="bindGps(address.lat,address.lng,address.addressDetail)">{{address.province}}{{address.city}}{{address.district}}{{address.addressDetail}}
</view>
<view class="tosend_cont_infor" style="margin-top: 0;margin-left: 64rpx;">
<view class="tosend_cont_infor_le" @click="bindphone(address.userPhone)">
{{address.userName}}&nbsp;&nbsp;{{address.userPhone}}
</view>
<!-- <view class="tosend_cont_infor_ri">{{dataDet.orderCode}}</view> -->
</view>
</view>
<view class="tosend_header" style="margin-top: 20upx;">
<!-- 排序 -->
<view class="cont_two_top">
<view class="cont_two_top_le" v-if="dataDet.status == 3">取餐号码</view>
<!-- <view class="cont_two_top_ri" v-if="dataDet.status == 6">制作中</view> -->
</view>
<view v-if="dataDet.status == 3 && dataDet.orderType == 1" class="cont_two_text">{{dataDet.orderCode}}
</view>
<view v-if="dataDet.status == 3 && dataDet.orderType == 1" class="cont_two_text2">
前面还有<text>{{dataDet.countOrder?dataDet.countOrder:0}}</text>个人排队
</view>
<view v-if="dataDet.status != 3">
<view class="flex justify-between">
<view>取餐号码</view>
<!-- <view class="cont_two_top_ri">制作中</view> -->
</view>
<view style="font-size:58upx;" class="text-center text-bold padding-tb">{{dataDet.orderCode}}</view>
</view>
<!-- 商品列表 -->
<view class="tosend_header_food" v-for="(item,index) in dataDet.orderGoodsList" :key='index'>
<view class="tosend_header_food_le">
<image :src="item.goodsPicture" alt="加载失败" style="border-radius: 10rpx;"></image>
</view>
<view class="tosend_header_food_ce justify-between">
<view class="tosend_header_food_text">{{item.goodsName}}</view>
<view class="tosend_header_food_text2" v-if="item.skuMessage">{{item.skuMessage}}</view>
<view class="tosend_header_food_text2">打包费</view>
</view>
<view class="tosend_header_food_ri">
<view class="tosend_header_food_text"><text>¥</text>{{item.goodsPrice}}</view>
<view class="tosend_header_food_text2">×{{item.goodsNum}}</view>
<view class="tosend_header_food_text2"><text>¥</text>{{item.goodsPack}}/</view>
</view>
</view>
<view class="tosend_header_do do_top" v-if="dataDet.errandMoney>0&& dataDet.orderType == 2">
<view>配送费</view>
<view class="tosend_header_do_ri">{{dataDet.errandMoney}}</view>
</view>
<!-- <view class="tosend_header_do" v-if="dataDet.packMoney>0&& dataDet.orderType == 2">
<view>打包费</view>
<view class="tosend_header_do_ri">{{dataDet.packMoney}}</view>
</view> -->
<view class="tosend_header_do do_bot" v-if="dataDet.couponMoney>0">
<view>优惠券</view>
<view class="tosend_header_do_ri">-{{dataDet.couponMoney}}</view>
</view>
<view class="tosend_header_do margin-top">
<view class="tosend_header_do_le2">实付</view>
<view class="tosend_header_do_ri2"><text></text>{{dataDet.payMoney}}</view>
</view>
</view>
<!-- #ifdef APP -->
<map v-if="dataDet.riderUserId != null && latitude && longitude&& dataDet.status == 3" id="map" @tap="goMap"
style="width: 95%; height: 300rpx;margin-top: 20rpx;margin-left: 20rpx;" :markers="markers"
:latitude="latitude" :longitude="longitude"></map>
<!-- #endif -->
<!-- #ifndef APP -->
<map v-if="dataDet.riderUserId != null && latitude && longitude&& dataDet.status == 3" id="map" @tap="goMap"
style="width: 95%; height: 300rpx;margin: 20rpx auto 0;" :markers="markers" :latitude="latitude"
:longitude="longitude"></map>
<!-- #endif -->
<!-- 联系骑手 -->
<view class="rider_box" v-if="dataDet.riderUserId!= null">
<view class="flex justify-between align-center padding">
<view style="font-size: 31rpx;color: black;">联系骑手...</view>
<image @click="gotousu()" src="../../static/images/my/tousu.png" style="width: 43rpx;height: 39rpx;"
mode=""></image>
</view>
<view>
<u-line color="#F2F2F2" />
</view>
<view style="padding: 20rpx 25rpx;display: flex;justify-content: space-between;align-items: center;">
<view style="display: flex;">
<view class="rider_left">
<image :src="dataDet.riderAvatar"></image>
</view>
<view style="margin-left: 10rpx;color: #333333;">
<view>{{dataDet.riderUserName}}</view>
<view>{{riderPhone}}</view>
</view>
</view>
<view class="phone" @click="bindphone(dataDet.riderPhone)">联系TA</view>
</view>
</view>
<!-- 评论信息 -->
<view class="tosend_cont" v-if="dataDet.evaluateMessage">
<view class="tosend_header_text">评论信息</view>
<view>
<view class="flex align-center">
<image :src="dataDet.avatar?dataDet.avatar:'../../static/logo.png'"
style="width: 40px;height: 40px;border-radius: 50%;"></image>
<view class="flex justify-between align-center" style="width: 100%;margin-left: 5upx;">
<view class="text-bold text-df">{{dataDet.userNickName}}</view>
<view style="color: #999999;font-size: 24rpx;" v-if="dataDet.ecreateTime">
{{dataDet.ecreateTime}}
</view>
</view>
</view>
<view class=" padding-left margin-left-xl" style="font-size: 30upx;">{{dataDet.evaluateMessage}}
</view>
<view class="flex justify-end padding-top-sm margin-right" @click="show = true"
v-if="!dataDet.shopReplyMessage">
<image src="../../static/images/order/pinglun.png" style="width: 20px;height: 20px;"></image>
</view>
<view class="padding-left margin-left-xl margin-top-sm" v-else>
<view class="flex align-center">
<view class=" flex align-center text-df" style="color: #999999;">
<view class="text-df">商家回复:</view>{{dataDet.shopReplyMessage}}
</view>
</view>
<!-- <view class="text-lg padding-left margin-left-xl">{{dataDet.shopReplyMessage}}</view> -->
</view>
</view>
</view>
<!-- 其他信息 -->
<view class="tosend_cont ">
<view class="tosend_header_text">其他信息</view>
<view class="tosend_cont_infor" v-if="dataDet.remark">
<view class="tosend_cont_infor_le">订单备注</view>
<view class="tosend_cont_infor_ri">{{dataDet.remark}}</view>
</view>
<view class="tosend_cont_infor">
<view class="tosend_cont_infor_le">取餐号码</view>
<view class="tosend_cont_infor_ri">{{dataDet.orderCode}}</view>
</view>
<view class="tosend_cont_infor" v-if="dataDet.phone" @tap="call(dataDet.phone)">
<view class="tosend_cont_infor_le">取餐电话</view>
<image src="../../static/images/my/phone.png" style="width: 40upx;height: 40upx;"></image>
<!-- <view class="tosend_cont_infor_ri">{{dataDet.phone}}</view> -->
</view>
<view class="tosend_cont_infor">
<view class="tosend_cont_infor_le">下单时间</view>
<view class="tosend_cont_infor_ri">{{dataDet.payTime}}</view>
</view>
<view class="flex justify-between align-center" style="margin-top: 3%;">
<view class="tosend_cont_infor_le">订单编号</view>
<view class="tosend_cont_infor_ri">{{dataDet.orderNumber}}</view>
<view class="text-orange margin-left-lg" @click="copy(dataDet.orderNumber)">复制</view>
</view>
<view class="tosend_cont_infor padding-bottom-sm">
<view class="tosend_cont_infor_le">支付方式</view>
<view class="tosend_cont_infor_ri" v-if="dataDet.payType==1">微信支付</view>
<view class="tosend_cont_infor_ri" v-if="dataDet.payType==2">余额支付</view>
</view>
</view>
<view class="addgood" @click="refund()" v-if="dataDet.status == 6">退款</view>
<view class="addgood" @click="finish()" v-if="dataDet.status == 6">制作完成</view>
<view class="addgood" @click.stop="xiaoPiao()"
v-if="dataDet.status == 6||dataDet.status == 3||dataDet.status == 4">补打小票</view>
<view class="addgood" @click="refund()" v-if="dataDet.status == 3&&dataDet.orderType==2">退款</view>
<view class="addgood" @click="peisong()" v-if="dataDet.status == 3&&dataDet.orderType==1">制作已完成</view>
<view class="addgood" v-if="dataDet.status == 3&&dataDet.orderType==2&&dataDet.autoSendOrder == 1"
@click.stop="succOrder(dataDet)">完成送达</view>
<!-- <view class="addgood" @click="peisong()" v-if="dataDet.status == 3&&dataDet.orderType==2">餐品已完成,等待配送</view> -->
<!-- 聊天室 -->
<view class="chats" @click.stop="chat(dataDet)">
<image src="../../static/images/img/chats.png"></image>
<view class="shopxiaoix" v-if="ShopUnreadCount">{{ShopUnreadCount}}</view>
</view>
</view>
<!-- 评论弹框 -->
<u-popup v-model="show" mode="bottom" border-radius="14" :closeable="closeable">
<view>
<view class="margin padding-tb">
<u-input v-model="pinglun" type="textarea" height="200" placeholder="请填写回复的内容" maxlengt="200"
:clearable="false" style="background:#F5F5F5;" />
</view>
<view class="btn" @click="bindEvaluate()">提交</view>
</view>
</u-popup>
</view>
</template>
<script>
export default {
data() {
return {
orderNumber: '',
dataDet: {},
orderType: '',
latitude: '',
longitude: '',
markers: [], //标记点
orderId: '',
address: {},
riderPhone: '',
ShopUnreadCount: 0,
pinglun: '',
show: false,
closeable: true,
first: false
}
},
onLoad(option) {
uni.showLoading({
title: '加载中...'
})
console.log(option)
this.orderNumber = option.orderNumber
this.orderId = option.orderId
this.first = false
this.getDataDet()
let that = this
setInterval(function() {
that.getShopUnreadCount()
}, 10000)
},
onShow() {
this.first = false
},
methods: {
//评论
bindEvaluate() {
let data = {
shopReplyMessage: this.pinglun,
orderNumber: this.orderNumber
}
this.$Request.postT("/admin/order/shopReplyEvaluate", data).then(res => {
uni.hideLoading()
if (res.code == 0) {
this.show = false
this.getDataDet()
}
});
},
goMap() {
uni.navigateTo({
url: '/pages/order/orderMap?indentNumber=' + this.orderNumber+'&orderId='+this.orderId
})
},
//投诉
gotousu() {
console.log(this.orderNumber)
uni.navigateTo({
url: '/pages/my/comments?indentNumber=' + this.orderNumber
})
},
// 拨打电话
bindphone(e) {
uni.makePhoneCall({
phoneNumber: e
});
},
// 一键导航
bindGps(latitude, longitude, name, detailsadd) {
console.log(latitude, longitude, name, detailsadd)
uni.openLocation({
latitude: latitude - 0, //要去的纬度-地址
longitude: longitude - 0, //要去的经度-地址
name: name, //地址名称
address: detailsadd, //详细地址名称
success: function() {
console.log('导航成功');
},
fail: function(error) {
console.log(error)
}
});
},
//聊天室
chat(e) {
// console.log(e)
uni.navigateTo({
url: '/pages/my/im?orderId=' + e.orderId
})
},
//获取骑手位置
getaddress(addressId, riderUserId) {
console.log(addressId)
let data = {
addressId: addressId
}
this.$Request.getA("/app/address/selectAddressById", data).then(res => {
// uni.hideLoading()
console.log(res)
if (res.code == 0) {
this.address = res.data
this.getRider(res.data.lat, res.data.lng, riderUserId)
}
});
},
//获取骑手信息
getRider(lat, lng, riderUserId) {
console.log(lat, lng, riderUserId, '111111')
let data = {
lat: lat,
lng: lng,
riderUserId: riderUserId
}
this.$Request.getA("/timedtask/selectRiderLocation", data).then(res => {
if (res.code == 0) {
console.log(res.data, '经纬度')
this.latitude = res.data.riderLocation.lat;
this.longitude = res.data.riderLocation.lng;
this.markers = [{
id: 1,
latitude: res.data.riderLocation.lat,
longitude: res.data.riderLocation.lng,
iconPath: '../../static/images/order/rider.png',
width: '40',
height: '40'
}]
uni.hideLoading()
}
});
},
getDataDet() {
let data = {
// page: 1,
// limit: 10,
orderId: this.orderId
}
this.$Request.getA("/app/order/selectOrderById", data).then(res => {
uni.hideLoading()
if (res.code == 0) {
this.dataDet = res.data
let start = res.data.orderCode.length - 3;
this.dataDet.orderCode = res.data.orderCode.substring(start, res.data.orderCode.length)
this.getaddress(res.data.addressId, res.data.riderUserId)
this.dataDet.orderGoodsList.forEach(res => {
res.goodsPicture = res.goodsPicture.split(',')
})
this.dataDet.address = JSON.parse(this.dataDet.address)
this.riderPhone = this.dataDet.riderPhone
this.riderPhone = this.riderPhone.replace(this.dataDet.riderPhone.substr(3, 4), "****")
// console.log(this.dataDet);
// let phone = this.dataDet.riderPhone;
// let result = phone.substring(0, 3) + "****" + phone.substring(7, 11);
// // console.log(this.dataDet.riderPhone,result);
// this.dataDet.riderPhone = result
this.orderType = res.data.orderType
console.log(this.dataDet, '2222222')
}
});
},
copy(value) {
uni.setClipboardData({
data: value, //要被复制的内容
success: () => { //复制成功的回调函数
uni.showToast({ //提示
title: '复制成功'
})
}
});
},
// 打电话
call(phone) {
uni.makePhoneCall({
phoneNumber: phone
});
},
// 打开地图
openMap(e) {
let latitude = e.latitude;
let longitude = e.longitude;
uni.openLocation({
latitude: Number(latitude),
longitude: Number(longitude),
name: e.address,
success: function() {
console.log('success');
}
});
},
// 完成送达
succOrder(e) {
let that = this
uni.showModal({
title: '提示',
content: '确认完成送达吗?',
success: function(res) {
if (res.confirm) {
console.log('用户点击确定');
let data = {
orderId: e.orderId,
// orderNumber: e.orderNumber,
// shopId: that.shopId,
// addressId: e.addressId,
// status: 3
}
that.$Request.postT("/admin/order/accomplishOrder", data).then(res => {
if (res.code == 0) {
uni.navigateBack()
}
});
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
},
refund() {
let that = this
uni.showModal({
title: '提示',
content: '确认退款吗?',
success: function(res) {
if (res.confirm) {
console.log('用户点击确定');
let data = {
orderId: that.dataDet.orderId
}
that.$Request.postA("/admin/order/adminCancelOrder", data).then(res => {
if (res.code == 0) {
let pages = getCurrentPages(); // 当前页面
let beforePage = pages[pages.length - 2]; // 上一页
uni.navigateBack({
success: function() {
beforePage.onLoad(); // 执行上一页的onLoad方法
}
});
}
});
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
},
// 补打小票
xiaoPiao() {
let that = this
uni.showModal({
title: '提示',
content: '确认补打小票吗?',
success: function(re) {
if (re.confirm) {
console.log('用户点击确定');
let data = {
orderId: that.dataDet.orderId,
// orderNumber: e.orderNumber,
// status: 8
}
that.$Request.post("/admin/order/print", data).then(res => {
if (res.code == 0) {
// that.page = 1
// that.getOrderList()
} else {
that.$queue.showToast(res.msg)
}
});
} else if (re.cancel) {
console.log('用户点击取消');
}
}
});
},
finish(e) {
let that = this
uni.showModal({
title: '提示',
content: '确认订单完成吗?',
success: function(res) {
if (res.confirm) {
console.log('用户点击确定');
let data = {
orderId: that.dataDet.orderId,
orderNumber: that.dataDet.orderNumber,
status: 3
}
that.$Request.postJsonA("/admin/order/updateOrder", data).then(res => {
if (res.code == 0) {
let pages = getCurrentPages(); // 当前页面
let beforePage = pages[pages.length - 2]; // 上一页
uni.navigateBack({
success: function() {
beforePage.onLoad(); // 执行上一页的onLoad方法
}
});
}
});
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
},
peisong(e) {
let that = this
uni.showModal({
title: '提示',
content: '确认开始配送吗?',
success: function(res) {
if (res.confirm) {
console.log('用户点击确定');
let data = {
orderId: that.dataDet.orderId,
orderNumber: that.dataDet.orderNumber,
status: 4
}
that.$Request.postJsonA("/admin/order/updateOrder", data).then(res => {
if (res.code == 0) {
let pages = getCurrentPages(); // 当前页面
let beforePage = pages[pages.length - 2]; // 上一页
uni.navigateBack({
success: function() {
beforePage.onLoad(); // 执行上一页的onLoad方法
}
});
}
});
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
},
//获取用户聊天消息
getShopUnreadCount() {
let that = this
let data = {
ordersId: that.orderId
}
that.$Request.getT("/shop/ordersChat/selectShopUnreadCount", data).then(res => {
if (res.code == 0) {
// that.ShopUnreadCount = res.data
if (res.data > 0) {
if (this.ShopUnreadCount != res.data && !this.first) {
that.aplayAudio()
this.ShopUnreadCount = res.data
uni.showModal({
title: '消息',
content: '有' + res.data + '条消息,请前往聊天列表处理。',
success: (ret) => {
if (ret.confirm) {
uni.redirectTo({
url: '/pages/my/liaotian'
})
this.first = true
} else {
console.log('else', ret)
that.defineCallBack()
}
}
});
// this.chatNum = data.data
}
} else {
that.ShopUnreadCount = 0
}
}
});
},
//消息提示
aplayAudio() {
// console.log('语音提示')
const innerAudioContext = uni.createInnerAudioContext();
innerAudioContext.autoplay = true;
innerAudioContext.src =
'https://pw.xianmxkj.com/file/uploadPath/2022/01/19/0753211f78d718d44ee6372e33eae9ee.mp3';
innerAudioContext.onPlay(() => {
console.log('开始播放');
});
innerAudioContext.onError((res) => {
console.log(res.errMsg);
console.log(res.errCode);
});
},
}
}
</script>
<style scoped>
/* 余额 */
.tosend {
width: 100%;
height: 280rpx;
/* background: -webkit-linear-gradient(top, #FCD202, #F5F5F5); */
}
.tosend_text {
padding: 3% 3% 0%;
font-size: 38upx;
font-weight: 800;
color: #333333;
}
.tosend_header {
width: 94%;
background-color: #FFFFFF;
margin: 0 auto;
border-radius: 18rpx;
padding: 3%;
}
/* 排序 */
.cont_two_top {
width: 100%;
display: flex;
justify-content: space-between;
}
.cont_two_top_le {
font-size: 30rpx;
font-weight: 500;
color: #333333;
}
.cont_two_top_ri {
padding: 6rpx 10rpx;
text-align: center;
background: rgba(255, 19, 10, 0.2);
font-size: 24rpx;
border: 2rpx solid #FF130A;
color: #FF130A;
opacity: 0.6;
border-radius: 8rpx;
}
.cont_two_text {
font-size: 56rpx;
text-align: center;
font-weight: bold;
color: #333333;
margin: 5% 0;
line-height: 32rpx;
}
.cont_two_text2 {
font-size: 30rpx;
width: 100%;
font-weight: 500;
color: #333333;
text-align: center;
padding-bottom: 4%;
line-height: 32rpx;
border-bottom: 1rpx solid #E6E6E6;
}
.cont_two_text2 text {
color: #FF130A;
}
/* 商品列表 */
.tosend_header_text {
font-family: PingFang SC;
font-weight: 800;
color: #333333;
line-height: 2;
font-size: 30rpx;
}
.tosend_header_food {
width: 100%;
display: flex;
margin-top: 35rpx;
justify-content: space-between;
}
.tosend_header_food_le {
/* width: 15%; */
}
.tosend_header_food_le image {
width: 135rpx;
height: 135rpx;
}
.tosend_header_food_ce {
/* margin: 0 0 0 4%; */
width: 57%;
margin-left: 10upx;
}
.tosend_header_food_ri {
text-align: right;
width: 25%;
}
.tosend_header_food_text {
font-size: 34rpx;
font-weight: 500;
color: #333333;
line-height: 1.8;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.tosend_header_food_text text {
font-size: 25rpx;
}
.tosend_header_food_text2 {
font-size: 26rpx;
/* font-weight: 500; */
color: #999999;
}
.do_top {
padding-top: 3%;
}
.do_bot {
padding-bottom: 3%;
border-bottom: 2rpx solid #E6E6E6;
}
.tosend_header_do {
width: 100%;
color: #333333;
font-size: 30rpx;
display: flex;
line-height: 1.5;
}
.tosend_header_do view {
flex: 1;
}
.tosend_header_do_ri {
text-align: right;
}
.tosend_header_do_le2 {
font-family: PingFang SC;
font-weight: 500;
color: #999999;
padding-top: 1.5%;
}
.tosend_header_do_ri2 {
text-align: right;
color: #EA0000;
font-size: 40rpx;
}
.tosend_header_do_ri2 text {
font-size: 30rpx;
}
/* 其他信息 */
.tosend_cont {
width: 94%;
background-color: #FFFFFF;
margin: 3% auto;
border-radius: 18rpx;
padding: 3%;
}
.tosend_cont_infor {
display: flex;
margin-top: 30rpx;
}
.tosend_cont_infor_le {
flex: 1;
color: #999999;
}
.tosend_cont_infor_ri {
flex: 2;
text-align: right;
color: #333333;
}
.tosend_cont_text {
text-align: right;
}
.addgood {
width: 685upx;
height: 88upx;
background: #FFCC00;
border-radius: 8upx;
text-align: center;
line-height: 88rpx;
margin: 40rpx auto;
font-size: 32rpx;
font-weight: bold;
color: #FFFFFF;
}
.chats {
position: fixed;
bottom: 70px;
right: 15px;
}
.chats image {
width: 60px;
height: 60px;
}
/* 联系骑手 */
.rider_box {
width: 95%;
margin: 0 auto;
background: #ffffff;
margin-top: 20rpx;
border-radius: 10rpx;
}
.rider_left image {
width: 80rpx;
height: 85rpx;
border-radius: 60%;
}
.phone {
background: #FD6416;
color: #ffffff;
padding: 8rpx 15rpx;
border-radius: 13rpx;
font-size: 24rpx;
}
.shopxiaoix {
background: red;
color: #ffffff;
width: 40rpx;
height: auto;
text-align: center;
border-radius: 30rpx;
position: relative;
top: -66px;
left: 35px;
}
.btn {
width: 690upx;
height: 88upx;
margin: 30upx auto;
background: #FCD202;
box-shadow: 0px 10upx 20upx 0upx #FFD9B3;
border-radius: 16upx;
display: flex;
align-items: center;
justify-content: center;
color: #000000;
}
</style>

234
pages/order/orderMap.vue Normal file
View File

@@ -0,0 +1,234 @@
<template>
<view>
<map id="map" style="width: 100%; height: 720px;" :latitude="latitude" :longitude="longitude" :markers="markers"
:show-location="true">
</map>
<!-- #ifndef APP-PLUS -->
<cover-view class="controls-title">
<cover-view class="tabs_box">
<cover-image class="pay_img" src="../../static/images/my/avatar.png"></cover-image>
<cover-view class="flex flex-sub margin-left-sm flex-direction justify-between">
<cover-view class="pay_name">骑手预计<text class="text-df">{{rider.mDateTime}}</text>送达</cover-view>
<cover-view class="text-gray margin-top" style="margin-top: 5rpx;">
距离您{{rider.aDouble}}
</cover-view>
</cover-view>
<cover-view class="flex">
<cover-image class="pay_img1 margin-right" @click="goNav" src="../../static/images/my/im.png">
</cover-image>
<cover-image class="pay_img1" @click="call" src="../../static/images/my/phone.png"></cover-image>
</cover-view>
</cover-view>
</cover-view>
<!-- #endif -->
<!-- #ifdef APP-PLUS -->
<cover-view class="controls-titles">
<cover-view class="tabs_box">
<cover-view style="position: relative;top: 0rpx;left: 0rpx;">
<cover-image class="pay_img" src="../../static/images/my/avatar.png"></cover-image>
<cover-view style="position: absolute;top: 5rpx;left: 120rpx;">
<cover-view class="pay_name">骑手预计{{rider.mDateTime}}送达</cover-view>
<cover-view class="text-gray margin-top" style="margin-top: 5rpx;">
距离您{{rider.aDouble}}
</cover-view>
</cover-view>
<cover-view style="position: absolute;top: 5rpx;right: 0rpx;">
<cover-view style="position: relative;top: 0rpx;left: 0rpx;">
<cover-view style="position: absolute;top: 15rpx;right: 40rpx;">
<cover-image class="pay_img1 margin-right" @click="goNav" src="../../static/images/my/im.png">
</cover-image>
</cover-view>
<cover-view style="position: absolute;top: 15rpx;right: 0rpx;">
<cover-image class="pay_img1" @click="call" src="../../static/images/my/phone.png"></cover-image>
</cover-view>
</cover-view>
</cover-view>
</cover-view>
</cover-view>
</cover-view>
<!-- #endif -->
</view>
</template>
<script>
export default {
data() {
return {
latitude: '',
longitude: '',
markers: [], //标记点
indentNumber: '',
riderUserId: '',
orderDetails: {},
rider: {},
timer: '',
orderId:'',
}
},
onLoad(option) {
let that = this
that.indentNumber = option.indentNumber
that.orderId = option.orderId
that.getData()
},
onShow() {
let that = this
this.timer = setInterval(function() {
that.getData()
}, 10000)
},
onHide() {
console.log(this.timer, '定时器')
clearInterval(this.timer)
},
methods: {
getData() {
this.$Request.postT('/app/tbindent/userIndentMessage?indentNumber=' + this.indentNumber).then(res => {
console.log(res)
if (res.code == 0) {
this.orderDetails = res.data
this.riderUserId = this.orderDetails.riderUserId
this.getLocation()
}
});
},
getLocation() {
let data = {
riderUserId: this.riderUserId,
lat: this.orderDetails.userLat,
lng: this.orderDetails.userLng
}
this.$Request.getT('/timedtask/selectRiderLocation', data).then(res => {
if (res.code === 0) {
this.latitude = res.data.riderLocation.lat;
this.longitude = res.data.riderLocation.lng;
this.rider = res.data
let mDateTime = res.data.mDateTime.length - 14;
// this.dataDet.orderCode = res.data.orderCode.substring(start, res.data.orderCode.length)
this.rider.mDateTime = res.data.mDateTime.substring(mDateTime, res.data.mDateTime.length)
if (this.rider.aDouble > 1000) {
this.rider.aDouble = Number((this.rider.aDouble / 1000)).toFixed(2) + "km"
} else {
if (this.rider.aDouble == 0) {
this.rider.aDouble = "0m";
} else {
this.rider.aDouble = Number(this.rider.aDouble).toFixed(1) + "m";
}
}
let marker = {
id: 2,
latitude: res.data.riderLocation.lat,
longitude: res.data.riderLocation.lng,
iconPath: '../../static/images/order/rider.png',
width: '40',
height: '40',
}
this.markers.push(marker)
}
});
},
call() {
uni.makePhoneCall({
phoneNumber: this.orderDetails.phone
});
},
goNav() {
// uni.navigateTo({
// url: '/pages/my/chat'
// })
uni.navigateTo({
url: '/pages/my/im?orderId=' + this.orderId
})
}
},
}
</script>
<style>
.controls-title {
width: 90%;
/* height: 220upx; */
/* line-height: 220upx; */
background: #FFFFFF;
position: fixed;
bottom: 0rpx;
margin: 40upx;
border-radius: 26upx;
box-shadow: 0upx 30upx 40upx 0upx rgba(187, 170, 163, 0.20);
/* margin: 0 40rpx; */
margin-bottom: 50rpx;
}
.controls-titles {
width: 90%;
/* height: 220upx; */
/* line-height: 220upx; */
background: #FFFFFF;
position: fixed;
bottom: 180rpx;
margin: 40upx;
border-radius: 26upx;
box-shadow: 0upx 30upx 40upx 0upx rgba(187, 170, 163, 0.20);
/* margin: 0 40rpx; */
margin-bottom: 50rpx;
}
.tabs_box {
display: flex;
justify-content: space-between;
align-items: center;
padding: 20rpx;
margin: 20rpx;
}
.pay_tit {
flex: 1;
display: flex;
flex-direction: column;
justify-content: space-between;
}
.pay_img {
width: 100rpx;
height: 100rpx;
border-radius: 10rpx;
}
.pay_img1 {
width: 60rpx;
height: 60rpx;
border-radius: 10rpx;
}
.tabs_bottom {
margin: 0 20rpx 20rpx;
display: flex;
}
.pay_btn {
padding: 5rpx 16rpx;
border: solid 2rpx #999999;
margin-right: 20rpx;
display: flex;
align-items: center;
border-radius: 10rpx;
}
.pay_name {
font-size: 28rpx;
font-weight: bold;
display: flex;
flex-wrap: wrap;
}
.pay_line {
height: 2rpx;
background-color: #afafaf;
margin: 10rpx 0;
}
</style>

1082
static/css/index.css Normal file

File diff suppressed because it is too large Load Diff

BIN
static/images/img/add.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 522 B

BIN
static/images/img/chats.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

BIN
static/images/img/close.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

BIN
static/images/img/data.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 962 B

BIN
static/images/img/empty.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

BIN
static/images/img/go.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 651 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 184 KiB

BIN
static/images/img/kefu.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

BIN
static/images/img/order.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

BIN
static/images/index/add.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 387 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 325 B

BIN
static/images/my/00.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
static/images/my/avatar.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

BIN
static/images/my/dianpu.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

Some files were not shown because too many files have changed in this diff Show More