初始化
This commit is contained in:
496
pages/app/pay.vue
Normal file
496
pages/app/pay.vue
Normal file
@@ -0,0 +1,496 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<view class="card">
|
||||
<view class="info-wrap">
|
||||
<image class="cover" src="@/static/img_vipno_vip1-1.png" mode="aspectFill"></image>
|
||||
<text class="t">{{ type == 1 ? '设备商城' : '在线支付' }}</text>
|
||||
</view>
|
||||
<view class="input-wrap">
|
||||
<view class="input-cont">
|
||||
<text class="i">¥</text>
|
||||
<text class="num">{{ num }}</text>
|
||||
</view>
|
||||
<!-- <view class="tips"><input class="input" type="text" :maxlength="10" placeholder="添加付款备注(最多10个字)" v-model="remark" /></view> -->
|
||||
</view>
|
||||
</view>
|
||||
<view class="card">
|
||||
<view class="title"><text>支付方式</text></view>
|
||||
<view class="pay-list">
|
||||
<view class="item">
|
||||
<view class="label">
|
||||
<image class="icon" src="../../static/4.png" mode="aspectFit"></image>
|
||||
<text class="t">微信支付</text>
|
||||
</view>
|
||||
<uni-icons type="checkbox-filled" size="18" color="#54A347"></uni-icons>
|
||||
</view>
|
||||
</view>
|
||||
<view class="num-wrap">
|
||||
<text>实付:</text>
|
||||
<text class="t b">¥{{ num || 0 }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="btn-wrap">
|
||||
<view class="btn" @click="submitHandle"><text>确认支付</text></view>
|
||||
</view>
|
||||
<u-popup :show="show" :closeable="false" round mode="bottom">
|
||||
<view class="success-wrap">
|
||||
<view class="title">{{ payState == 1 ? '支付成功' : '支付失败,请返回APP重新下单' }}</view>
|
||||
<view class="content">
|
||||
<image class="img" src="@/static/success.png" mode="widthFix"></image>
|
||||
</view>
|
||||
<view class="popup-buttn">
|
||||
<button class="btn" type="primary" open-type="launchApp"><text>返回APP</text></button>
|
||||
</view>
|
||||
</view>
|
||||
</u-popup>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// import utils from '@/common/utils.js';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
type: 1,
|
||||
num: '',
|
||||
appid:'',
|
||||
orderNumber: '',
|
||||
show: false,
|
||||
payState: 1,
|
||||
options: {}
|
||||
};
|
||||
},
|
||||
async onLoad(options) {
|
||||
// #ifdef MP-WEIXIN
|
||||
uni.login({
|
||||
provider: 'weixin',
|
||||
success: async (data) => {
|
||||
try {
|
||||
let res = await this.api.usergetopenid({
|
||||
code: data.code
|
||||
})
|
||||
if (res) {
|
||||
uni.setStorageSync('openId',res.data.openid);
|
||||
// uni.cache.set('openId', res.data.openid);
|
||||
}
|
||||
} catch (e) {
|
||||
console.log(e)
|
||||
}
|
||||
}
|
||||
});
|
||||
// #endif
|
||||
this.orderNumber = options.orderNumber;
|
||||
|
||||
this.appid = options.appid
|
||||
this.num = options.num;
|
||||
if (options.type) {
|
||||
this.type = options.type;
|
||||
}
|
||||
if (options.type && options.type == 2) {} else if (options.type && options.type != 1) {
|
||||
this.options = options;
|
||||
}
|
||||
|
||||
console.log({
|
||||
openid: uni.getStorageSync('openId'),
|
||||
orderNumber: this.orderNumber
|
||||
});
|
||||
|
||||
// if (e.q) {
|
||||
// this.userAppId = utils.getQueryString(decodeURIComponent(e.q), 'userAppId');
|
||||
// this.getShopInfo();
|
||||
// }
|
||||
},
|
||||
methods: {
|
||||
// 付款
|
||||
async submitHandle() {
|
||||
try {
|
||||
uni.showLoading({
|
||||
title: '支付中...',
|
||||
mask: true
|
||||
});
|
||||
let res = '';
|
||||
if (this.type == 1) {
|
||||
res = await this.requestHandle('/wechat/orderPay', {
|
||||
openid: uni.getStorageSync('openId'),
|
||||
orderNumber: this.orderNumber,
|
||||
appId: this.appid
|
||||
});
|
||||
} else if (this.type == 2) {
|
||||
// 加油支付
|
||||
res = await this.wxRequest('/order/orderPay', {
|
||||
openid: uni.getStorageSync('openId'),
|
||||
orderNumber: this.orderNumber
|
||||
});
|
||||
} else if (this.type == 3) {
|
||||
res = await this.wxRequest('/order/createorderApp', {
|
||||
openId: uni.getStorageSync('openId'),
|
||||
mobile: this.options.mobile,
|
||||
productId: this.options.productId,
|
||||
provinceName: this.options.provinceName,
|
||||
paymentType: this.options.paymentType,
|
||||
orderId: this.options.orderId
|
||||
});
|
||||
} else if (this.type == 4) {
|
||||
res = await this.wxRequest('/order/createshoporderApp', {
|
||||
openId: uni.getStorageSync('openId'),
|
||||
productId: this.options.productId,
|
||||
orderId: this.options.orderId
|
||||
});
|
||||
} else if (this.type == 5) {
|
||||
res = await this.wxRequest('/order/createoilshoporderApp', {
|
||||
openId: uni.getStorageSync('openId'),
|
||||
productId: this.options.productId,
|
||||
orderId: this.options.orderId
|
||||
});
|
||||
}
|
||||
|
||||
console.log('options222222===', res);
|
||||
|
||||
uni.requestPayment({
|
||||
provider: 'wxpay',
|
||||
timeStamp: res.data.payTimeStamp,
|
||||
nonceStr: res.data.paynonceStr,
|
||||
package: res.data.payPackage,
|
||||
signType: res.data.paySignType,
|
||||
paySign: res.data.paySign,
|
||||
success: (res) => {
|
||||
uni.hideLoading();
|
||||
this.show = true;
|
||||
},
|
||||
fail: (err) => {
|
||||
this.show = true;
|
||||
this.payState = 2;
|
||||
uni.hideLoading();
|
||||
uni.showToast({
|
||||
title: '支付失败',
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
});
|
||||
} catch (e) {
|
||||
this.show = true;
|
||||
this.payState = 2;
|
||||
uni.hideLoading();
|
||||
uni.showModal({
|
||||
title: '支付失败',
|
||||
content: e,
|
||||
showCancel: false
|
||||
});
|
||||
// uni.showToast({
|
||||
// title: '支付失败2:' + JSON.stringify(e),
|
||||
// icon: 'none'
|
||||
// });
|
||||
}
|
||||
},
|
||||
// 微信云托管请求封装
|
||||
wxRequest(api = '', data = {}, method = 'post') {
|
||||
console.log('data44444===', data);
|
||||
return new Promise((resolve, reject) => {
|
||||
uni.request({
|
||||
url: `https://ky.sxczgkj.cn/wap${url}`,
|
||||
method: method,
|
||||
header: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded',
|
||||
sourceId: 2
|
||||
},
|
||||
data: data,
|
||||
success: (res) => {
|
||||
console.log('err2===', res);
|
||||
if (res.data.code == 0) {
|
||||
resolve(res.data);
|
||||
} else {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: res.data.message
|
||||
});
|
||||
reject(res.data.message);
|
||||
}
|
||||
},
|
||||
fail: (err) => {
|
||||
console.log('err1===', err);
|
||||
reject(JSON.stringify(err));
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
// 封装请求
|
||||
requestHandle(url = '', data = {}, method = 'post') {
|
||||
return new Promise((resolve, reject) => {
|
||||
uni.request({
|
||||
url: `https://ky.sxczgkj.cn/wap${url}`,
|
||||
method: method,
|
||||
header: {
|
||||
'content-type': 'application/json'
|
||||
},
|
||||
data: data,
|
||||
success: (res) => {
|
||||
if (res.data.code == 200) {
|
||||
resolve(res.data);
|
||||
} else {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: res.data.message
|
||||
});
|
||||
reject(res.data.message);
|
||||
}
|
||||
},
|
||||
fail: (err) => {
|
||||
reject(JSON.stringify(err));
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.btn-wrap {
|
||||
width: 100%;
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
padding: 28upx 28upx calc(env(safe-area-inset-bottom) + 28upx);
|
||||
|
||||
.btn {
|
||||
padding: 20upx 0;
|
||||
border-radius: 100upx;
|
||||
background-color: #ffcc17;
|
||||
color: #000;
|
||||
font-size: 28upx;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
}
|
||||
|
||||
.container {
|
||||
padding: 28upx;
|
||||
padding-bottom: 640upx;
|
||||
}
|
||||
|
||||
.card {
|
||||
padding: 28upx;
|
||||
border-radius: 28upx;
|
||||
background-color: #fff;
|
||||
margin-bottom: 28upx;
|
||||
|
||||
.title {
|
||||
font-size: 32upx;
|
||||
}
|
||||
}
|
||||
|
||||
.info-wrap {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.cover {
|
||||
$size: 80upx;
|
||||
width: $size;
|
||||
height: $size;
|
||||
border-radius: 50%;
|
||||
margin-right: 20upx;
|
||||
background-color: #efefef;
|
||||
}
|
||||
|
||||
.t {
|
||||
font-size: 32upx;
|
||||
}
|
||||
}
|
||||
|
||||
.input-wrap {
|
||||
padding: 28upx 0 0;
|
||||
|
||||
.input-cont {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
border-bottom: 1upx solid #ececec;
|
||||
|
||||
.i {
|
||||
font-size: 42upx;
|
||||
font-weight: bold;
|
||||
margin-right: 12upx;
|
||||
position: relative;
|
||||
top: -4upx;
|
||||
}
|
||||
|
||||
.num {
|
||||
font-size: 48upx;
|
||||
height: 80upx;
|
||||
font-weight: bold;
|
||||
position: relative;
|
||||
padding-right: 14upx;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
// &::after {
|
||||
// content: '';
|
||||
// width: 4upx;
|
||||
// height: 40upx;
|
||||
// background-color: #333;
|
||||
// position: absolute;
|
||||
// top: 50%;
|
||||
// margin-top: -24upx;
|
||||
// right: 0;
|
||||
// animation: ani 0.8s ease-in-out 1.4s infinite;
|
||||
// }
|
||||
// @keyframes ani {
|
||||
// 0% {
|
||||
// opacity: 0;
|
||||
// }
|
||||
// 100% {
|
||||
// opacity: 1;
|
||||
// }
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
.tips {
|
||||
display: flex;
|
||||
padding-top: 24upx;
|
||||
|
||||
.input {
|
||||
flex: 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.pay-list {
|
||||
.item {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding: 28upx 0;
|
||||
|
||||
.label {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.icon {
|
||||
$size: 60upx;
|
||||
width: $size;
|
||||
height: $size;
|
||||
margin-right: 20upx;
|
||||
}
|
||||
|
||||
.t {
|
||||
font-size: 28upx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.num-wrap {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
|
||||
.t {
|
||||
font-size: 32upx;
|
||||
}
|
||||
|
||||
.b {
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
|
||||
.number-key-wrap {
|
||||
width: 100%;
|
||||
position: fixed;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
background-color: #efefef;
|
||||
z-index: 999;
|
||||
padding: 28upx 28upx calc(env(safe-area-inset-bottom) + 28upx);
|
||||
border-radius: 28upx 28upx 0 0;
|
||||
$gap: 12upx;
|
||||
$radius: 14upx;
|
||||
$itemH: 120upx;
|
||||
|
||||
.number-key {
|
||||
display: flex;
|
||||
|
||||
.item {
|
||||
display: flex;
|
||||
font-size: 48upx;
|
||||
font-weight: bold;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border-radius: $radius;
|
||||
background-color: #fff;
|
||||
|
||||
&.active {
|
||||
background-color: #d9d9d9;
|
||||
}
|
||||
}
|
||||
|
||||
.left {
|
||||
flex: 1;
|
||||
|
||||
.num-list {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr 1fr;
|
||||
grid-template-rows: $itemH $itemH $itemH;
|
||||
grid-gap: $gap;
|
||||
}
|
||||
|
||||
.num-foot {
|
||||
padding-top: $gap;
|
||||
display: grid;
|
||||
grid-gap: $gap;
|
||||
grid-template-columns: 2fr 1fr;
|
||||
grid-template-rows: $itemH;
|
||||
}
|
||||
}
|
||||
|
||||
.right {
|
||||
width: 160upx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
margin-left: $gap;
|
||||
|
||||
.item {
|
||||
flex: 1;
|
||||
|
||||
&:last-child {
|
||||
margin-top: $gap;
|
||||
font-size: 32upx;
|
||||
}
|
||||
|
||||
&.confirm {
|
||||
background-color: #ffcc17;
|
||||
|
||||
&.active {
|
||||
background-color: #e1b516;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.success-wrap {
|
||||
padding: 0 28upx calc(env(safe-area-inset-bottom) + 28upx);
|
||||
|
||||
.title {
|
||||
padding: 28upx 0;
|
||||
font-size: 32upx;
|
||||
font-weight: bold;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.content {
|
||||
.img {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
}
|
||||
}
|
||||
|
||||
.btn {
|
||||
padding: 12upx 0;
|
||||
border-radius: 100upx;
|
||||
font-size: 28upx;
|
||||
background: #ffcc17;
|
||||
color: #000;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
547
pages/login/index.vue
Normal file
547
pages/login/index.vue
Normal file
@@ -0,0 +1,547 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<view class="card">
|
||||
<!-- <view class="info-wrap flex-colum">
|
||||
<image class="cover" :src="list.store_avatar" mode="aspectFill"></image>
|
||||
<text class="t">{{list.store_nickname}}</text>
|
||||
</view> -->
|
||||
<view class="input-wrap">
|
||||
<view class="input-cont">
|
||||
<text class="i">¥</text>
|
||||
<input class="num" type="text" v-model="amount" :readonly="true" @input="checkNum($event)" />
|
||||
</view>
|
||||
<!-- <view class="tips"><input class="input" type="text" :maxlength="10" placeholder="添加付款备注(最多10个字)" v-model="remark" /></view> -->
|
||||
</view>
|
||||
</view>
|
||||
<button @click="clickbutton">按钮</button>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
showpopup: false,
|
||||
ucodeinputvalue: '',
|
||||
amount: "",
|
||||
pay_type: 1,
|
||||
list: '',
|
||||
};
|
||||
},
|
||||
// async onLoad(options) {
|
||||
// this.reservationpaythebill()
|
||||
// },
|
||||
// computed: {
|
||||
// theme() {
|
||||
// return this.$store.getters.theme
|
||||
// },
|
||||
// },
|
||||
|
||||
methods: {
|
||||
clickbutton() {
|
||||
uni.login({
|
||||
provider: 'weixin',
|
||||
success: (data) => {
|
||||
uni.request({
|
||||
url: 'http://192.168.2.23:2058/api/index/pay', //仅为示例,并非真实接口地址。
|
||||
data: {
|
||||
code: data.code
|
||||
},
|
||||
method: "POST",
|
||||
// header: {
|
||||
// 'custom-header': 'hello' //自定义请求头信息
|
||||
// },
|
||||
success: (res) => {
|
||||
console.log(res)
|
||||
// #ifdef MP-WEIXIN
|
||||
uni.requestPayment({
|
||||
provider: 'wxpay', //支付类型-固定值
|
||||
partnerid: res.data.data.data.payAppId, // 微信支付商户号
|
||||
timeStamp: res.data.data.data.payTimeStamp, // 时间戳(单位:秒)
|
||||
nonceStr: res.data.data.data.paynonceStr, // 随机字符串
|
||||
package: res.data.data.data.payPackage, // 固定值
|
||||
signType: res.data.data.data.paySignType, //固定值
|
||||
paySign: res.data.data.data.paySign, //签名
|
||||
success: (res) => {
|
||||
uni.hideLoading()
|
||||
uni.showToast({
|
||||
title: "支付成功"
|
||||
})
|
||||
},
|
||||
fail: (err) => {
|
||||
setTimeout(res => {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: '支付失败'
|
||||
})
|
||||
uni.hideLoading()
|
||||
}, 2000)
|
||||
|
||||
}
|
||||
});
|
||||
// #endif
|
||||
},
|
||||
fail(res) {
|
||||
uni.showToast({
|
||||
title: res.data.message || res.data.msg
|
||||
})
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
async getPhoneNumber(res) { // 获取手机号
|
||||
var resdataa = res
|
||||
// #ifdef MP-WEIXIN
|
||||
uni.login({
|
||||
provider: 'weixin',
|
||||
success: async (data) => {
|
||||
let resdata = await this.api.usergetwechatphone({
|
||||
code: data.code,
|
||||
iv: resdataa.detail.iv,
|
||||
encryptedData: resdataa.detail.encryptedData
|
||||
})
|
||||
try {
|
||||
this.mobiles = resdata.mobile
|
||||
} catch (e) {
|
||||
uni.showToast({
|
||||
title: '获取失败'
|
||||
})
|
||||
}
|
||||
}
|
||||
});
|
||||
// #endif
|
||||
},
|
||||
// 方法
|
||||
checkNum(e) {
|
||||
let val = e.target.value.replace(/(^\s*)|(\s*$)/g, "")
|
||||
console.log(val);
|
||||
if (!val) {
|
||||
this.amount = '';
|
||||
return
|
||||
}
|
||||
var reg = /[^\d.]/g
|
||||
|
||||
// 只能是数字和小数点,不能是其他输入
|
||||
val = val.replace(reg, "")
|
||||
// // 保证第一位只能是数字,不能是点
|
||||
val = val.replace(/^\./g, "");
|
||||
// // 小数只能出现1位
|
||||
val = val.replace(".", "$#$").replace(/\./g, "").replace("$#$", ".");
|
||||
// // 小数点后面保留2位
|
||||
val = val.replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3');
|
||||
console.log(val);
|
||||
this.$nextTick(() => {
|
||||
this.amount = val;
|
||||
})
|
||||
},
|
||||
pay_typeclick(e) {
|
||||
this.pay_type = e
|
||||
},
|
||||
async reservationpaythebill() {
|
||||
let res = await this.api.reservationpaythebill({
|
||||
store_id: uni.cache.get('store_id') // 判断显示哪家的作品
|
||||
})
|
||||
this.list = res
|
||||
},
|
||||
openpopup() {
|
||||
console.log('open');
|
||||
},
|
||||
closepopup() {
|
||||
this.ucodeinputvalue = ''
|
||||
this.showpopup = false
|
||||
},
|
||||
finish(e) {
|
||||
this.showpopup = false
|
||||
this.reservationmakenowsub()
|
||||
},
|
||||
async showpopupclick() {
|
||||
if (this.amount == null || this.amount == '') {
|
||||
uni.showToast({
|
||||
title: '支付金额不能为0',
|
||||
icon: 'none'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if (this.pay_type == 1) {
|
||||
this.reservationmakenowsub()
|
||||
}
|
||||
if (this.pay_type == 2) {
|
||||
let res = await this.api.useruserinfo() //p判断是否完成手机号
|
||||
uni.cache.set('loginuser', res);
|
||||
if (res.userinfo.mobile) {
|
||||
if (this.list.user_sec_password == 0) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '您目前没有设置密码,请先设置支付密码',
|
||||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
uni.redirectTo({
|
||||
url: '/pages/my/setup/repairpassword'
|
||||
});
|
||||
} else if (res.cancel) {}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.showpopup = true
|
||||
}
|
||||
} else {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '确认订单需要获取您的手机号',
|
||||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
uni.redirectTo({
|
||||
url: '/pages/my/setup/index'
|
||||
});
|
||||
} else if (res.cancel) {}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
async reservationmakenowsub() {
|
||||
uni.showLoading({
|
||||
title: '加载中',
|
||||
mask: true
|
||||
})
|
||||
try {
|
||||
var res = await this.api.reservationpaythebillsub({
|
||||
store_id: uni.cache.get('store_id'), // 判断显示哪家的作品
|
||||
amount: this.amount,
|
||||
pay_type: this.pay_type,
|
||||
sec_password: this.ucodeinputvalue
|
||||
})
|
||||
this.ucodeinputvalue = ''
|
||||
if (res.pay_status == 0) {
|
||||
// #ifdef MP-WEIXIN
|
||||
uni.requestPayment({
|
||||
provider: 'wxpay', //支付类型-固定值
|
||||
partnerid: res.pay_data.payAppId, // 微信支付商户号
|
||||
timeStamp: res.pay_data.payTimeStamp, // 时间戳(单位:秒)
|
||||
nonceStr: res.pay_data.paynonceStr, // 随机字符串
|
||||
package: res.pay_data.payPackage, // 固定值
|
||||
signType: res.pay_data.paySignType, //固定值
|
||||
paySign: res.pay_data.paySign, //签名
|
||||
success: (res) => {
|
||||
uni.hideLoading()
|
||||
uni.showToast({
|
||||
title: "支付成功"
|
||||
})
|
||||
setTimeout(res => {
|
||||
uni.navigateBack()
|
||||
}, 1500)
|
||||
},
|
||||
fail: (err) => {
|
||||
setTimeout(res => {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: '支付失败'
|
||||
})
|
||||
uni.hideLoading()
|
||||
}, 2000)
|
||||
|
||||
}
|
||||
});
|
||||
// #endif
|
||||
} else {
|
||||
uni.hideLoading()
|
||||
uni.showToast({
|
||||
title: "支付成功"
|
||||
})
|
||||
setTimeout(res => {
|
||||
uni.navigateBack()
|
||||
}, 1500)
|
||||
}
|
||||
|
||||
|
||||
} catch (e) {
|
||||
|
||||
}
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
page {
|
||||
background: #f8f7f7;
|
||||
}
|
||||
|
||||
.u-popupflex-colum {
|
||||
padding: 80rpx 40rpx;
|
||||
border-radius: 50rpx;
|
||||
background: #FFFFFF;
|
||||
|
||||
.u-popupflex-columview {
|
||||
font-family: SourceHanSansCN-Bold-, SourceHanSansCN-Bold;
|
||||
font-weight: normal;
|
||||
color: #000;
|
||||
font-weight: bold;
|
||||
margin-bottom: 50rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.btn-wrap {
|
||||
width: 100%;
|
||||
position: fixed;
|
||||
bottom: 50rpx;
|
||||
left: 0;
|
||||
padding: 28upx 28upx calc(env(safe-area-inset-bottom) + 28upx);
|
||||
|
||||
.btn {
|
||||
padding: 20upx 0;
|
||||
background: var(--bg-color-button);
|
||||
border-radius: 34rpx;
|
||||
font-size: 32rpx;
|
||||
font-family: PingFang SC-Bold, PingFang SC;
|
||||
font-weight: bold;
|
||||
color: #FFFFFF;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
|
||||
button::after {
|
||||
border: none !important;
|
||||
padding: 0 !important;
|
||||
margin: 0 !important;
|
||||
}
|
||||
|
||||
button {
|
||||
background-color: transparent !important;
|
||||
padding: 0 !important;
|
||||
color: #FFFFFF;
|
||||
line-height: inherit !important;
|
||||
margin: 0 !important;
|
||||
width: 100% !important;
|
||||
font-weight: 500 !important;
|
||||
border-radius: none !important;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.container {
|
||||
padding: 28upx;
|
||||
padding-bottom: 640upx;
|
||||
}
|
||||
|
||||
.card {
|
||||
padding: 28upx;
|
||||
border-radius: 28upx;
|
||||
background-color: #fff;
|
||||
margin-bottom: 28upx;
|
||||
|
||||
.title {
|
||||
font-size: 32upx;
|
||||
}
|
||||
}
|
||||
|
||||
.info-wrap {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.cover {
|
||||
$size: 80upx;
|
||||
width: $size;
|
||||
height: $size;
|
||||
border-radius: 50%;
|
||||
margin-right: 20upx;
|
||||
background-color: #efefef;
|
||||
}
|
||||
|
||||
.t {
|
||||
font-size: 32upx;
|
||||
}
|
||||
}
|
||||
|
||||
.input-wrap {
|
||||
padding: 28upx 0 0;
|
||||
|
||||
.input-cont {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
border-bottom: 1upx solid #ececec;
|
||||
|
||||
.i {
|
||||
font-size: 42upx;
|
||||
font-weight: bold;
|
||||
margin-right: 12upx;
|
||||
position: relative;
|
||||
top: -4upx;
|
||||
}
|
||||
|
||||
.num {
|
||||
font-size: 48upx;
|
||||
height: 80upx;
|
||||
font-weight: bold;
|
||||
position: relative;
|
||||
padding-right: 14upx;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
}
|
||||
|
||||
.tips {
|
||||
display: flex;
|
||||
padding-top: 24upx;
|
||||
|
||||
.input {
|
||||
flex: 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.pay-list {
|
||||
.item {
|
||||
padding: 28upx 0;
|
||||
|
||||
.label {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.icon {
|
||||
$size: 42upx;
|
||||
width: $size;
|
||||
height: $size;
|
||||
margin-right: 20upx;
|
||||
}
|
||||
|
||||
.t {
|
||||
.t_one {
|
||||
font-size: 28rpx;
|
||||
font-family: SourceHanSansCN-Regular, SourceHanSansCN;
|
||||
font-weight: 400;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.t_tow {
|
||||
font-size: 24rpx;
|
||||
font-family: SourceHanSansCN-Regular, SourceHanSansCN;
|
||||
font-weight: 400;
|
||||
color: #999999;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.num-wrap {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
|
||||
.t {
|
||||
font-size: 32upx;
|
||||
}
|
||||
|
||||
.b {
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
|
||||
.number-key-wrap {
|
||||
width: 100%;
|
||||
position: fixed;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
background-color: #efefef;
|
||||
z-index: 999;
|
||||
padding: 28upx 28upx calc(env(safe-area-inset-bottom) + 28upx);
|
||||
border-radius: 28upx 28upx 0 0;
|
||||
$gap: 12upx;
|
||||
$radius: 14upx;
|
||||
$itemH: 120upx;
|
||||
|
||||
.number-key {
|
||||
display: flex;
|
||||
|
||||
.item {
|
||||
display: flex;
|
||||
font-size: 48upx;
|
||||
font-weight: bold;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border-radius: $radius;
|
||||
background-color: #fff;
|
||||
|
||||
&.active {
|
||||
background-color: #d9d9d9;
|
||||
}
|
||||
}
|
||||
|
||||
.left {
|
||||
flex: 1;
|
||||
|
||||
.num-list {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr 1fr;
|
||||
grid-template-rows: $itemH $itemH $itemH;
|
||||
grid-gap: $gap;
|
||||
}
|
||||
|
||||
.num-foot {
|
||||
padding-top: $gap;
|
||||
display: grid;
|
||||
grid-gap: $gap;
|
||||
grid-template-columns: 2fr 1fr;
|
||||
grid-template-rows: $itemH;
|
||||
}
|
||||
}
|
||||
|
||||
.right {
|
||||
width: 160upx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
margin-left: $gap;
|
||||
|
||||
.item {
|
||||
flex: 1;
|
||||
|
||||
&:last-child {
|
||||
margin-top: $gap;
|
||||
font-size: 32upx;
|
||||
}
|
||||
|
||||
&.confirm {
|
||||
background-color: #ffcc17;
|
||||
|
||||
&.active {
|
||||
background-color: #e1b516;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.success-wrap {
|
||||
padding: 0 28upx calc(env(safe-area-inset-bottom) + 28upx);
|
||||
|
||||
.title {
|
||||
padding: 28upx 0;
|
||||
font-size: 32upx;
|
||||
font-weight: bold;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.content {
|
||||
.img {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
}
|
||||
}
|
||||
|
||||
.btn {
|
||||
padding: 12upx 0;
|
||||
border-radius: 100upx;
|
||||
font-size: 28upx;
|
||||
background: #ffcc17;
|
||||
color: #000;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
265
pages/login/login.vue
Normal file
265
pages/login/login.vue
Normal file
@@ -0,0 +1,265 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<view class="containerimage flex-colum">
|
||||
<view class="containerimage_logo">
|
||||
<image class="input_itemone" src="https://ointmentweapp.oss-cn-beijing.aliyuncs.com/manage/login2.png"
|
||||
mode=""></image>
|
||||
</view>
|
||||
</view>
|
||||
<view class="wrapper">
|
||||
<view class="wrapper_box">
|
||||
<view class="input_content">
|
||||
<view class="input_item flex-start">
|
||||
<image class="input_itemone"
|
||||
src="https://ointmentweapp.oss-cn-beijing.aliyuncs.com/manage/loginin2.png" mode=""></image>
|
||||
<view class="input_itemtow flex-colum-start">
|
||||
<text class="tit">手机号码</text>
|
||||
<input type="number" v-model="username" :adjust-position="false" placeholder="请输入账号" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="input_item flex-start">
|
||||
<image class="input_itemone"
|
||||
src="https://ointmentweapp.oss-cn-beijing.aliyuncs.com/manage/loginin1.png" mode=""></image>
|
||||
<view class="input_itemtow flex-colum-start">
|
||||
<text class="tit">密码</text>
|
||||
<input type="mobile" v-model="password" :adjust-position="false" placeholder="8-16位密码"
|
||||
maxlength="16" :password="!showPassword" />
|
||||
<view class="input_itemtowicon" @click="display">
|
||||
<u-icon name="eye" v-if="showPassword"></u-icon>
|
||||
<u-icon v-else name="eye-off"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="agreement flex-start">
|
||||
<u-checkbox-group><u-checkbox shape="circle" @change="radioChange"
|
||||
size="16"></u-checkbox></u-checkbox-group>
|
||||
<text>阅读并同意银收客商家端</text>
|
||||
<view class="agreement-Item" @click="Privacy(1)">《用户协议》</view>
|
||||
及
|
||||
<view class="agreement-Item" @click="Privacy(2)">《隐私政策》</view>
|
||||
</view>
|
||||
<view class="confirm-button" @click="toLogin">
|
||||
登录
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
username: '',
|
||||
radioChangeItem: false, //单选框
|
||||
password: '',
|
||||
logining: false,
|
||||
showPassword: false, //是否显示密码
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
uni.cache.clear();
|
||||
},
|
||||
methods: {
|
||||
radioChange(n) {
|
||||
//是否同意
|
||||
this.radioChangeItem = n;
|
||||
},
|
||||
display() {
|
||||
// 切换图片显示隐藏
|
||||
this.showPassword = !this.showPassword;
|
||||
},
|
||||
Privacy(e) {
|
||||
if (e == 1) {
|
||||
//用户协议
|
||||
uni.pro.navigateTo('webview/html', {
|
||||
src: e
|
||||
});
|
||||
} else {
|
||||
uni.pro.navigateTo('webview/html', {
|
||||
src: e
|
||||
});
|
||||
}
|
||||
},
|
||||
async toLogin() {
|
||||
//登录
|
||||
if (this.username == null || this.username == '') {
|
||||
uni.showToast({
|
||||
title: '请输入电话号码',
|
||||
icon: 'none'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if (this.password == null || this.password == '' || uni.$u.trim(this.password, 'all') == '') {
|
||||
uni.showToast({
|
||||
title: '请输入密码或密码不能输入空格',
|
||||
icon: 'none'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if (this.radioChangeItem == false) {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: '请先阅读《用户协议》和《隐私政策》'
|
||||
});
|
||||
return;
|
||||
}
|
||||
// #ifdef H5
|
||||
let res = await this.api.userlogin({
|
||||
code: '0c3KOzFa1lkuMF0enAHa1Eu2xG1KOzFJ',
|
||||
username: this.username,
|
||||
password: this.password
|
||||
})
|
||||
try {
|
||||
uni.cache.set('user', res.data.userinfo);
|
||||
uni.cache.set("token", res.data.userinfo.token);
|
||||
if (res.data.userinfo.group_id == 2) {
|
||||
uni.pro.switchTab('order/index')
|
||||
} else {
|
||||
uni.redirectTo({
|
||||
url: '/pages/stafflist/index'
|
||||
})
|
||||
}
|
||||
} catch (e) {
|
||||
//TODO handle the exception
|
||||
}
|
||||
// #endif
|
||||
// #ifdef MP-WEIXIN
|
||||
uni.login({
|
||||
provider: 'weixin',
|
||||
success: async (data) => {
|
||||
uni.cache.set('weixincode', data.code);
|
||||
let res = await this.api.userlogin({
|
||||
code: data.code,
|
||||
username: this.username,
|
||||
password: this.password
|
||||
});
|
||||
uni.cache.set('user', res.data.userinfo);
|
||||
uni.cache.set("token", res.data.userinfo.token);
|
||||
if (res.data.userinfo.group_id == 2) {
|
||||
uni.pro.switchTab('order/index')
|
||||
} else {
|
||||
uni.redirectTo({
|
||||
url: '/pages/stafflist/index'
|
||||
})
|
||||
}
|
||||
}
|
||||
});
|
||||
// #endif
|
||||
}
|
||||
},
|
||||
|
||||
}
|
||||
</script>
|
||||
<style lang="scss">
|
||||
page {
|
||||
background: #F9F9F9;
|
||||
}
|
||||
|
||||
.container {
|
||||
position: relative;
|
||||
|
||||
.containerimage {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 538rpx;
|
||||
background: url('https://ointmentweapp.oss-cn-beijing.aliyuncs.com/manage/login1.png') no-repeat;
|
||||
background-size: cover;
|
||||
|
||||
.containerimage_logo {
|
||||
border-radius: 50%;
|
||||
width: 180rpx;
|
||||
height: 180rpx;
|
||||
|
||||
image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.wrapper {
|
||||
position: relative;
|
||||
top: -118rpx;
|
||||
z-index: 90;
|
||||
padding: 0 28rpx;
|
||||
|
||||
.wrapper_box {
|
||||
width: 100%;
|
||||
background: #FFFFFF;
|
||||
border-radius: 32rpx;
|
||||
padding: 16rpx 30rpx;
|
||||
|
||||
.input_content {
|
||||
.input_item {
|
||||
margin-top: 32rpx;
|
||||
|
||||
.input_itemone {
|
||||
width: 49.68rpx;
|
||||
height: 49.68rpx;
|
||||
}
|
||||
|
||||
.input_itemtow {
|
||||
position: relative;
|
||||
flex: auto;
|
||||
margin-left: 16rpx;
|
||||
|
||||
.input_itemtowicon {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
bottom: 20rpx;
|
||||
z-index: 999;
|
||||
}
|
||||
|
||||
.tit {
|
||||
font-size: 32rpx;
|
||||
font-family: Source Han Sans CN-Medium, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
input {
|
||||
width: 100%;
|
||||
padding: 10rpx 0;
|
||||
border-bottom: 2rpx solid rgba(229, 229, 229, 0.7);
|
||||
font-size: 28rpx;
|
||||
font-family: Source Han Sans CN-Medium, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
color: #999999;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
.agreement {
|
||||
margin-top: 24rpx;
|
||||
font-size: 20rpx;
|
||||
font-family: Source Han Sans CN-Medium, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
color: #7c8e97;
|
||||
|
||||
.agreement-Item {
|
||||
color: #4ca1fc;
|
||||
}
|
||||
}
|
||||
|
||||
.confirm-button {
|
||||
margin: 40rpx auto 50rpx auto;
|
||||
width: 90%;
|
||||
background: #2F87FD;
|
||||
padding: 28rpx 0;
|
||||
border-radius: 50rpx;
|
||||
text-align: center;
|
||||
box-shadow: 0px 6rpx 12rpx 2rpx rgba(0, 0, 0, 0.16);
|
||||
font-size: 36rpx;
|
||||
font-family: Source Han Sans CN-Bold, Source Han Sans CN;
|
||||
font-weight: bold;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
</style>
|
||||
787
pages/mailproject/create.vue
Normal file
787
pages/mailproject/create.vue
Normal file
@@ -0,0 +1,787 @@
|
||||
<template>
|
||||
<view class="index">
|
||||
<view class="title_text">
|
||||
基本信息
|
||||
</view>
|
||||
<view class="onecontent">
|
||||
<view class="onecontent_item flex-between">
|
||||
<view class="onecontent_itemleft">
|
||||
商品主图
|
||||
</view>
|
||||
<view class="onecontent_itemright flex-start">
|
||||
<view v-if="form.host_img" class="onecontent_itemrightimges flex-colum" @click="chooseImagelist()">
|
||||
<image :src="form.host_img"></image>
|
||||
</view>
|
||||
<view v-else class="onecontent_itemrightimges flex-colum" @click="chooseImagelist()">
|
||||
+
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
<view class="onecontent_item flex-between">
|
||||
<view class="onecontent_itemleft">
|
||||
商品标题
|
||||
</view>
|
||||
<view class="onecontent_itemright flex-start">
|
||||
<input class="onecontent_itemright_text" v-model="form.title" type="text" placeholder="请输入商品名称">
|
||||
</view>
|
||||
</view>
|
||||
<view class="onecontent_item flex-between">
|
||||
<view class="onecontent_itemleft">
|
||||
商品描述
|
||||
</view>
|
||||
<view class="onecontent_itemright flex-start">
|
||||
<input class="onecontent_itemright_text" v-model="form.intro" type="text" placeholder="请输入商品描述">
|
||||
</view>
|
||||
</view>
|
||||
<view class="onecontent_item flex-between">
|
||||
<view class="onecontent_itemleft">
|
||||
商品分类
|
||||
</view>
|
||||
<view class="onecontent_itemright flex-start" @click="clicksheetshow">
|
||||
<text style="flex: 1; text-align: right;" class="onecontent_itemrighttext"
|
||||
v-if="form.name">{{form.name}}</text>
|
||||
<text style="flex: 1; text-align: right;" class="onecontent_itemrighttext" v-else>请选择</text>
|
||||
<u-icon name="arrow-right" color="#999999" size="18"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
<view class="onecontent_item flex-between">
|
||||
<view class="onecontent_itemleft">
|
||||
上架
|
||||
</view>
|
||||
<u-switch v-model="form.status" @change="changeswitch" size="20"></u-switch>
|
||||
</view>
|
||||
</view>
|
||||
<view v-for="(item,index) in form.spec" :key="index">
|
||||
<view class="title_text flex-between">
|
||||
<text>商品规格({{index}})</text>
|
||||
<view class="onecontentesbox flex-start">
|
||||
<view class="onecontentesboxone" v-if="index == 0" @click="increasespec">添加</view>
|
||||
<view class="onecontentesboxonetow" @click="deletespec(index)">删除</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="onecontent onecontentes">
|
||||
<view class="onecontent_item flex-between">
|
||||
<view class="onecontent_itemleft">
|
||||
规格图片
|
||||
</view>
|
||||
<view class="onecontent_itemright flex-start">
|
||||
<view v-if="item.img" class="onecontent_itemrightimges flex-colum"
|
||||
@click="chooseImagelistssss(index)">
|
||||
<image :src="item.img"></image>
|
||||
</view>
|
||||
<view v-else class="onecontent_itemrightimges flex-colum" @click="chooseImagelistssss(index)">
|
||||
+
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
<view class="onecontent_item flex-between">
|
||||
<view class="onecontent_itemleft">
|
||||
商品名称
|
||||
</view>
|
||||
<view class="onecontent_itemright flex-start">
|
||||
<input class="onecontent_itemright_text" v-model="item.title" type="text" placeholder="请输入商品名称">
|
||||
</view>
|
||||
</view>
|
||||
<view class="onecontent_item flex-between">
|
||||
<view class="onecontent_itemleft">
|
||||
价格
|
||||
</view>
|
||||
<view class="onecontent_itemright flex-start">
|
||||
<input class="onecontent_itemright_text" v-model="item.price" type="text"
|
||||
placeholder="给商品定个好价格">
|
||||
</view>
|
||||
</view>
|
||||
<view class="onecontent_item flex-between">
|
||||
<view class="onecontent_itemleft">
|
||||
原价
|
||||
</view>
|
||||
<view class="onecontent_itemright flex-start">
|
||||
<input class="onecontent_itemright_text" v-model="item.y_price" type="text"
|
||||
placeholder="给商品定个好原价">
|
||||
</view>
|
||||
</view>
|
||||
<view class="onecontent_item flex-between">
|
||||
<view class="onecontent_itemleft">
|
||||
库存
|
||||
</view>
|
||||
<view class="onecontent_itemright flex-start">
|
||||
<input class="onecontent_itemright_text" v-model="item.stock" type="text" placeholder="请输入库存">
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!--<view class="onecontent_item flex-between">
|
||||
<view class="onecontent_itemleft">
|
||||
上架
|
||||
</view>
|
||||
<u-switch v-model="form.status" @change="changeswitch" size="20"></u-switch>
|
||||
</view>
|
||||
<view class="onecontent_item flex-between">
|
||||
<view class="onecontent_itemleft">
|
||||
推荐
|
||||
</view>
|
||||
<u-switch v-model="form.is_re" @change="changeswitchs" size="20"></u-switch>
|
||||
</view> -->
|
||||
</view>
|
||||
</view>
|
||||
<view class="title_text">
|
||||
商品描述
|
||||
</view>
|
||||
<view class="onecontent">
|
||||
<!-- <view @click="demos" class="onecontent_item flex-between">
|
||||
<view class="onecontent_itemleft">
|
||||
商品详情
|
||||
</view>
|
||||
<u-icon name="arrow-right" color="#999999" size="18"></u-icon>
|
||||
</view> -->
|
||||
<view class="container">
|
||||
<view class="page-body">
|
||||
<view class='wrapper'>
|
||||
<view class='toolbar' @tap="format">
|
||||
<view :class="formats.bold ? 'ql-active' : ''" class="iconfont icon-zitijiacu"
|
||||
data-name="bold">
|
||||
</view>
|
||||
<view :class="formats.italic ? 'ql-active' : ''" class="iconfont icon-zitixieti"
|
||||
data-name="italic">
|
||||
</view>
|
||||
<view :class="formats.underline ? 'ql-active' : ''" class="iconfont icon-zitixiahuaxian"
|
||||
data-name="underline"></view>
|
||||
<view :class="formats.strike ? 'ql-active' : ''" class="iconfont icon-zitishanchuxian"
|
||||
data-name="strike"></view>
|
||||
<!-- #ifndef MP-BAIDU -->
|
||||
<view :class="formats.align === 'left' ? 'ql-active' : ''" class="iconfont icon-zuoduiqi"
|
||||
data-name="align" data-value="left"></view>
|
||||
<!-- #endif -->
|
||||
<view :class="formats.align === 'center' ? 'ql-active' : ''"
|
||||
class="iconfont icon-juzhongduiqi" data-name="align" data-value="center"></view>
|
||||
<view :class="formats.align === 'right' ? 'ql-active' : ''" class="iconfont icon-youduiqi"
|
||||
data-name="align" data-value="right"></view>
|
||||
<view :class="formats.align === 'justify' ? 'ql-active' : ''"
|
||||
class="iconfont icon-zuoyouduiqi" data-name="align" data-value="justify"></view>
|
||||
<!-- #ifndef MP-BAIDU -->
|
||||
<view :class="formats.lineHeight ? 'ql-active' : ''" class="iconfont icon-line-height"
|
||||
data-name="lineHeight" data-value="2"></view>
|
||||
<view :class="formats.letterSpacing ? 'ql-active' : ''"
|
||||
class="iconfont icon-Character-Spacing" data-name="letterSpacing" data-value="2em">
|
||||
</view>
|
||||
<view :class="formats.marginTop ? 'ql-active' : ''"
|
||||
class="iconfont icon-722bianjiqi_duanqianju" data-name="marginTop" data-value="20px">
|
||||
</view>
|
||||
<view :class="formats.marginBottom ? 'ql-active' : ''"
|
||||
class="iconfont icon-723bianjiqi_duanhouju" data-name="marginBottom" data-value="20px">
|
||||
</view>
|
||||
<!-- #endif -->
|
||||
|
||||
<view class="iconfont icon-clearedformat" @tap="removeFormat"></view>
|
||||
|
||||
<!-- #ifndef MP-BAIDU -->
|
||||
<view :class="formats.fontFamily ? 'ql-active' : ''" class="iconfont icon-font"
|
||||
data-name="fontFamily" data-value="Pacifico"></view>
|
||||
<view :class="formats.fontSize === '24px' ? 'ql-active' : ''" class="iconfont icon-fontsize"
|
||||
data-name="fontSize" data-value="24px"></view>
|
||||
<!-- #endif -->
|
||||
<view :class="formats.color === '#0000ff' ? 'ql-active' : ''"
|
||||
class="iconfont icon-text_color" data-name="color" data-value="#0000ff"></view>
|
||||
<view :class="formats.backgroundColor === '#00ff00' ? 'ql-active' : ''"
|
||||
class="iconfont icon-fontbgcolor" data-name="backgroundColor" data-value="#00ff00">
|
||||
</view>
|
||||
<view class="iconfont icon-date" @tap="insertDate"></view>
|
||||
<view class="iconfont icon--checklist" data-name="list" data-value="check"></view>
|
||||
<view :class="formats.list === 'ordered' ? 'ql-active' : ''"
|
||||
class="iconfont icon-youxupailie" data-name="list" data-value="ordered"></view>
|
||||
<view :class="formats.list === 'bullet' ? 'ql-active' : ''" class="iconfont icon-wuxupailie"
|
||||
data-name="list" data-value="bullet"></view>
|
||||
|
||||
<view class="iconfont icon-undo" @tap="undo"></view>
|
||||
<view class="iconfont icon-redo" @tap="redo"></view>
|
||||
|
||||
<view class="iconfont icon-outdent" data-name="indent" data-value="-1"></view>
|
||||
<view class="iconfont icon-indent" data-name="indent" data-value="+1"></view>
|
||||
<view class="iconfont icon-fengexian" @tap="insertDivider"></view>
|
||||
<view class="iconfont icon-charutupian" @tap="insertImage"></view>
|
||||
<view :class="formats.header === 1 ? 'ql-active' : ''" class="iconfont icon-format-header-1"
|
||||
data-name="header" :data-value="1"></view>
|
||||
<view :class="formats.script === 'sub' ? 'ql-active' : ''" class="iconfont icon-zitixiabiao"
|
||||
data-name="script" data-value="sub"></view>
|
||||
<view :class="formats.script === 'super' ? 'ql-active' : ''"
|
||||
class="iconfont icon-zitishangbiao" data-name="script" data-value="super"></view>
|
||||
|
||||
<view class="iconfont icon-shanchu" @tap="clear"></view>
|
||||
|
||||
<view :class="formats.direction === 'rtl' ? 'ql-active' : ''"
|
||||
class="iconfont icon-direction-rtl" data-name="direction" data-value="rtl"></view>
|
||||
|
||||
</view>
|
||||
|
||||
<view class="editor-wrapper">
|
||||
<editor id="editor" class="ql-container" placeholder="开始输入..." show-img-size
|
||||
show-img-toolbar show-img-resize @statuschange="onStatusChange" @input="getText"
|
||||
:read-only="readOnly" @ready="onEditorReady">
|
||||
</editor>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<view class="baocun" @tap="$u.debounce(servicecreateitem,1000)">
|
||||
保存
|
||||
</view>
|
||||
<view class="baocun" v-if="form.goods_id!=''" @click="servicedelservice" style="background: red;">
|
||||
删除
|
||||
</view>
|
||||
<u-action-sheet :actions="listsheet" :show="sheetshow" @select="selectClick"></u-action-sheet>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import uploadImage from "@/js_sdk/yushijie-ossutil/ossutil/uploadFile.js";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
listsheet: [],
|
||||
sheetshow: false,
|
||||
readOnly: false,
|
||||
formats: {},
|
||||
context: {},
|
||||
form: {
|
||||
type: 1, //1 创建 2 修改
|
||||
title: '',
|
||||
intro: '', //描述
|
||||
host_img: '', //主图
|
||||
goods_type_id: '', //分类ID
|
||||
status: true,
|
||||
details: '',
|
||||
goods_id: '',
|
||||
spec: [{
|
||||
title: '',
|
||||
price: '',
|
||||
y_price:"",
|
||||
img: '',
|
||||
stock: ''
|
||||
}]
|
||||
}
|
||||
}
|
||||
},
|
||||
async onLoad(e) {
|
||||
try {
|
||||
if (e.id) {
|
||||
this.form.goods_id = e.id
|
||||
uni.setNavigationBarTitle({
|
||||
title: '修改商品'
|
||||
})
|
||||
let res = await this.api.shoppinggoodsdetail({
|
||||
goods_id: e.id
|
||||
})
|
||||
if (res.code = 1) {
|
||||
this.form = res.data
|
||||
if(res.data.spec.length == 0){
|
||||
this.increasespec()
|
||||
}
|
||||
this.form.type = 2 //1 创建 2 修改
|
||||
var thisdatadescribe = res.data.details
|
||||
uni.createSelectorQuery().select('#editor').context((res) => {
|
||||
if (!res) return
|
||||
res.context.setContents({
|
||||
html: thisdatadescribe
|
||||
})
|
||||
}).exec()
|
||||
console.log(this.form)
|
||||
}
|
||||
this.form.goods_id = e.id
|
||||
}else{
|
||||
uni.setNavigationBarTitle({
|
||||
title: '添加商品'
|
||||
})
|
||||
}
|
||||
} catch (e) {
|
||||
//TODO handle the exception
|
||||
}
|
||||
this.serviceitemclass()
|
||||
},
|
||||
onShow() {},
|
||||
mounted() {
|
||||
this.$bus.$on('editors', this.demo)
|
||||
},
|
||||
methods: {
|
||||
clicksheetshow() {
|
||||
if (this.listsheet.length == 0) {
|
||||
uni.showToast({
|
||||
title: '请先去添加分类',
|
||||
icon: 'none'
|
||||
});
|
||||
} else {
|
||||
this.sheetshow = true
|
||||
}
|
||||
|
||||
},
|
||||
increasespec() {
|
||||
this.form.spec.push({
|
||||
title: '',
|
||||
price: '',
|
||||
y_price:'',
|
||||
img: '',
|
||||
stock: ''
|
||||
})
|
||||
},
|
||||
deletespec(index) {
|
||||
if (this.form.spec.length != 1) {
|
||||
this.form.spec.splice(index, 1)
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: '最少需要一个规格',
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
},
|
||||
demo(data) {
|
||||
this.form.details = data
|
||||
},
|
||||
demos() {
|
||||
uni.pro.navigateTo('project/editor/editor', {
|
||||
id: this.form.goods_id
|
||||
})
|
||||
},
|
||||
selectClick(index) {
|
||||
this.sheetshow = false
|
||||
this.form.name = index.name
|
||||
this.form.goods_type_id = index.id
|
||||
console.log(index)
|
||||
},
|
||||
changeswitch(e) {
|
||||
this.form.status = e
|
||||
},
|
||||
changeswitchs(e) {
|
||||
this.form.is_re = e
|
||||
},
|
||||
async serviceitemclass(e) { //项目分类
|
||||
let data = await this.api.shoppinggooodstype({
|
||||
page:1
|
||||
});
|
||||
this.listsheet = data.data
|
||||
},
|
||||
async servicecreateitem() {
|
||||
if (this.form.title == null || this.form.title == '') {
|
||||
uni.showToast({
|
||||
title: '请填写商品名称',
|
||||
icon: 'none'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if (this.form.intro == null || this.form.intro == '') {
|
||||
uni.showToast({
|
||||
title: '请输入商品描述',
|
||||
icon: 'none'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if (this.form.details == null || this.form.details == '') {
|
||||
uni.showToast({
|
||||
title: '商品详情不能为空',
|
||||
icon: 'none'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.form.goods_type_id == null || this.form.goods_type_id == '') {
|
||||
uni.showToast({
|
||||
title: '请选择商品分类',
|
||||
icon: 'none'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if (this.form.host_img == null || this.form.host_img == '') {
|
||||
uni.showToast({
|
||||
title: '主图不能为空',
|
||||
icon: 'none'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
let res = await this.api.shoppingcreategoods({
|
||||
title: this.form.title,
|
||||
intro: this.form.intro,
|
||||
host_img: this.form.host_img,
|
||||
goods_type_id: this.form.goods_type_id,
|
||||
spec: this.form.spec,
|
||||
status: this.form.status,
|
||||
details: this.form.details,
|
||||
goods_id: this.form.goods_id,
|
||||
type: this.form.type
|
||||
});
|
||||
if (res.code == 1) {
|
||||
uni.showToast({
|
||||
title: this.form.goods_id ? '修改成功' : '创建成功',
|
||||
icon: 'none'
|
||||
});
|
||||
setTimeout(() => {
|
||||
uni.navigateBack();
|
||||
}, 1000);
|
||||
}
|
||||
},
|
||||
async servicedelservice() {
|
||||
var this_ = this
|
||||
console.log(this.form.goods_id)
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '确认删除该商品吗?',
|
||||
success: async (res) => {
|
||||
if (res.confirm) {
|
||||
let data = await this.api.shoppingdeletegoods({
|
||||
goods_id: this_.form.goods_id
|
||||
});
|
||||
if (data.code == 1) {
|
||||
uni.showToast({
|
||||
title: '删除成功',
|
||||
icon: 'none'
|
||||
});
|
||||
setTimeout(() => {
|
||||
uni.navigateBack();
|
||||
}, 1000);
|
||||
}
|
||||
} else if (res.cancel) {
|
||||
console.log('用户点击取消');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
// 上传
|
||||
chooseImagelist() {
|
||||
uni.showLoading({
|
||||
title: '上传中',
|
||||
mask: true
|
||||
})
|
||||
uni.chooseImage({
|
||||
count: 1, //默认9
|
||||
sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
|
||||
sourceType: ['album'], //从相册选择
|
||||
success: (res) => {
|
||||
let file = res.tempFilePaths[0];
|
||||
uploadImage(file, 'mailproject/',
|
||||
result => {
|
||||
this.form.host_img = ''
|
||||
this.form.host_img = result
|
||||
uni.hideLoading()
|
||||
}, result => {
|
||||
console.log(result, '2222')
|
||||
uni.hideLoading()
|
||||
})
|
||||
},
|
||||
fail: (res) => {
|
||||
uni.hideLoading()
|
||||
}
|
||||
});
|
||||
},
|
||||
// 上传
|
||||
chooseImagelistssss(index) {
|
||||
var thisindex = index
|
||||
uni.showLoading({
|
||||
title: '上传中',
|
||||
mask: true
|
||||
})
|
||||
uni.chooseImage({
|
||||
count: 1, //默认9
|
||||
sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
|
||||
sourceType: ['album'], //从相册选择
|
||||
success: (res) => {
|
||||
let file = res.tempFilePaths[0];
|
||||
uploadImage(file, 'mailproject/',
|
||||
result => {
|
||||
this.form.spec[thisindex].img = ''
|
||||
this.form.spec[thisindex].img = result
|
||||
uni.hideLoading()
|
||||
}, result => {
|
||||
console.log(result, '2222')
|
||||
uni.hideLoading()
|
||||
})
|
||||
},
|
||||
fail: (res) => {
|
||||
uni.hideLoading()
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
getText(e) {
|
||||
this.context = e.detail.html
|
||||
this.form.details = this.context
|
||||
console.log(e.detail.html, this.context); //输出相应内容的html代码
|
||||
},
|
||||
readOnlyChange() {
|
||||
this.readOnly = !this.readOnly
|
||||
},
|
||||
onEditorReady() {
|
||||
// #ifdef MP-BAIDU
|
||||
this.editorCtx = requireDynamicLib('editorLib').createEditorContext('editor');
|
||||
// #endif
|
||||
|
||||
// #ifdef APP-PLUS || MP-WEIXIN || H5
|
||||
uni.createSelectorQuery().select('#editor').context((res) => {
|
||||
this.editorCtx = res.context
|
||||
}).exec()
|
||||
// #endif
|
||||
},
|
||||
|
||||
undo() {
|
||||
this.editorCtx.undo()
|
||||
},
|
||||
redo() {
|
||||
this.editorCtx.redo()
|
||||
},
|
||||
format(e) {
|
||||
let {
|
||||
name,
|
||||
value
|
||||
} = e.target.dataset
|
||||
if (!name) return
|
||||
// console.log('format', name, value)
|
||||
this.editorCtx.format(name, value)
|
||||
},
|
||||
onStatusChange(e) {
|
||||
const formats = e.detail
|
||||
this.formats = formats
|
||||
},
|
||||
insertDivider() {
|
||||
this.editorCtx.insertDivider({
|
||||
success: function() {
|
||||
console.log('insert divider success')
|
||||
}
|
||||
})
|
||||
},
|
||||
clear() {
|
||||
uni.showModal({
|
||||
title: '清空编辑器',
|
||||
content: '确定清空编辑器全部内容?',
|
||||
success: res => {
|
||||
if (res.confirm) {
|
||||
this.editorCtx.clear({
|
||||
success: function(res) {
|
||||
console.log("clear success")
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
removeFormat() {
|
||||
this.editorCtx.removeFormat()
|
||||
},
|
||||
insertDate() {
|
||||
const date = new Date()
|
||||
const formatDate = `${date.getFullYear()}/${date.getMonth() + 1}/${date.getDate()}`
|
||||
this.editorCtx.insertText({
|
||||
text: formatDate
|
||||
})
|
||||
},
|
||||
insertImage() {
|
||||
uni.showLoading({
|
||||
title: '上传中',
|
||||
mask: true
|
||||
})
|
||||
uni.chooseImage({
|
||||
count: 1, //默认9
|
||||
sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
|
||||
sourceType: ['album'], //从相册选择
|
||||
success: (res) => {
|
||||
let file = res.tempFilePaths[0];
|
||||
uploadImage(file, 'wechat/',
|
||||
result => {
|
||||
this.editorCtx.insertImage({
|
||||
src: result,
|
||||
alt: '图像',
|
||||
})
|
||||
uni.hideLoading()
|
||||
}, result => {
|
||||
console.log(result)
|
||||
uni.hideLoading()
|
||||
})
|
||||
},
|
||||
fail: (res) => {
|
||||
uni.hideLoading()
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
@import "./editor-icon.css";
|
||||
|
||||
page {
|
||||
background: #F6F6F6;
|
||||
}
|
||||
|
||||
.index {
|
||||
.title_text {
|
||||
padding: 12rpx 40rpx;
|
||||
font-size: 28rpx;
|
||||
font-family: SourceHanSansCN-Regular, SourceHanSansCN;
|
||||
font-weight: 400;
|
||||
color: #666666;
|
||||
|
||||
.onecontentesbox {
|
||||
font-size: 28rpx;
|
||||
font-family: SourceHanSansCN, SourceHanSansCN;
|
||||
font-weight: 400;
|
||||
color: #666666;
|
||||
|
||||
.onecontentesboxone {
|
||||
padding: 10rpx 16rpx;
|
||||
font-size: 28rpx;
|
||||
font-family: SourceHanSansCN, SourceHanSansCN;
|
||||
font-weight: 400;
|
||||
background: #2979ff;
|
||||
border-radius: 20rpx;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.onecontentesboxonetow {
|
||||
margin-left: 10rpx;
|
||||
border-radius: 20rpx;
|
||||
padding: 10rpx 16rpx;
|
||||
font-size: 28rpx;
|
||||
color: #fff;
|
||||
font-family: SourceHanSansCN, SourceHanSansCN;
|
||||
font-weight: 400;
|
||||
background: #fc5f69;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#editor {
|
||||
width: 100%;
|
||||
height: 456rpx;
|
||||
padding: 12rpx 40rpx;
|
||||
background: #FFFFFF;
|
||||
}
|
||||
|
||||
.baocun {
|
||||
margin: 40rpx auto;
|
||||
width: 90%;
|
||||
padding: 18rpx 0;
|
||||
background: #6699FF;
|
||||
text-align: center;
|
||||
border-radius: 16rpx;
|
||||
font-size: 32rpx;
|
||||
font-family: SourceHanSansCN-Regular, SourceHanSansCN;
|
||||
font-weight: 400;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
.onecontent {
|
||||
background: #ffffff;
|
||||
|
||||
.wrapper {
|
||||
height: 100%;
|
||||
|
||||
.editor-wrapper {
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.iconfont {
|
||||
display: inline-block;
|
||||
padding: 8px 8px;
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
cursor: pointer;
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
.toolbar {
|
||||
box-sizing: border-box;
|
||||
border-bottom: 0;
|
||||
}
|
||||
|
||||
.ql-container {
|
||||
box-sizing: border-box;
|
||||
padding: 12px 15px;
|
||||
width: 100%;
|
||||
min-height: 30vh;
|
||||
height: 100%;
|
||||
font-size: 16px;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.ql-active {
|
||||
color: #06c;
|
||||
}
|
||||
}
|
||||
|
||||
.onecontent_item {
|
||||
width: 100%;
|
||||
padding: 16rpx 46rpx;
|
||||
border-bottom: 2rpx solid #E5E5E5;
|
||||
|
||||
.onecontent_itemleft {
|
||||
flex: 1;
|
||||
font-size: 28rpx;
|
||||
font-family: SourceHanSansCN-Regular, SourceHanSansCN;
|
||||
font-weight: 400;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
.onecontent_itemright {
|
||||
flex: 3;
|
||||
|
||||
.onecontent_itemrighttext {
|
||||
font-size: 24rpx;
|
||||
font-family: SourceHanSansCN-Regular, SourceHanSansCN;
|
||||
font-weight: 400;
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
.onecontent_itemrightimges {
|
||||
width: 112rpx;
|
||||
height: 112rpx;
|
||||
background: #F5F5F5;
|
||||
border-radius: 10rpx;
|
||||
font-size: 40rpx;
|
||||
color: #878787;
|
||||
|
||||
image {
|
||||
width: 112rpx;
|
||||
height: 112rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.onecontent_itemright_text {
|
||||
width: 100%;
|
||||
font-size: 24rpx;
|
||||
font-family: SourceHanSansCN-Regular, SourceHanSansCN;
|
||||
font-weight: 400;
|
||||
color: #999999;
|
||||
}
|
||||
}
|
||||
|
||||
.flex-start {
|
||||
.fourcontent {
|
||||
.fourcontent_item {
|
||||
position: relative;
|
||||
margin-top: 16rpx;
|
||||
margin-left: 20rpx;
|
||||
width: 112rpx;
|
||||
height: 112rpx;
|
||||
border-radius: 16rpx;
|
||||
|
||||
image {
|
||||
width: 112rpx;
|
||||
height: 112rpx;
|
||||
border-radius: 16rpx;
|
||||
}
|
||||
|
||||
.fourcontent_itemtext {
|
||||
position: absolute;
|
||||
top: 0rpx;
|
||||
right: 0rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
</style>
|
||||
204
pages/mailproject/createcap.vue
Normal file
204
pages/mailproject/createcap.vue
Normal file
@@ -0,0 +1,204 @@
|
||||
<template>
|
||||
<view class="index">
|
||||
<view class="title_text">
|
||||
创建分类
|
||||
</view>
|
||||
<view class="onecontent">
|
||||
<view class="onecontent_item flex-between">
|
||||
<view class="onecontent_itemleft">
|
||||
商品分类
|
||||
</view>
|
||||
<view class="onecontent_itemright flex-start">
|
||||
<input class="onecontent_itemright_text" v-model="titles" maxlength="8" type="text"
|
||||
placeholder="请输入商品分类">
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="thereconse" @click="servicecreateitemclass">
|
||||
确定
|
||||
</view>
|
||||
<view class="title_text">
|
||||
管理分类
|
||||
</view>
|
||||
<view class="onecontent">
|
||||
<view class="onecontent_item flex-between" v-for="(item,index) in list" :key="index"
|
||||
@click="contentfixedclick(item)">
|
||||
<view class="onecontent_itemleft">
|
||||
{{item.name}}
|
||||
</view>
|
||||
<u-icon name="arrow-right" color="#333" size="20"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="list.length==0 && is_end == true" style="margin-top: 100rpx;width: 100%;" class="flex-colum">
|
||||
<image src="https://ointmentweapp.oss-cn-beijing.aliyuncs.com/image/my/order/nothave.png" mode="">
|
||||
</image>
|
||||
</view>
|
||||
<u-loadmore :status="form.status" />
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
titles: '',
|
||||
list: [],
|
||||
is_end: false,
|
||||
form: {
|
||||
page: 1,
|
||||
status: 'loadmore',
|
||||
},
|
||||
}
|
||||
},
|
||||
onReachBottom() {
|
||||
this.shoppinggooodstype()
|
||||
},
|
||||
onShow() {
|
||||
this.init_fn()
|
||||
},
|
||||
methods: {
|
||||
init_fn() {
|
||||
this.list = []
|
||||
this.is_end = false
|
||||
this.form.page = 1
|
||||
this.form.status = 'loadmore'
|
||||
this.shoppinggooodstype()
|
||||
},
|
||||
async shoppinggooodstype() {
|
||||
let res = await this.api.shoppinggooodstype({
|
||||
page:this.form.page
|
||||
});
|
||||
if (res.code == 1) {
|
||||
if (res.data.length == 0) {
|
||||
this.is_end = true
|
||||
this.form.status = 'nomore'
|
||||
return false;
|
||||
} else {
|
||||
this.form.status = 'loading';
|
||||
this.form.page = ++this.form.page;
|
||||
setTimeout(() => {
|
||||
this.list = [...this.list, ...res.data];
|
||||
if (res.data.length == 10) {
|
||||
this.form.status = 'loading';
|
||||
} else {
|
||||
this.is_end = true;
|
||||
this.form.status = 'nomore';
|
||||
}
|
||||
}, 500)
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
contentfixedclick(e) {
|
||||
// let data = {
|
||||
// title: e.title,
|
||||
// goods_type_id: e.id
|
||||
// }
|
||||
uni.navigateTo({
|
||||
url: '/pages/mailproject/createcapinfo?name=' + e.name +'&goods_type_id='+ e.id
|
||||
});
|
||||
},
|
||||
async servicecreateitemclass() {
|
||||
let res = await this.api.shoppingcreategoodstype({
|
||||
title: this.titles,
|
||||
type: 1,
|
||||
goods_type_id: ''
|
||||
});
|
||||
if (res.code == 1) {
|
||||
uni.showToast({
|
||||
title: '创建成功',
|
||||
icon: 'none'
|
||||
});
|
||||
setTimeout(() => {
|
||||
uni.navigateBack();
|
||||
}, 1000);
|
||||
}
|
||||
},
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
background: #F6F6F6;
|
||||
}
|
||||
|
||||
.index {
|
||||
.title_text {
|
||||
padding: 12rpx 40rpx;
|
||||
font-size: 28rpx;
|
||||
font-family: SourceHanSansCN-Regular, SourceHanSansCN;
|
||||
font-weight: 400;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
#editor {
|
||||
width: 100%;
|
||||
height: 456rpx;
|
||||
padding: 12rpx 40rpx;
|
||||
background: #FFFFFF;
|
||||
}
|
||||
|
||||
.onecontent {
|
||||
background: #ffffff;
|
||||
|
||||
.onecontent_item {
|
||||
width: 100%;
|
||||
padding: 16rpx 46rpx;
|
||||
border-bottom: 2rpx solid #E5E5E5;
|
||||
|
||||
.onecontent_itemleft {
|
||||
flex: 1;
|
||||
font-size: 28rpx;
|
||||
font-family: SourceHanSansCN-Regular, SourceHanSansCN;
|
||||
font-weight: 400;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
.onecontent_itemright {
|
||||
flex: 3;
|
||||
|
||||
.onecontent_itemrighttext {
|
||||
font-size: 24rpx;
|
||||
font-family: SourceHanSansCN-Regular, SourceHanSansCN;
|
||||
font-weight: 400;
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
.onecontent_itemrightimges {
|
||||
width: 112rpx;
|
||||
height: 112rpx;
|
||||
background: #F5F5F5;
|
||||
border-radius: 10rpx;
|
||||
font-size: 40rpx;
|
||||
color: #878787;
|
||||
}
|
||||
|
||||
.onecontent_itemright_text {
|
||||
width: 100%;
|
||||
font-size: 24rpx;
|
||||
font-family: SourceHanSansCN-Regular, SourceHanSansCN;
|
||||
font-weight: 400;
|
||||
color: #999999;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.thereconse {
|
||||
width: 630rpx;
|
||||
height: 80rpx;
|
||||
background: #999999;
|
||||
border-radius: 40rpx;
|
||||
font-size: 36rpx;
|
||||
text-align: center;
|
||||
margin: 50rpx auto;
|
||||
font-family: PingFang SC-Bold, PingFang SC;
|
||||
font-weight: bold;
|
||||
color: #FFFFFF;
|
||||
line-height: 80rpx;
|
||||
background: #6699FF;
|
||||
border-radius: 16rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
161
pages/mailproject/createcapinfo.vue
Normal file
161
pages/mailproject/createcapinfo.vue
Normal file
@@ -0,0 +1,161 @@
|
||||
<template>
|
||||
<view class="index">
|
||||
<view class="title_text">
|
||||
修改分类
|
||||
</view>
|
||||
<view class="onecontent">
|
||||
<view class="onecontent_item flex-between">
|
||||
<view class="onecontent_itemleft">
|
||||
商品分类
|
||||
</view>
|
||||
<view class="onecontent_itemright flex-start">
|
||||
<input class="onecontent_itemright_text" v-model="form.name" maxlength="8" type="text"
|
||||
placeholder="请输入商品分类">
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="thereconse" @click="servicecreateitemclass">
|
||||
确定
|
||||
</view>
|
||||
<view class="thereconse thereconsess" @click="shoppingdeletegoodstype">
|
||||
刪除
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
form: {
|
||||
name:'',
|
||||
goods_type_id:''
|
||||
},
|
||||
}
|
||||
},
|
||||
onLoad(e) {
|
||||
this.form.name = e.name
|
||||
this.form.goods_type_id = e.goods_type_id
|
||||
},
|
||||
methods: {
|
||||
async shoppingdeletegoodstype(){
|
||||
let res = await this.api.shoppingdeletegoodstype({
|
||||
goods_type_id:this.form.goods_type_id
|
||||
});
|
||||
if (res.code == 1) {
|
||||
uni.showToast({
|
||||
title: '删除成功',
|
||||
icon: 'none'
|
||||
});
|
||||
setTimeout(() => {
|
||||
uni.navigateBack();
|
||||
}, 1000);
|
||||
}
|
||||
},
|
||||
async servicecreateitemclass() {
|
||||
let res = await this.api.shoppingcreategoodstype({
|
||||
title: this.form.name,
|
||||
type:2,
|
||||
goods_type_id:this.form.goods_type_id
|
||||
});
|
||||
if (res.code == 1) {
|
||||
uni.showToast({
|
||||
title: '修改成功',
|
||||
icon: 'none'
|
||||
});
|
||||
setTimeout(() => {
|
||||
uni.navigateBack();
|
||||
}, 1000);
|
||||
}
|
||||
},
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
background: #F6F6F6;
|
||||
}
|
||||
|
||||
.index {
|
||||
.title_text {
|
||||
padding: 12rpx 40rpx;
|
||||
font-size: 28rpx;
|
||||
font-family: SourceHanSansCN-Regular, SourceHanSansCN;
|
||||
font-weight: 400;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
#editor {
|
||||
width: 100%;
|
||||
height: 456rpx;
|
||||
padding: 12rpx 40rpx;
|
||||
background: #FFFFFF;
|
||||
}
|
||||
|
||||
.onecontent {
|
||||
background: #ffffff;
|
||||
|
||||
.onecontent_item {
|
||||
width: 100%;
|
||||
padding: 16rpx 46rpx;
|
||||
border-bottom: 2rpx solid #E5E5E5;
|
||||
|
||||
.onecontent_itemleft {
|
||||
flex: 1;
|
||||
font-size: 28rpx;
|
||||
font-family: SourceHanSansCN-Regular, SourceHanSansCN;
|
||||
font-weight: 400;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
.onecontent_itemright {
|
||||
flex: 3;
|
||||
|
||||
.onecontent_itemrighttext {
|
||||
font-size: 24rpx;
|
||||
font-family: SourceHanSansCN-Regular, SourceHanSansCN;
|
||||
font-weight: 400;
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
.onecontent_itemrightimges {
|
||||
width: 112rpx;
|
||||
height: 112rpx;
|
||||
background: #F5F5F5;
|
||||
border-radius: 10rpx;
|
||||
font-size: 40rpx;
|
||||
color: #878787;
|
||||
}
|
||||
|
||||
.onecontent_itemright_text {
|
||||
width: 100%;
|
||||
font-size: 24rpx;
|
||||
font-family: SourceHanSansCN-Regular, SourceHanSansCN;
|
||||
font-weight: 400;
|
||||
color: #999999;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.thereconse {
|
||||
width: 630rpx;
|
||||
height: 80rpx;
|
||||
background: #999999;
|
||||
border-radius: 40rpx;
|
||||
font-size: 36rpx;
|
||||
text-align: center;
|
||||
margin: 50rpx auto;
|
||||
font-family: PingFang SC-Bold, PingFang SC;
|
||||
font-weight: bold;
|
||||
color: #FFFFFF;
|
||||
line-height: 80rpx;
|
||||
background: #6699FF;
|
||||
border-radius: 16rpx;
|
||||
}
|
||||
.thereconsess{
|
||||
background:#fc5f69;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
238
pages/mailproject/editor-icon.css
Normal file
238
pages/mailproject/editor-icon.css
Normal file
File diff suppressed because one or more lines are too long
238
pages/mailproject/editor/editor-icon.css
Normal file
238
pages/mailproject/editor/editor-icon.css
Normal file
File diff suppressed because one or more lines are too long
271
pages/mailproject/editor/editor.vue
Normal file
271
pages/mailproject/editor/editor.vue
Normal file
@@ -0,0 +1,271 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<view class="page-body">
|
||||
<view class='wrapper'>
|
||||
<view class='toolbar' @tap="format">
|
||||
<view :class="formats.bold ? 'ql-active' : ''" class="iconfont icon-zitijiacu" data-name="bold">
|
||||
</view>
|
||||
<view :class="formats.italic ? 'ql-active' : ''" class="iconfont icon-zitixieti" data-name="italic">
|
||||
</view>
|
||||
<view :class="formats.underline ? 'ql-active' : ''" class="iconfont icon-zitixiahuaxian"
|
||||
data-name="underline"></view>
|
||||
<view :class="formats.strike ? 'ql-active' : ''" class="iconfont icon-zitishanchuxian"
|
||||
data-name="strike"></view>
|
||||
<!-- #ifndef MP-BAIDU -->
|
||||
<view :class="formats.align === 'left' ? 'ql-active' : ''" class="iconfont icon-zuoduiqi"
|
||||
data-name="align" data-value="left"></view>
|
||||
<!-- #endif -->
|
||||
<view :class="formats.align === 'center' ? 'ql-active' : ''" class="iconfont icon-juzhongduiqi"
|
||||
data-name="align" data-value="center"></view>
|
||||
<view :class="formats.align === 'right' ? 'ql-active' : ''" class="iconfont icon-youduiqi"
|
||||
data-name="align" data-value="right"></view>
|
||||
<view :class="formats.align === 'justify' ? 'ql-active' : ''" class="iconfont icon-zuoyouduiqi"
|
||||
data-name="align" data-value="justify"></view>
|
||||
<!-- #ifndef MP-BAIDU -->
|
||||
<view :class="formats.lineHeight ? 'ql-active' : ''" class="iconfont icon-line-height"
|
||||
data-name="lineHeight" data-value="2"></view>
|
||||
<view :class="formats.letterSpacing ? 'ql-active' : ''" class="iconfont icon-Character-Spacing"
|
||||
data-name="letterSpacing" data-value="2em"></view>
|
||||
<view :class="formats.marginTop ? 'ql-active' : ''" class="iconfont icon-722bianjiqi_duanqianju"
|
||||
data-name="marginTop" data-value="20px"></view>
|
||||
<view :class="formats.marginBottom ? 'ql-active' : ''" class="iconfont icon-723bianjiqi_duanhouju"
|
||||
data-name="marginBottom" data-value="20px"></view>
|
||||
<!-- #endif -->
|
||||
|
||||
<view class="iconfont icon-clearedformat" @tap="removeFormat"></view>
|
||||
|
||||
<!-- #ifndef MP-BAIDU -->
|
||||
<view :class="formats.fontFamily ? 'ql-active' : ''" class="iconfont icon-font"
|
||||
data-name="fontFamily" data-value="Pacifico"></view>
|
||||
<view :class="formats.fontSize === '24px' ? 'ql-active' : ''" class="iconfont icon-fontsize"
|
||||
data-name="fontSize" data-value="24px"></view>
|
||||
<!-- #endif -->
|
||||
<view :class="formats.color === '#0000ff' ? 'ql-active' : ''" class="iconfont icon-text_color"
|
||||
data-name="color" data-value="#0000ff"></view>
|
||||
<view :class="formats.backgroundColor === '#00ff00' ? 'ql-active' : ''"
|
||||
class="iconfont icon-fontbgcolor" data-name="backgroundColor" data-value="#00ff00"></view>
|
||||
<view class="iconfont icon-date" @tap="insertDate"></view>
|
||||
<view class="iconfont icon--checklist" data-name="list" data-value="check"></view>
|
||||
<view :class="formats.list === 'ordered' ? 'ql-active' : ''" class="iconfont icon-youxupailie"
|
||||
data-name="list" data-value="ordered"></view>
|
||||
<view :class="formats.list === 'bullet' ? 'ql-active' : ''" class="iconfont icon-wuxupailie"
|
||||
data-name="list" data-value="bullet"></view>
|
||||
|
||||
<view class="iconfont icon-undo" @tap="undo"></view>
|
||||
<view class="iconfont icon-redo" @tap="redo"></view>
|
||||
|
||||
<view class="iconfont icon-outdent" data-name="indent" data-value="-1"></view>
|
||||
<view class="iconfont icon-indent" data-name="indent" data-value="+1"></view>
|
||||
<view class="iconfont icon-fengexian" @tap="insertDivider"></view>
|
||||
<view class="iconfont icon-charutupian" @tap="insertImage"></view>
|
||||
<view :class="formats.header === 1 ? 'ql-active' : ''" class="iconfont icon-format-header-1"
|
||||
data-name="header" :data-value="1"></view>
|
||||
<view :class="formats.script === 'sub' ? 'ql-active' : ''" class="iconfont icon-zitixiabiao"
|
||||
data-name="script" data-value="sub"></view>
|
||||
<view :class="formats.script === 'super' ? 'ql-active' : ''" class="iconfont icon-zitishangbiao"
|
||||
data-name="script" data-value="super"></view>
|
||||
|
||||
<view class="iconfont icon-shanchu" @tap="clear"></view>
|
||||
|
||||
<view :class="formats.direction === 'rtl' ? 'ql-active' : ''" class="iconfont icon-direction-rtl"
|
||||
data-name="direction" data-value="rtl"></view>
|
||||
|
||||
</view>
|
||||
|
||||
<view class="editor-wrapper">
|
||||
<editor id="editor" class="ql-container" placeholder="开始输入..." show-img-size show-img-toolbar
|
||||
show-img-resize @statuschange="onStatusChange" @input="getText" :read-only="readOnly"
|
||||
@ready="onEditorReady">
|
||||
</editor>
|
||||
</view>
|
||||
<view
|
||||
style="display:block; width: 80%; padding: 18rpx 0; text-align: center; margin:20rpx auto 0 auto; color: #fff; background:#6699ff;border-radius:16rpx;"
|
||||
@click="determine">
|
||||
确定</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import uploadImage from "@/js_sdk/yushijie-ossutil/ossutil/uploadFile.js";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
readOnly: false,
|
||||
formats: {},
|
||||
context: {}
|
||||
}
|
||||
},
|
||||
async onLoad(e) {
|
||||
try {
|
||||
if (e.id) {
|
||||
let res = await this.api.servicedetail({
|
||||
service_id: e.id
|
||||
})
|
||||
if (res.code = 1) {
|
||||
var thisdatadescribe = res.data.details
|
||||
uni.createSelectorQuery().select('#editor').context((res) => {
|
||||
if (!res) return
|
||||
res.context.setContents({
|
||||
html: thisdatadescribe
|
||||
})
|
||||
}).exec()
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
//TODO handle the exception
|
||||
}
|
||||
// #ifndef MP-BAIDU
|
||||
uni.loadFontFace({
|
||||
family: 'Pacifico',
|
||||
source: 'url("https://sungd.github.io/Pacifico.ttf")'
|
||||
})
|
||||
// #endif
|
||||
},
|
||||
methods: {
|
||||
getText(e) {
|
||||
this.context = e.detail.html
|
||||
console.log(e.detail.html, this.context); //输出相应内容的html代码
|
||||
},
|
||||
readOnlyChange() {
|
||||
this.readOnly = !this.readOnly
|
||||
},
|
||||
onEditorReady() {
|
||||
// #ifdef MP-BAIDU
|
||||
this.editorCtx = requireDynamicLib('editorLib').createEditorContext('editor');
|
||||
// #endif
|
||||
|
||||
// #ifdef APP-PLUS || MP-WEIXIN || H5
|
||||
uni.createSelectorQuery().select('#editor').context((res) => {
|
||||
this.editorCtx = res.context
|
||||
}).exec()
|
||||
// #endif
|
||||
},
|
||||
determine() {
|
||||
this.$bus.$emit('editors', this.context)
|
||||
uni.navigateBack()
|
||||
},
|
||||
undo() {
|
||||
this.editorCtx.undo()
|
||||
},
|
||||
redo() {
|
||||
this.editorCtx.redo()
|
||||
},
|
||||
format(e) {
|
||||
let {
|
||||
name,
|
||||
value
|
||||
} = e.target.dataset
|
||||
if (!name) return
|
||||
// console.log('format', name, value)
|
||||
this.editorCtx.format(name, value)
|
||||
},
|
||||
onStatusChange(e) {
|
||||
const formats = e.detail
|
||||
this.formats = formats
|
||||
},
|
||||
insertDivider() {
|
||||
this.editorCtx.insertDivider({
|
||||
success: function() {
|
||||
console.log('insert divider success')
|
||||
}
|
||||
})
|
||||
},
|
||||
clear() {
|
||||
uni.showModal({
|
||||
title: '清空编辑器',
|
||||
content: '确定清空编辑器全部内容?',
|
||||
success: res => {
|
||||
if (res.confirm) {
|
||||
this.editorCtx.clear({
|
||||
success: function(res) {
|
||||
console.log("clear success")
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
removeFormat() {
|
||||
this.editorCtx.removeFormat()
|
||||
},
|
||||
insertDate() {
|
||||
const date = new Date()
|
||||
const formatDate = `${date.getFullYear()}/${date.getMonth() + 1}/${date.getDate()}`
|
||||
this.editorCtx.insertText({
|
||||
text: formatDate
|
||||
})
|
||||
},
|
||||
insertImage() {
|
||||
uni.showLoading({
|
||||
title: '上传中',
|
||||
mask: true
|
||||
})
|
||||
uni.chooseImage({
|
||||
count: 1, //默认9
|
||||
sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
|
||||
sourceType: ['album'], //从相册选择
|
||||
success: (res) => {
|
||||
let file = res.tempFilePaths[0];
|
||||
uploadImage(file, 'wechat/',
|
||||
result => {
|
||||
this.editorCtx.insertImage({
|
||||
src: result,
|
||||
alt: '图像',
|
||||
})
|
||||
uni.hideLoading()
|
||||
}, result => {
|
||||
console.log(result)
|
||||
uni.hideLoading()
|
||||
})
|
||||
},
|
||||
fail: (res) => {
|
||||
uni.hideLoading()
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
@import "./editor-icon.css";
|
||||
|
||||
|
||||
.wrapper {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.editor-wrapper {
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.iconfont {
|
||||
display: inline-block;
|
||||
padding: 8px 8px;
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
cursor: pointer;
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
.toolbar {
|
||||
box-sizing: border-box;
|
||||
border-bottom: 0;
|
||||
}
|
||||
|
||||
.ql-container {
|
||||
box-sizing: border-box;
|
||||
padding: 12px 15px;
|
||||
width: 100%;
|
||||
min-height: 30vh;
|
||||
height: 100%;
|
||||
font-size: 16px;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.ql-active {
|
||||
color: #06c;
|
||||
}
|
||||
</style>
|
||||
BIN
pages/mailproject/editor/iconfont.ttf
Normal file
BIN
pages/mailproject/editor/iconfont.ttf
Normal file
Binary file not shown.
233
pages/mailproject/index.vue
Normal file
233
pages/mailproject/index.vue
Normal file
@@ -0,0 +1,233 @@
|
||||
<template>
|
||||
<view class="content">
|
||||
<view class="onecontent flex-between">
|
||||
<u-search shape="square" :clearabled="true" @blur='servicelists' :showAction="false" placeholder="输入关键字"
|
||||
v-model="like"></u-search>
|
||||
<view class="flex-start" style="padding-left:20rpx;" @click="contentfixedclick()">
|
||||
<u-icon name="order" color="#666" size="22"></u-icon>
|
||||
<text class="flex-starttext">新建商品</text>
|
||||
</view>
|
||||
<view class="flex-start" style="padding-left:20rpx;" @click="createcap()">
|
||||
<u-icon name="order" color="#666" size="22"></u-icon>
|
||||
<text class="flex-starttext">新建分类</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="contenttow">
|
||||
<view class="contenttowitem" v-for="(item,index) in list" :key="index" @click="contentfixedclick(item)">
|
||||
<view class="contenttowitemone flex-between">
|
||||
<text class="contenttowitemone_one"
|
||||
:style="item.service_status == 0?'color: #ccc;':''">{{item.title}}</text>
|
||||
<view class="contenttowitemone_tow flex-start" >
|
||||
<text class="contenttowitemone_towtext">编辑商品</text>
|
||||
<u-icon name="file-text" color="#999" size="20"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
<view class="contenttowitemtow flex-between" v-for="(item1,index1) in item.spec" :key="index1">
|
||||
<image class="contenttowitemtowimage" :src="item1.img" mode=""></image>
|
||||
<view class="contenttowitemtow_item flex-colum-start">
|
||||
<view class="contenttowitemtow_itemone" :style="item.service_status == 0?'color: #ccc;':''">
|
||||
{{item1.title}}
|
||||
</view>
|
||||
<view class="contenttowitemtow_ittow flex-between">
|
||||
<view class="contenttowitemtow_ittowone">
|
||||
¥{{item1.price}}
|
||||
<!-- <text class="contenttowitemtow_ittowonetext">{{item1.price}}</text> -->
|
||||
</view>
|
||||
<view class="contenttowitemtow_ittowtow">
|
||||
<text v-if="item.status == 1" style="color: green;">已上架</text>
|
||||
<text v-else style="color: red;">已下架</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="list.length==0 && form.is_end == true" class="flex-colum">
|
||||
<image src="https://ointmentweapp.oss-cn-beijing.aliyuncs.com/image/my/order/nothave.png" mode="">
|
||||
</image>
|
||||
</view>
|
||||
<u-loadmore :status="form.status" />
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
like: "",
|
||||
list: [],
|
||||
form: {
|
||||
is_end: false,
|
||||
page: 1,
|
||||
status: 'loadmore',
|
||||
},
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
this.form = {
|
||||
is_end: false,
|
||||
page: 1,
|
||||
status: 'loadmore',
|
||||
},
|
||||
this.list = []
|
||||
this.shoppinggoodslist()
|
||||
},
|
||||
onReachBottom() {
|
||||
this.shoppinggoodslist()
|
||||
},
|
||||
methods: {
|
||||
servicelists() {
|
||||
this.list = []
|
||||
this.form.page = 1
|
||||
this.shoppinggoodslist()
|
||||
},
|
||||
contentfixedclick(e) {
|
||||
if(e){
|
||||
uni.pro.navigateTo('mailproject/create', {
|
||||
id: e.id
|
||||
})
|
||||
}else{
|
||||
uni.pro.navigateTo('mailproject/create')
|
||||
}
|
||||
},
|
||||
createcap() {
|
||||
uni.pro.navigateTo('mailproject/createcap')
|
||||
},
|
||||
async shoppinggoodslist(e) { //项目列表
|
||||
let res = await this.api.shoppinggoodslist({
|
||||
page: this.form.page,
|
||||
like: this.like
|
||||
});
|
||||
if (res.data.length == 0) {
|
||||
this.form.is_end = true
|
||||
this.form.status = 'nomore'
|
||||
return false;
|
||||
} else {
|
||||
this.form.status = 'loading';
|
||||
this.form.page = ++this.form.page;
|
||||
setTimeout(() => {
|
||||
this.list = [...this.list, ...res.data];
|
||||
if (res.data.length == 10) {
|
||||
this.form.status = 'loading';
|
||||
} else {
|
||||
this.form.is_end = true;
|
||||
this.form.status = 'nomore';
|
||||
}
|
||||
}, 500)
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
background: #fbfbfa;
|
||||
}
|
||||
|
||||
.content {
|
||||
.onecontent {
|
||||
padding: 16rpx 20rpx;
|
||||
width: 100%;
|
||||
background: #FFFFFF;
|
||||
|
||||
.flex-start {
|
||||
.flex-starttext {
|
||||
font-size: 28rpx;
|
||||
font-family: SourceHanSansCN-Regular, SourceHanSansCN;
|
||||
font-weight: 400;
|
||||
color: #666666;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.contenttow {
|
||||
padding: 0 28rpx;
|
||||
|
||||
.contenttowitem {
|
||||
margin-top: 34rpx;
|
||||
padding: 24rpx;
|
||||
width: 100%;
|
||||
background: #FFFFFF;
|
||||
border-radius: 24rpx;
|
||||
|
||||
.contenttowitemone {
|
||||
width: 100%;
|
||||
padding-bottom: 18rpx;
|
||||
border-bottom: 1rpx solid #EAEAEA;
|
||||
|
||||
.contenttowitemone_one {
|
||||
width: 60%;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
font-size: 28rpx;
|
||||
font-family: SourceHanSansCN-Medium, SourceHanSansCN;
|
||||
font-weight: bold;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.contenttowitemone_tow {
|
||||
.contenttowitemone_towtext {
|
||||
font-size: 24rpx;
|
||||
font-family: SourceHanSansCN-Regular, SourceHanSansCN;
|
||||
font-weight: 400;
|
||||
color: #666666;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.contenttowitemtow {
|
||||
width: 100%;
|
||||
padding: 18rpx 0;
|
||||
border-bottom: 1rpx solid #ccc;
|
||||
.contenttowitemtowimage {
|
||||
width: 136rpx;
|
||||
height: 136rpx;
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
|
||||
.contenttowitemtow_item {
|
||||
height: 136rpx;
|
||||
width: 75%;
|
||||
justify-content: space-between;
|
||||
|
||||
.contenttowitemtow_itemone {
|
||||
width: 100%;
|
||||
font-size: 24rpx;
|
||||
font-family: SourceHanSansCN-Regular, SourceHanSansCN;
|
||||
font-weight: 400;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.contenttowitemtow_ittow {
|
||||
width: 100%;
|
||||
|
||||
.contenttowitemtow_ittowone {
|
||||
font-size: 32rpx;
|
||||
font-family: SourceHanSansCN-Medium, SourceHanSansCN;
|
||||
font-weight: bold;
|
||||
color: #333333;
|
||||
|
||||
.contenttowitemtow_ittowonetext {
|
||||
text-decoration: line-through;
|
||||
margin-left: 10rpx;
|
||||
font-size: 22rpx;
|
||||
font-weight: 400;
|
||||
}
|
||||
}
|
||||
|
||||
.contenttowitemtow_ittowtow {
|
||||
font-size: 16rpx;
|
||||
font-family: SourceHanSansCN-Regular, SourceHanSansCN;
|
||||
font-weight: 400;
|
||||
color: #999999;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
872
pages/mall/index.vue
Normal file
872
pages/mall/index.vue
Normal file
@@ -0,0 +1,872 @@
|
||||
<template>
|
||||
<view class="content">
|
||||
<view class="onecontent">
|
||||
<view class="flex-start">
|
||||
<view class="onecontent_oen flex-start">
|
||||
<input class="onecontent_oen_input" type="text" v-model="like" placeholder="搜索订单/商家名/商品名">
|
||||
<text class="onecontent_oen_text" @click="init_fn">搜索</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="onecontent_tow flex-between">
|
||||
<view ref="uTabs" class="onecontent_tow_item flex-colum" v-for="(item,index) in swipercurrentdata"
|
||||
:key="index" @click="orderswitch(index)">
|
||||
<view :class="swiperCurrent == index?'onecontent_tow_itemtexts':'onecontent_tow_itemtext'">
|
||||
{{item.name}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="towcontent">
|
||||
<swiper :current="swiperCurrent" @animationfinish="animationfinish" :style="{height:height}">
|
||||
<swiper-item v-for="(item,index) in list_" :key="index">
|
||||
<scroll-view scroll-y style="width: 100%;" :style="{height:height}" @scrolltolower="lower">
|
||||
<view class="towcontentitem" v-for="(item1,index1) in list_[index].data" :key="index1">
|
||||
<view class="towcontentitemone flex-between">
|
||||
<text class="towcontentitemone_one">{{item1.store_title}}</text>
|
||||
<view class="towcontentitemone_tow flex-start">
|
||||
<!-- <image class="towcontentitemone_towimage"
|
||||
:src="item.store_avatar"
|
||||
mode="">
|
||||
</image> -->
|
||||
<text v-if="item1.status == 0">待付款</text>
|
||||
<text v-if="item1.status == 1">待发货</text>
|
||||
<text v-if="item1.status == 2">待收货</text>
|
||||
<text v-if="item1.status == 3">已收货/评价</text>
|
||||
<text v-if="item1.status == 4">退款中 </text>
|
||||
<text v-if="item1.status == 5">退款成功</text>
|
||||
<text v-if="item1.status == 6">取消订单</text>
|
||||
<text v-if="item1.status == 7">已拒绝</text>
|
||||
<text v-if="item1.deletetime" style="color: red;">(用户已删除)</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="towcontentitemtow flex-start" v-for="(item2,index2) in item1.goods"
|
||||
:key="index2" @click="eeInfo(item2)">
|
||||
<image class="towcontentitemtow_imge" :src="item2.img" mode=""></image>
|
||||
<view class="towcontentitemtow_one flex-start">
|
||||
<text class="towcontentitemtow_one_one">{{item2.title}}</text>
|
||||
<view class="flex-colum">
|
||||
<text class="towcontentitemtow_one_tow"><text
|
||||
style="font-size:24rpx;">¥</text>{{item2.goods_price}}</text>
|
||||
<text class="towcontentitemtow_one_there">×{{item2.number}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view class="towcontentitemtow_tow">
|
||||
{{item2.number}}
|
||||
</view> -->
|
||||
</view>
|
||||
<view class="towcontentitemthere_text_iitem">
|
||||
共{{item1.number}}件商品 合计:<text>¥{{item1.goods_total_price}}</text>
|
||||
</view>
|
||||
<view class="towcontentitemthere">
|
||||
<view v-if="item1.status == 2 || item1.status == 0"
|
||||
class="towcontentitemthereitem towcontentitemthereitem_there"
|
||||
@click.stop="orderokprebook(item1)">
|
||||
去发货
|
||||
</view>
|
||||
<view v-if="item1.status == 2 || item1.status == 1"
|
||||
class="towcontentitemthereitem towcontentitemthereitem_tow"
|
||||
@click.stop="orderrefuseprebook(item1)">
|
||||
取消订单并退款
|
||||
</view>
|
||||
<view v-if="item1.status == 3"
|
||||
class="towcontentitemthereitem towcontentitemthereitem_tow"
|
||||
@click.stop="orderordercancel(item1)">
|
||||
取消订单/并退款
|
||||
</view>
|
||||
<view class="towcontentitemthereitem towcontentitemthereitem_there"
|
||||
v-if="item1.status == 3" @click.stop="orderorderdelete(item1)">
|
||||
完成服务
|
||||
</view>
|
||||
</view>
|
||||
<u-overlay :show="overlayshow" @click.stop="overlayshow = false" opacity='0.1'>
|
||||
<view class="warp">
|
||||
<view class="rect flex-colum" @tap.stop>
|
||||
<view class="rectone">
|
||||
确定{{clickoverlayshowtext}}吗?
|
||||
</view>
|
||||
<view class="recttow flex-between">
|
||||
<view class="recttow_one" @click="cancelOrder(item.status)">
|
||||
确定
|
||||
</view>
|
||||
<view class="recttow_tow" @click="overlayshow = false">
|
||||
取消
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</u-overlay>
|
||||
</view>
|
||||
<view v-if="list_[index].data.length == 0 && list_[index].is_end == true" class="flex-colum">
|
||||
<image class="" style="margin-top: 100rpx;"
|
||||
src="https://ointmentweapp.oss-cn-beijing.aliyuncs.com/image/my/order/nothave.png"
|
||||
mode="">
|
||||
</image>
|
||||
</view>
|
||||
<u-loadmore :status="list_[index].status" />
|
||||
|
||||
</scroll-view>
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
height: "",
|
||||
// 因为内部的滑动机制限制,请将tabs组件和swiper组件的current用不同变量赋值
|
||||
current: 0, // tabs组件的current值,表示当前活动的tab选项
|
||||
swiperCurrent: 0, // swiper组件的current值,表示当前那个swiper-item是活动的
|
||||
overlayshow: false,
|
||||
list_: {
|
||||
list0: { //待服务
|
||||
data: [],
|
||||
page: 1,
|
||||
status: 'loadmore',
|
||||
is_end: false,
|
||||
},
|
||||
list1: { //全部
|
||||
data: [],
|
||||
page: 1,
|
||||
status: 'loadmore',
|
||||
is_end: false,
|
||||
},
|
||||
list2: { //代付款
|
||||
data: [],
|
||||
page: 1,
|
||||
status: 'loadmore',
|
||||
is_end: false,
|
||||
},
|
||||
list3: { //待服务
|
||||
data: [],
|
||||
page: 1,
|
||||
status: 'loadmore',
|
||||
is_end: false,
|
||||
},
|
||||
list4: { //待服务
|
||||
data: [],
|
||||
page: 1,
|
||||
status: 'loadmore',
|
||||
is_end: false,
|
||||
}
|
||||
},
|
||||
like: '', //备注
|
||||
clickoverlayshowtext: "",
|
||||
swipercurrentdata: [{
|
||||
name: '全部'
|
||||
}, {
|
||||
name: '待付款'
|
||||
}, {
|
||||
name: '待发货'
|
||||
}, {
|
||||
name: '待收货'
|
||||
}, {
|
||||
name: '已收货/退款售后'
|
||||
}],
|
||||
form: {
|
||||
status: 'loadmore',
|
||||
},
|
||||
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
if (uni.cache.get('token')) {
|
||||
uni.setNavigationBarTitle({
|
||||
title: uni.cache.get('user').nickname
|
||||
})
|
||||
this.init_fn();
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
var query = uni.createSelectorQuery().in(this).select('.onecontent')
|
||||
query.boundingClientRect(ele => {
|
||||
var that = this;
|
||||
uni.getSystemInfo({
|
||||
success(res) {
|
||||
that.height = (res.windowHeight - ele.height) + "px";
|
||||
that = null;
|
||||
}
|
||||
})
|
||||
}).exec();
|
||||
},
|
||||
|
||||
methods: {
|
||||
showpickersetTabBar(){
|
||||
uni.switchTab({
|
||||
url:'/pages/order/index'
|
||||
})
|
||||
},
|
||||
init_fn() {
|
||||
this.list_ = {
|
||||
list0: { //全部
|
||||
data: [],
|
||||
page: 1,
|
||||
status: 'loading',
|
||||
is_end: false,
|
||||
},
|
||||
list1: { //全部
|
||||
data: [],
|
||||
page: 1,
|
||||
status: 'loading',
|
||||
is_end: false,
|
||||
},
|
||||
list2: { //代付款
|
||||
data: [],
|
||||
page: 1,
|
||||
status: 'loading',
|
||||
is_end: false,
|
||||
},
|
||||
list3: { //待服务
|
||||
data: [],
|
||||
page: 1,
|
||||
status: 'loadmore',
|
||||
is_end: false,
|
||||
},
|
||||
list4: { //待服务
|
||||
data: [],
|
||||
page: 1,
|
||||
status: 'loadmore',
|
||||
is_end: false,
|
||||
}
|
||||
}
|
||||
for (let i = 0; i <= 4; i++) {
|
||||
this.get_order_list(i);
|
||||
}
|
||||
},
|
||||
async get_order_list(i) {
|
||||
let page = null; //页数
|
||||
let order_type = ''
|
||||
switch (i) {
|
||||
case 0:
|
||||
order_type = 10;
|
||||
page = this.list_.list0.page;
|
||||
break;
|
||||
case 1:
|
||||
order_type = 0;
|
||||
page = this.list_.list1.page;
|
||||
break;
|
||||
case 2:
|
||||
order_type = 1;
|
||||
page = this.list_.list2.page;
|
||||
break;
|
||||
case 3:
|
||||
order_type = 2;
|
||||
page = this.list_.list3.page;
|
||||
break;
|
||||
case 4:
|
||||
order_type = 3;
|
||||
page = this.list_.list4.page;
|
||||
break;
|
||||
}
|
||||
let resdata = await this.api.shoppinglist({
|
||||
type: order_type,
|
||||
page: page,
|
||||
like: this.like
|
||||
})
|
||||
let res = resdata.data
|
||||
// res.data.forEach(item=>{//计算待支付订单剩余时间
|
||||
// if(item.order_type==0){
|
||||
// item.timeDiff=(new Date(item.estimate_close_at).getTime() -new Date().getTime())/1000;
|
||||
// }
|
||||
// })
|
||||
switch (order_type) {
|
||||
case 10:
|
||||
this.paging(res, this.list_.list0)
|
||||
break;
|
||||
case 0:
|
||||
this.paging(res, this.list_.list1)
|
||||
break;
|
||||
case 1:
|
||||
this.paging(res, this.list_.list2)
|
||||
break;
|
||||
case 2:
|
||||
this.paging(res, this.list_.list3)
|
||||
break;
|
||||
case 3:
|
||||
this.paging(res, this.list_.list4)
|
||||
break;
|
||||
}
|
||||
uni.hideLoading();
|
||||
},
|
||||
paging(res, list) {
|
||||
if (res.length == 0) {
|
||||
list.status = 'nomore';
|
||||
list.is_end = true;
|
||||
return false;
|
||||
} else {
|
||||
list.status = 'loading';
|
||||
list.page = list.page + 1;
|
||||
setTimeout(() => {
|
||||
list.data = [...list.data, ...res];
|
||||
if (res.length != 10) {
|
||||
list.is_end = true;
|
||||
list.status = 'nomore';
|
||||
|
||||
} else {
|
||||
list.status = 'loading';
|
||||
}
|
||||
}, 500)
|
||||
}
|
||||
this.$forceUpdate();
|
||||
},
|
||||
lower() {
|
||||
switch (this.current) {
|
||||
case 0:
|
||||
this.onReachBottom_fn(this.list_.list0)
|
||||
break;
|
||||
case 1:
|
||||
this.onReachBottom_fn(this.list_.list1)
|
||||
break;
|
||||
case 2:
|
||||
this.onReachBottom_fn(this.list_.list2)
|
||||
break;
|
||||
case 3:
|
||||
this.onReachBottom_fn(this.list_.list3)
|
||||
break;
|
||||
case 4:
|
||||
this.onReachBottom_fn(this.list_.list4)
|
||||
break;
|
||||
}
|
||||
},
|
||||
onReachBottom_fn(list) {
|
||||
if (!list.is_end) {
|
||||
this.get_order_list(this.current);
|
||||
}
|
||||
},
|
||||
// tabs通知swiper切换
|
||||
orderswitch(index) {
|
||||
try {
|
||||
switch (index) {
|
||||
case 0:
|
||||
if (this.list_list0.data.length < 10) {
|
||||
this.form.status = 'nomore';
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if (this.list_list1.data.length < 10) {
|
||||
this.form.status = 'nomore';
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if (this.list_.list2.data.length < 10) {
|
||||
this.form.status = 'nomore';
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
if (this.list_.list3.data.length < 10) {
|
||||
this.form.status = 'nomore';
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
if (this.list_.list4.data.length < 10) {
|
||||
this.form.status = 'nomore';
|
||||
}
|
||||
break;
|
||||
}
|
||||
} catch (e) {
|
||||
//TODO handle the exception
|
||||
}
|
||||
this.swiperCurrent = index;
|
||||
},
|
||||
// 由于swiper的内部机制问题,快速切换swiper不会触发dx的连续变化,需要在结束时重置状态 swiper滑动结束,分别设置tabs和swiper的状态
|
||||
animationfinish(e) {
|
||||
let current = e.detail.current;
|
||||
try {
|
||||
switch (current) {
|
||||
case 0:
|
||||
if (this.list_list0.data.length < 10) {
|
||||
this.form.status = 'nomore';
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if (this.list_list1.data.length < 10) {
|
||||
this.form.status = 'nomore';
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if (this.list_.list2.data.length < 10) {
|
||||
this.form.status = 'nomore';
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
if (this.list_.list3.data.length < 10) {
|
||||
this.form.status = 'nomore';
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
if (this.list_.list4.data.length < 10) {
|
||||
this.form.status = 'nomore';
|
||||
}
|
||||
break;
|
||||
}
|
||||
} catch (e) {
|
||||
//TODO handle the exception
|
||||
}
|
||||
this.swiperCurrent = current;
|
||||
this.current = current;
|
||||
},
|
||||
// clickoverlayshow(e) { //切换文字
|
||||
// switch (e) {
|
||||
// case 1:
|
||||
// this.clickoverlayshowtext = '取消订单'
|
||||
// break;
|
||||
// case 2:
|
||||
// this.clickoverlayshowtext = '删除订单'
|
||||
// break;
|
||||
// }
|
||||
// this.overlayshow = true
|
||||
// },
|
||||
orderordercancel(item) { //取消订单
|
||||
var this_ = this
|
||||
uni.showModal({
|
||||
content: '确定取消订单吗?',
|
||||
confirmColor: '#f55850',
|
||||
cancelColor: '#333333',
|
||||
async success(resdata) {
|
||||
if (resdata.confirm) {
|
||||
let res = await this_.api.orderorderrefund({
|
||||
order_id: item.order_id
|
||||
})
|
||||
if (res.code == 1) {
|
||||
this_.init_fn()
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
async orderokprebook(item) {
|
||||
uni.pro.navigateTo('mall/ship', {
|
||||
id: item.id
|
||||
})
|
||||
},
|
||||
async orderrefuseprebook(e) {
|
||||
var this_ = this
|
||||
uni.showModal({
|
||||
content: '确定取消订单吗?',
|
||||
confirmColor: '#f55850',
|
||||
cancelColor: '#333333',
|
||||
async success(resdata) {
|
||||
if (resdata.confirm) {
|
||||
let res = await this_.api.shoppingorderrefund({
|
||||
order_id: e.id,
|
||||
})
|
||||
if (res.code == 1) {
|
||||
uni.showToast({
|
||||
title: '取消订单并退款成功',
|
||||
icon: 'none'
|
||||
});
|
||||
setTimeout(() => {
|
||||
this_.init_fn()
|
||||
}, 500);
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
orderordercancelrefund(item) { //取消订单去退款
|
||||
uni.pro.navigateTo('my/order/refund', {
|
||||
id: item.order_id
|
||||
})
|
||||
},
|
||||
applylrefund(item) {
|
||||
uni.pro.navigateTo('my/order/applylrefund', {
|
||||
id: item.order_id
|
||||
})
|
||||
},
|
||||
orderorderdelete(item) {
|
||||
var this_ = this
|
||||
if (item.pay_status == 0) {
|
||||
uni.showModal({
|
||||
content: '该笔订单还未付款,是否继续?',
|
||||
confirmColor: '#f55850',
|
||||
cancelColor: '#333333',
|
||||
async success(resdata) {
|
||||
if (resdata.confirm) {
|
||||
let res = await this_.api.orderstartsercive({
|
||||
order_id: item.order_id
|
||||
})
|
||||
if (res.code == 1) {
|
||||
this_.init_fn()
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
} else {
|
||||
uni.showModal({
|
||||
content: '确定开始服务吗?',
|
||||
confirmColor: '#f55850',
|
||||
cancelColor: '#333333',
|
||||
async success(resdata) {
|
||||
if (resdata.confirm) {
|
||||
let res = await this_.api.orderstartsercive({
|
||||
order_id: item.order_id
|
||||
})
|
||||
if (res.code == 1) {
|
||||
this_.init_fn()
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
},
|
||||
async cancelOrder(item) { //取消订单
|
||||
console.log(item)
|
||||
// let res
|
||||
// switch (this.clickoverlayshowtext) {
|
||||
// case '取消订单':
|
||||
// if (item.status == 0) {
|
||||
// res = await this.api.orderordercancel({
|
||||
// order_id: item.order_id
|
||||
// })
|
||||
// } else {
|
||||
// uni.pro.navigateTo('my/order/orderInfo', {
|
||||
// id: e,
|
||||
// e: e
|
||||
// })
|
||||
// }
|
||||
// break;
|
||||
// case '删除订单':
|
||||
// res = await this.api.orderorderdelete({
|
||||
// order_id: item.order_id
|
||||
// })
|
||||
// break;
|
||||
// }
|
||||
// this.overlayshow = false
|
||||
// this.init_fn()
|
||||
},
|
||||
eeInfo(e) { //查看订单详情
|
||||
uni.pro.navigateTo('mall/orderInfo', {
|
||||
id: e.order_id
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
background: #F6F6F6;
|
||||
}
|
||||
|
||||
.content {
|
||||
|
||||
.onecontent {
|
||||
width: 100%;
|
||||
background: #FFFFFF;
|
||||
padding: 10rpx 28rpx;
|
||||
|
||||
.flex-start {
|
||||
flex-wrap: nowrap;
|
||||
|
||||
.onecontent_oen {
|
||||
margin: 0 auto;
|
||||
flex: auto;
|
||||
height: 70rpx;
|
||||
border-radius: 14rpx;
|
||||
border: 2rpx solid #6699FF;
|
||||
padding-right: 8rpx;
|
||||
|
||||
.onecontent_oen_input {
|
||||
padding-left: 32rpx;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.onecontent_oen_text {
|
||||
font-size: 28rpx;
|
||||
font-family: PingFang SC-Regular, PingFang SC;
|
||||
font-weight: 400;
|
||||
color: #FFFFFF;
|
||||
text-align: center;
|
||||
line-height: 56rpx;
|
||||
width: 80rpx;
|
||||
height: 56rpx;
|
||||
background: #6699FF;
|
||||
border-radius: 14rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.onecontent_oen_right {
|
||||
margin-left: 26rpx;
|
||||
|
||||
.onecontent_oen_rightimage {
|
||||
width: 17.9rpx;
|
||||
height: 19.34rpx;
|
||||
}
|
||||
|
||||
.onecontent_oen_rightimageview {
|
||||
text-align: center;
|
||||
width: 140rpx;
|
||||
margin-left: 10rpx;
|
||||
font-size: 28rpx;
|
||||
font-family: PingFang SC-Regular, PingFang SC;
|
||||
font-weight: 400;
|
||||
color: #333333;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.onecontent_tow {
|
||||
padding: 32rpx 0 32rpx 0;
|
||||
width: 100%;
|
||||
|
||||
.onecontent_tow_item {
|
||||
position: relative;
|
||||
|
||||
.onecontent_tow_itemtexts {
|
||||
font-size: 32rpx;
|
||||
font-family: PingFang SC-Bold, PingFang SC;
|
||||
font-weight: bold;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.onecontent_tow_itemtext {
|
||||
font-size: 28rpx;
|
||||
font-family: PingFang SC-Regular, PingFang SC;
|
||||
font-weight: 400;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
.onecontent_tow_itemtexts::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
bottom: -10rpx;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
width: 19.33rpx;
|
||||
height: 6.66rpx;
|
||||
background: url(https://ointmentweapp.oss-cn-beijing.aliyuncs.com/image/my/order/order1.png) no-repeat;
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.towcontent {
|
||||
padding: 0 28rpx;
|
||||
|
||||
.flex-colum_image {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 100%;
|
||||
|
||||
text {
|
||||
margin-top: 30rpx;
|
||||
font-size: 32rpx;
|
||||
font-family: PingFang SC-Bold, PingFang SC;
|
||||
font-weight: bold;
|
||||
color: #666666;
|
||||
}
|
||||
}
|
||||
|
||||
.towcontentitem {
|
||||
margin-top: 32rpx;
|
||||
padding: 24rpx;
|
||||
width: 100%;
|
||||
background: #FFFFFF;
|
||||
border-radius: 12rpx;
|
||||
|
||||
.towcontentitemone {
|
||||
width: 100%;
|
||||
padding-bottom: 16rpx;
|
||||
border-bottom: 1px solid #F6F6F6;
|
||||
|
||||
.towcontentitemone_one {
|
||||
font-size: 28rpx;
|
||||
width: 60%;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
font-family: PingFang SC-Bold, PingFang SC;
|
||||
font-weight: bold;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.towcontentitemone_tow {
|
||||
font-size: 28rpx;
|
||||
font-family: PingFang SC-Regular, PingFang SC;
|
||||
font-weight: 400;
|
||||
color: #666666;
|
||||
|
||||
.towcontentitemone_towimage {
|
||||
margin-right: 10rpx;
|
||||
width: 24rpx;
|
||||
height: 24rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.towcontentitemtow {
|
||||
position: relative;
|
||||
padding: 22rpx 0;
|
||||
border-bottom: 1px solid #F6F6F6;
|
||||
|
||||
.towcontentitemtow_imge {
|
||||
width: 144rpx;
|
||||
height: 144rpx;
|
||||
background: #666666;
|
||||
border-radius: 12rpx;
|
||||
}
|
||||
|
||||
.towcontentitemtow_one {
|
||||
margin-left:40rpx;
|
||||
flex: auto;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
position: relative;
|
||||
|
||||
.towcontentitemtow_one_one {
|
||||
flex: auto;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: break-spaces;
|
||||
font-size: 28rpx;
|
||||
font-family: PingFang SC-Regular, PingFang SC;
|
||||
font-weight: 400;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.flex-colum {
|
||||
flex: 1;
|
||||
margin-left: 10rpx;
|
||||
|
||||
.towcontentitemtow_one_there {
|
||||
font-size: 24rpx;
|
||||
font-family: SourceHanSansCN-Regular, SourceHanSansCN;
|
||||
font-weight: 400;
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
.towcontentitemtow_one_tow {
|
||||
font-size: 36rpx;
|
||||
font-family: Helvetica-Bold, Helvetica;
|
||||
font-weight: bold;
|
||||
color: #333333;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.towcontentitemtow_tow {
|
||||
position: absolute;
|
||||
bottom: 32rpx;
|
||||
right: 0;
|
||||
font-size: 28rpx;
|
||||
font-family: Roboto-Regular, Roboto;
|
||||
font-weight: 400;
|
||||
color: #999999;
|
||||
}
|
||||
}
|
||||
|
||||
.towcontentitemthere_text_iitem {
|
||||
width: 100%;
|
||||
margin-top: 16rpx;
|
||||
font-size: 24rpx;
|
||||
font-family: Source Han Sans CN-Bold, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
color: #333333;
|
||||
|
||||
text {
|
||||
font-size: 28rpx;
|
||||
font-family: Source Han Sans CN-Bold, Source Han Sans CN;
|
||||
font-weight: bold;
|
||||
color: #333333;
|
||||
}
|
||||
}
|
||||
|
||||
.towcontentitemthere {
|
||||
width: 100%;
|
||||
margin-top: 16rpx;
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
|
||||
.towcontentitemthereitem {
|
||||
margin-left: 24rpx;
|
||||
padding: 8rpx 32rpx;
|
||||
font-size: 28rpx;
|
||||
border-radius: 28rpx;
|
||||
}
|
||||
|
||||
.towcontentitemthereitem_one {
|
||||
background: linear-gradient(101deg, #FA8E5D 0%, #F45E4D 100%);
|
||||
font-family: PingFang SC-Bold, PingFang SC;
|
||||
font-weight: bold;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
.towcontentitemthereitem_tow {
|
||||
background: #F6F6F6;
|
||||
font-family: PingFang SC-Bold, PingFang SC;
|
||||
font-weight: bold;
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
.towcontentitemthereitem_there {
|
||||
background: linear-gradient(303deg, #9FC9FF 0%, #6699FF 100%);
|
||||
font-family: SourceHanSansCN-Regular, SourceHanSansCN;
|
||||
font-weight: 400;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.warp {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 100%;
|
||||
|
||||
.rect {
|
||||
padding: 40rpx 68rpx;
|
||||
width: 480rpx;
|
||||
background: #FFFFFF;
|
||||
border-radius: 42rpx;
|
||||
|
||||
.rectone {
|
||||
font-size: 32rpx;
|
||||
font-family: Source Han Sans CN-Bold, Source Han Sans CN;
|
||||
font-weight: bold;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.recttow {
|
||||
width: 100%;
|
||||
margin-top: 32rpx;
|
||||
|
||||
.recttow_one {
|
||||
padding: 8rpx 40rpx;
|
||||
background: #FFFFFF;
|
||||
border-radius: 26rpx;
|
||||
border: 2rpx solid #999999;
|
||||
font-size: 28rpx;
|
||||
font-family: Source Han Sans CN-Regular, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.recttow_tow {
|
||||
padding: 8rpx 40rpx;
|
||||
background: #333333;
|
||||
font-size: 28rpx;
|
||||
font-family: Source Han Sans CN-Medium, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
color: #FFFFFF;
|
||||
border-radius: 26rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
</style>
|
||||
617
pages/mall/orderInfo.vue
Normal file
617
pages/mall/orderInfo.vue
Normal file
@@ -0,0 +1,617 @@
|
||||
<template>
|
||||
<view class="index">
|
||||
<!-- <view class="onecontent">
|
||||
<view class="onecontentone">
|
||||
<text v-if="datalist.status == 0">待支付</text>
|
||||
<text v-if="datalist.status == 1">已支付</text>
|
||||
<text v-if="datalist.status == 2">等待确认</text>
|
||||
<text v-if="datalist.status == 3">已确认</text>
|
||||
<text v-if="datalist.status == 4">已完成 </text>
|
||||
<text v-if="datalist.status == 5">已取消</text>
|
||||
<text v-if="datalist.status == 6">退款中</text>
|
||||
<text v-if="datalist.status == 7">已退款</text>
|
||||
</view>
|
||||
<view class="onecontenttow">
|
||||
感谢您的支持,欢迎再次光临
|
||||
</view>
|
||||
<view class="onecontentthere flex-between">
|
||||
<view class="onecontentthere_one" v-if="datalist.status == 5 || datalist.status == 4 "
|
||||
@click="orderorderdelete(datalist)">
|
||||
删除订单
|
||||
</view>
|
||||
<view class="onecontentthere_tow"
|
||||
v-if="datalist.status == 1 || datalist.status == 2 ||datalist.status == 3"
|
||||
@click="orderordercancelrefund(datalist)">
|
||||
申请退款
|
||||
</view>
|
||||
</view>
|
||||
</view> -->
|
||||
<view class="towcontent">
|
||||
<view class="towcontentone flex-between">
|
||||
<view class="towcontentone_one flex-start">
|
||||
<u-icon name="home" color="#ffffff" size="20"></u-icon>
|
||||
<text class="towcontentone_one_text">{{datalist.store_title}}</text>
|
||||
</view>
|
||||
<u-icon @click="phonefill(datalist.mobile)" name="phone-fill" color="#ffffff" size="20"></u-icon>
|
||||
</view>
|
||||
<view class="towcontenttow flex-start" v-for="(item,index) in datalist.goods" :key="index"
|
||||
@click="detailsInfo(item.goods_id)">
|
||||
<image class="towcontenttow_image" :src="item.img" mode=""></image>
|
||||
<view class="towcontenttowone flex-colum-start">
|
||||
<view class="towcontenttowone_one">
|
||||
{{item.title}}
|
||||
</view>
|
||||
<view class="towcontenttowone_tow flex-start">
|
||||
<view class="towcontenttowone_tow_one flex-start">
|
||||
<u-icon name="checkmark-circle" color="#999999" size="14"></u-icon>
|
||||
随时退
|
||||
</view>
|
||||
<view class="towcontenttowone_tow_one flex-start">
|
||||
<u-icon name="checkmark-circle" color="#999999" size="14"></u-icon>
|
||||
过期退
|
||||
</view>
|
||||
</view>
|
||||
<view class="towcontenttowone_there">
|
||||
{{item.spec||''}}
|
||||
</view>
|
||||
<view class="towcontenttowone_four">
|
||||
¥{{item.price}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!--<view class="towcontentthere flex-between">
|
||||
<text class="towcontentthere_text"></text>
|
||||
</view>
|
||||
<view class="qr-box flex-colum" @longpress="save()">
|
||||
<canvas canvas-id="qrcode" style="width:288rpx;" />
|
||||
</view>
|
||||
<view class="towcontenttfour flex-colum">
|
||||
123 2345 567
|
||||
</view> -->
|
||||
<!-- <view class="towcontenttfive flex-between">
|
||||
<view class="towcontenttfive_one flex-start">
|
||||
<view class="towcontenttfive_oneone">
|
||||
退款:
|
||||
</view>
|
||||
<view class="towcontenttfive_onetow">
|
||||
08-22 23:59:59到期
|
||||
</view>
|
||||
</view>
|
||||
<view class="towcontenttfive_tow">
|
||||
申请退款
|
||||
</view>
|
||||
</view> -->
|
||||
</view>
|
||||
<view class="therecontent">
|
||||
<view class="therecontentone">
|
||||
订单信息
|
||||
</view>
|
||||
<view class="therecontentsix entowakst" v-if="datalist.people_nickname">
|
||||
发型师:{{datalist.people_nickname}}
|
||||
</view>
|
||||
<view class="therecontentow entowakst">
|
||||
实付金额:<text>¥{{datalist.price}}</text>
|
||||
</view>
|
||||
<view class="therecontentthere entowakst">
|
||||
购买数量:{{datalist.number}}
|
||||
</view>
|
||||
<view class="therecontentthere entowakst">
|
||||
购买数量:{{datalist.username}}
|
||||
</view>
|
||||
<view class="therecontenfour entowakst">
|
||||
手机号码:{{datalist.mobile.replace(/(\d{3})\d{4}(\d{4})/, '$1****$2') || '-'}}
|
||||
</view>
|
||||
<view class="therecontentthere entowakst">
|
||||
收货地址:{{datalist.address}}
|
||||
</view>
|
||||
<view class="therecontentfive flex-start entowakst">
|
||||
订单编号:{{datalist.out_trade_no}}
|
||||
<text class="therecontentfive_box" @click="copy(datalist.out_trade_no)">复制</text>
|
||||
</view>
|
||||
<view class="therecontentsix entowakst">
|
||||
下单时间:{{datalist.createtime}}
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view class="fourcontent">
|
||||
<view class="fourcontentone">
|
||||
购买须知
|
||||
</view>
|
||||
<view v-html="datalist.details">
|
||||
|
||||
</view>
|
||||
<view class="entowakst" v-html="datalist.details">
|
||||
·预约须知:请您提前1小时预约
|
||||
</view>
|
||||
</view> -->
|
||||
<!-- <view class="fivecontent">
|
||||
<view class="fivecontentone">
|
||||
用户评价
|
||||
</view>
|
||||
<view class="fivecontenttow flex-between">
|
||||
<view class="fivecontenttow_one flex-start">
|
||||
<text class="fivecontenttow_text">综合评分</text>
|
||||
<u-rate :count="5" value="4" active-color="#f1cb66" inactive-color="#F1CB66"></u-rate>
|
||||
</view>
|
||||
<view class="fivecontenttow_tow">
|
||||
满意
|
||||
</view>
|
||||
</view>
|
||||
</view> -->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// import uQRCode from '@/common/js/uqrCode.js'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
datalist: {},
|
||||
imgCode: '', // 后续保存到手机相册所需要用到的字段}
|
||||
form: {
|
||||
phone: '18092171236'
|
||||
}
|
||||
}
|
||||
},
|
||||
async onLoad(e) {
|
||||
try {
|
||||
let res = await this.api.shoppingorderdetailt({
|
||||
order_id: e.id
|
||||
})
|
||||
if (res) {
|
||||
this.datalist = res.data
|
||||
this.datalist.details = res.data.details.replace(/\<img/g,
|
||||
'<img style="max-width:100%;height:auto" ');
|
||||
}
|
||||
} catch (e) {}
|
||||
// this.generate()
|
||||
},
|
||||
methods: {
|
||||
orderorderdelete(item) { //删除订单
|
||||
uni.showModal({
|
||||
content: '确定删除订单吗?',
|
||||
confirmColor: '#f55850',
|
||||
cancelColor: '#333333',
|
||||
async success(resdata) {
|
||||
if (resdata.confirm) {
|
||||
await this.api.orderorderdelete({
|
||||
order_id: item.order_id
|
||||
})
|
||||
uni.navigateBack()
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
orderordercancelrefund(item) { //取消订单去退款
|
||||
console.log(item)
|
||||
uni.pro.navigateTo('my/order/refund', {
|
||||
id: item.order_id
|
||||
})
|
||||
},
|
||||
// 生成二维码事件
|
||||
generate(e) {
|
||||
uQRCode.make({
|
||||
canvasId: 'qrcode',
|
||||
componentInstance: this,
|
||||
text: "https://ky.sxczgkj.cn/wap/merchant/authPay?userAppId=244", // 想生成二维码到内容
|
||||
size: 150,
|
||||
margin: 0,
|
||||
backgroundColor: '#ffffff',
|
||||
foregroundColor: '#000000',
|
||||
fileType: 'jpg',
|
||||
errorCorrectLevel: uQRCode.errorCorrectLevel.H,
|
||||
success: res => {
|
||||
this.imgCode = res // base64的图片格式
|
||||
}
|
||||
})
|
||||
},
|
||||
// 保存到手机
|
||||
save() {
|
||||
uni.getSetting({ //获取用户的当前设置
|
||||
success: (res) => {
|
||||
if (res.authSetting['scope.writePhotosAlbum']) { //验证用户是否授权可以访问相册
|
||||
this.aveImageToPhotosAlbum();
|
||||
} else {
|
||||
uni.authorize({ //如果没有授权,向用户发起请求
|
||||
scope: 'scope.writePhotosAlbum',
|
||||
success: () => {
|
||||
this.aveImageToPhotosAlbum();
|
||||
},
|
||||
fail: () => {
|
||||
// 提示
|
||||
uni.showToast({
|
||||
title: "请打开保存相册权限,再点击保存到手机",
|
||||
icon: "none",
|
||||
duration: 3000
|
||||
});
|
||||
setTimeout(() => {
|
||||
uni.openSetting({ //调起客户端小程序设置界面,让用户开启访问相册
|
||||
success: (res2) => {
|
||||
// console.log(res2.authSetting)
|
||||
}
|
||||
});
|
||||
}, 3000);
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
copy(value) {
|
||||
//提示模板
|
||||
uni.setClipboardData({
|
||||
data: value, //要被复制的内容
|
||||
success: () => { //复制成功的回调函数
|
||||
uni.showToast({
|
||||
title: '复制成功'
|
||||
})
|
||||
}
|
||||
});
|
||||
},
|
||||
detailsInfo(e) { //查看订单详情
|
||||
uni.pro.navigateTo('my/order/cporderinfo', {
|
||||
id: e,
|
||||
})
|
||||
},
|
||||
phonefill(value) {
|
||||
uni.makePhoneCall({
|
||||
phoneNumber: value //仅为示例
|
||||
});
|
||||
},
|
||||
aveImageToPhotosAlbum() {
|
||||
let base64 = this.imgCode.replace(/^data:image\/\w+;base64,/, ""); //去掉data:image/png;base64,
|
||||
let filePath = wx.env.USER_DATA_PATH + '/ph_fit_qrcode.png'; // 路径文件名
|
||||
uni.showLoading({
|
||||
title: '加载中',
|
||||
mask: true
|
||||
})
|
||||
uni.getFileSystemManager().writeFile({ // 获取全局唯一的文件管理器
|
||||
filePath: filePath, //创建一个临时文件名
|
||||
data: base64, //写入的文本或二进制数据
|
||||
encoding: 'base64', //写入当前文件的字符编码
|
||||
success: res => {
|
||||
uni.saveImageToPhotosAlbum({ // 保存图片到系统相册
|
||||
filePath: filePath,
|
||||
success: function(res2) {
|
||||
uni.hideLoading();
|
||||
uni.showToast({
|
||||
title: '保存成功',
|
||||
icon: "none",
|
||||
duration: 5000
|
||||
})
|
||||
},
|
||||
fail: function(err) {
|
||||
uni.hideLoading();
|
||||
// console.log(err.errMsg);
|
||||
}
|
||||
})
|
||||
},
|
||||
fail: err => {
|
||||
uni.hideLoading();
|
||||
//console.log(err)
|
||||
}
|
||||
})
|
||||
},
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
background: #F6F6F6;
|
||||
}
|
||||
|
||||
.index {
|
||||
padding: 32rpx 28rpx;
|
||||
|
||||
.onecontent {
|
||||
width: 100%;
|
||||
padding: 32rpx;
|
||||
background: #FFFFFF;
|
||||
border-radius: 12rpx;
|
||||
|
||||
.onecontentone {
|
||||
font-size: 32rpx;
|
||||
font-family: SourceHanSansCN-Medium-, SourceHanSansCN-Medium;
|
||||
font-weight: normal;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.onecontenttow {
|
||||
margin-top: 16rpx;
|
||||
font-size: 24rpx;
|
||||
font-family: SourceHanSansCN-Regular-, SourceHanSansCN-Regular;
|
||||
font-weight: normal;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
.onecontentthere {
|
||||
margin-top: 24rpx;
|
||||
|
||||
.onecontentthere_one {
|
||||
background: #333333;
|
||||
border-radius: 8rpx;
|
||||
padding: 16rpx 94rpx;
|
||||
font-size: 28rpx;
|
||||
font-family: Source Han Sans CN-Medium, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
.onecontentthere_tow {
|
||||
background: #F7F7F7;
|
||||
border-radius: 8rpx;
|
||||
padding: 16rpx 94rpx;
|
||||
font-size: 28rpx;
|
||||
font-family: Source Han Sans CN-Medium, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
|
||||
color: #333333;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.towcontent {
|
||||
margin-top: 24rpx;
|
||||
width: 100%;
|
||||
background: #FFFFFF;
|
||||
border-radius: 18rpx;
|
||||
|
||||
.towcontentone {
|
||||
position: relative;
|
||||
padding: 16rpx 32rpx;
|
||||
border-radius: 18rpx 18rpx 0 0;
|
||||
background: #9397c1;
|
||||
|
||||
.towcontentone_one {
|
||||
width: 80%;
|
||||
|
||||
.towcontentone_one_image {
|
||||
width: 33.04rpx;
|
||||
height: 29.79rpx;
|
||||
}
|
||||
|
||||
.towcontentone_one_text {
|
||||
width: 80%;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
margin-left: 10rpx;
|
||||
font-size: 28rpx;
|
||||
font-family: SourceHanSansCN-Bold-, SourceHanSansCN-Bold;
|
||||
font-weight: normal;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
}
|
||||
|
||||
.towcontentone_one::after {
|
||||
z-index: 10;
|
||||
position: absolute;
|
||||
bottom: -22rpx;
|
||||
content: '';
|
||||
display: inline-block;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
width: 44rpx;
|
||||
height: 44rpx;
|
||||
border-radius: 0 0 22rpx 22rpx;
|
||||
background: #9397c1;
|
||||
}
|
||||
}
|
||||
|
||||
.towcontenttow {
|
||||
padding: 32rpx;
|
||||
width: 100%;
|
||||
background: #fff;
|
||||
|
||||
.towcontenttow_image {
|
||||
width: 128rpx;
|
||||
height: 128rpx;
|
||||
}
|
||||
|
||||
.towcontenttowone {
|
||||
height: 128rpx;
|
||||
margin-left: 36rpx;
|
||||
justify-content: space-around;
|
||||
|
||||
.towcontenttowone_one {
|
||||
font-size: 28rpx;
|
||||
font-family: SourceHanSansCN-Regular-, SourceHanSansCN-Regular;
|
||||
font-weight: normal;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.towcontenttowone_tow {
|
||||
.towcontenttowone_tow_one {
|
||||
font-size: 24rpx;
|
||||
font-family: SourceHanSansCN-Regular-, SourceHanSansCN-Regular;
|
||||
font-weight: normal;
|
||||
color: #999999;
|
||||
}
|
||||
}
|
||||
|
||||
.towcontenttowone_there {
|
||||
font-size: 32rpx;
|
||||
font-family: SourceHanSansCN-Bold-, SourceHanSansCN-Bold;
|
||||
font-weight: normal;
|
||||
color: #333333;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.towcontentthere {
|
||||
position: relative;
|
||||
height: 44rpx;
|
||||
width: 100%;
|
||||
|
||||
.towcontentthere_text {
|
||||
width: 100%;
|
||||
height: 0px;
|
||||
border: 1rpx dashed #EAEAEA;
|
||||
}
|
||||
|
||||
.towcontentthere_text::after {
|
||||
z-index: 10;
|
||||
position: absolute;
|
||||
content: '';
|
||||
display: inline-block;
|
||||
left: 0;
|
||||
top: 0;
|
||||
width: 22rpx;
|
||||
height: 44rpx;
|
||||
border-radius: 0 44rpx 44rpx 0;
|
||||
background: #f6f6f6;
|
||||
}
|
||||
|
||||
.towcontentthere_text::before {
|
||||
z-index: 10;
|
||||
position: absolute;
|
||||
content: '';
|
||||
display: inline-block;
|
||||
right: 0;
|
||||
top: 0;
|
||||
width: 22rpx;
|
||||
height: 44rpx;
|
||||
border-radius: 44rpx 0 0 44rpx;
|
||||
background: #f6f6f6;
|
||||
}
|
||||
}
|
||||
|
||||
.towcontenttfour {
|
||||
margin-top: 16rpx;
|
||||
font-size: 32rpx;
|
||||
font-family: SourceHanSansCN-Bold-, SourceHanSansCN-Bold;
|
||||
font-weight: normal;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.towcontenttfive {
|
||||
padding: 32rpx;
|
||||
width: 100%;
|
||||
|
||||
.towcontenttfive_one {
|
||||
font-size: 32rpx;
|
||||
font-family: SourceHanSansCN-Regular-, SourceHanSansCN-Regular;
|
||||
font-weight: normal;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.towcontenttfive_onetow {
|
||||
margin-left: 16rpx;
|
||||
font-size: 24rpx;
|
||||
font-family: SourceHanSansCN-Regular-, SourceHanSansCN-Regular;
|
||||
font-weight: normal;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
.towcontenttfive_tow {
|
||||
padding: 10rpx 16rpx;
|
||||
background: #FFFFFF;
|
||||
border-radius: 8rpx;
|
||||
border: 2rpx solid #D5D5D5;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.therecontent {
|
||||
margin-top: 24rpx;
|
||||
padding: 32rpx;
|
||||
width: 100%;
|
||||
background: #FFFFFF;
|
||||
border-radius: 18rpx;
|
||||
|
||||
.therecontentone {
|
||||
font-size: 28rpx;
|
||||
font-family: Source Han Sans CN-Bold, Source Han Sans CN;
|
||||
font-weight: bold;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.entowakst {
|
||||
font-size: 28rpx;
|
||||
font-family: SourceHanSansCN-Regular-, SourceHanSansCN-Regular;
|
||||
font-weight: normal;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.therecontentfive_box {
|
||||
padding: 6rpx 10rpx;
|
||||
font-size: 20rpx;
|
||||
font-family: SourceHanSansCN-Regular-, SourceHanSansCN-Regular;
|
||||
font-weight: normal;
|
||||
color: #666666;
|
||||
background: #FFFFFF;
|
||||
margin-left: 6rpx;
|
||||
border-radius: 8rpx;
|
||||
border: 2rpx solid #D5D5D5;
|
||||
}
|
||||
}
|
||||
|
||||
.fourcontent {
|
||||
margin-top: 24rpx;
|
||||
padding: 32rpx;
|
||||
width: 100%;
|
||||
background: #FFFFFF;
|
||||
border-radius: 18rpx;
|
||||
|
||||
.fourcontentone {
|
||||
font-size: 28rpx;
|
||||
font-family: Source Han Sans CN-Bold, Source Han Sans CN;
|
||||
font-weight: bold;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.fourcontentone::after {
|
||||
content: '';
|
||||
display: inline-block;
|
||||
width: 100%;
|
||||
height: 1rpx;
|
||||
border: 1px solid #F7F7F7;
|
||||
}
|
||||
|
||||
.entowakst {
|
||||
font-size: 24rpx;
|
||||
font-family: PingFang SC-Medium, PingFang SC;
|
||||
font-weight: 500;
|
||||
color: #666666;
|
||||
}
|
||||
}
|
||||
|
||||
.fivecontent {
|
||||
margin-top: 24rpx;
|
||||
padding: 32rpx;
|
||||
width: 100%;
|
||||
background: #FFFFFF;
|
||||
border-radius: 18rpx;
|
||||
|
||||
.fivecontentone {
|
||||
font-size: 28rpx;
|
||||
font-family: Source Han Sans CN-Bold, Source Han Sans CN;
|
||||
font-weight: bold;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.fivecontenttow {
|
||||
margin-top: 16rpx;
|
||||
|
||||
.fivecontenttow_one {
|
||||
.fivecontenttow_text {
|
||||
padding-right: 24rpx;
|
||||
font-size: 28rpx;
|
||||
font-family: SourceHanSansCN-Regular-, SourceHanSansCN-Regular;
|
||||
font-weight: normal;
|
||||
color: #333333;
|
||||
}
|
||||
}
|
||||
|
||||
.fivecontenttow_tow {
|
||||
font-size: 24rpx;
|
||||
font-family: SourceHanSansCN-Regular-, SourceHanSansCN-Regular;
|
||||
font-weight: normal;
|
||||
color: #666666;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
166
pages/mall/ship.vue
Normal file
166
pages/mall/ship.vue
Normal file
@@ -0,0 +1,166 @@
|
||||
<template>
|
||||
<view class="index">
|
||||
<view class="title_text">
|
||||
创建分类
|
||||
</view>
|
||||
<view class="onecontent">
|
||||
<view class="onecontent_item flex-between">
|
||||
<view class="onecontent_itemleft">
|
||||
快递公司
|
||||
</view>
|
||||
<view class="onecontent_itemright flex-start">
|
||||
<input class="onecontent_itemright_text" v-model="form.company" maxlength="8" type="text"
|
||||
placeholder="请输入快递公司">
|
||||
</view>
|
||||
</view>
|
||||
<view class="onecontent_item flex-between">
|
||||
<view class="onecontent_itemleft">
|
||||
快递单号
|
||||
</view>
|
||||
<view class="onecontent_itemright flex-start">
|
||||
<input class="onecontent_itemright_text" v-model="form.express" maxlength="8" type="text"
|
||||
placeholder="请输入快递单号">
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="thereconse thereconses" @click="shoppingorsuboutgoods">
|
||||
确定
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
form: {
|
||||
order_id: '',
|
||||
company: '',
|
||||
express: ""
|
||||
}
|
||||
}
|
||||
},
|
||||
async onLoad(e) {
|
||||
this.form.order_id = e.id
|
||||
},
|
||||
methods: {
|
||||
async shoppingorsuboutgoods() {
|
||||
if (this.form.company == null || this.form.company == '') {
|
||||
uni.showToast({
|
||||
title: '请输入快递公司',
|
||||
icon: 'none'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if (this.form.express == null || this.form.express == '') {
|
||||
uni.showToast({
|
||||
title: '请输入快递单号',
|
||||
icon: 'none'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
let res = await this.api.shoppingorsuboutgoods({
|
||||
order_id: this.form.order_id,
|
||||
company: this.form.company,
|
||||
express: this.form.express
|
||||
});
|
||||
if (res.code == 1) {
|
||||
uni.showToast({
|
||||
title: '提交成功',
|
||||
icon: 'none'
|
||||
});
|
||||
setTimeout(() => {
|
||||
uni.navigateBack();
|
||||
}, 1000);
|
||||
}
|
||||
},
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
background: #F6F6F6;
|
||||
}
|
||||
|
||||
.index {
|
||||
.title_text {
|
||||
padding: 12rpx 40rpx;
|
||||
font-size: 28rpx;
|
||||
font-family: SourceHanSansCN-Regular, SourceHanSansCN;
|
||||
font-weight: 400;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
#editor {
|
||||
width: 100%;
|
||||
height: 456rpx;
|
||||
padding: 12rpx 40rpx;
|
||||
background: #FFFFFF;
|
||||
}
|
||||
|
||||
.onecontent {
|
||||
background: #ffffff;
|
||||
|
||||
.onecontent_item {
|
||||
width: 100%;
|
||||
padding: 16rpx 46rpx;
|
||||
border-bottom: 2rpx solid #E5E5E5;
|
||||
|
||||
.onecontent_itemleft {
|
||||
flex: 1;
|
||||
font-size: 28rpx;
|
||||
font-family: SourceHanSansCN-Regular, SourceHanSansCN;
|
||||
font-weight: 400;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
.onecontent_itemright {
|
||||
flex: 3;
|
||||
|
||||
.onecontent_itemrighttext {
|
||||
font-size: 24rpx;
|
||||
font-family: SourceHanSansCN-Regular, SourceHanSansCN;
|
||||
font-weight: 400;
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
.onecontent_itemrightimges {
|
||||
width: 112rpx;
|
||||
height: 112rpx;
|
||||
background: #F5F5F5;
|
||||
border-radius: 10rpx;
|
||||
font-size: 40rpx;
|
||||
color: #878787;
|
||||
}
|
||||
|
||||
.onecontent_itemright_text {
|
||||
width: 100%;
|
||||
font-size: 24rpx;
|
||||
font-family: SourceHanSansCN-Regular, SourceHanSansCN;
|
||||
font-weight: 400;
|
||||
color: #999999;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.thereconse {
|
||||
width: 630rpx;
|
||||
height: 80rpx;
|
||||
background: #999999;
|
||||
border-radius: 40rpx;
|
||||
font-size: 36rpx;
|
||||
text-align: center;
|
||||
margin: 84rpx auto;
|
||||
font-family: PingFang SC-Bold, PingFang SC;
|
||||
font-weight: bold;
|
||||
color: #FFFFFF;
|
||||
line-height: 80rpx;
|
||||
}
|
||||
|
||||
.thereconses {
|
||||
background: linear-gradient(115deg, #7E81A5 0%, #4D4E64 100%);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
165
pages/my/index.vue
Normal file
165
pages/my/index.vue
Normal file
@@ -0,0 +1,165 @@
|
||||
<template>
|
||||
<view>
|
||||
<view class="index_box">
|
||||
|
||||
<view class="onebox">
|
||||
<view class="onebox_one">
|
||||
<text class="onebox_one_text">我的订单</text>
|
||||
<view class="onebox_one_one flex-around">
|
||||
<view class="flex-colum" v-for="(item,index) in 4" :key="index" @click="order(index)">
|
||||
<text>待付款</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="towbox flex-between">
|
||||
<view class="towbox_item flex-start" v-for="(item,index) in 2">
|
||||
<image src="@/static/logo.png" mode=""></image>
|
||||
<view class="flex-colum">
|
||||
<text>余额</text>
|
||||
<view>0<text>元</text></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="therebox">
|
||||
<view class="therebox_item flex-between" v-for="(item,index) in 3">
|
||||
<view class="flex-start">
|
||||
<image src="@/static/logo.png" mode=""></image>
|
||||
<text>优惠券</text>
|
||||
</view>
|
||||
<u-icon name="arrow-right" color="#9b9b9b" size="14"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<bottombbar :valuebbar='3'></bottombbar>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
navtitle: '', //名称
|
||||
navboxshow: '0', //显示
|
||||
Background: 'none',
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
order(e){
|
||||
uni.pro.navigateTo('my/order/index',{e:e})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
background: #F9F9F9;
|
||||
}
|
||||
|
||||
.index_box {
|
||||
padding: 0 32rpx;
|
||||
width: 100%;
|
||||
height: 502rpx;
|
||||
background-size: cover;
|
||||
|
||||
.index_boxone {
|
||||
image {
|
||||
width: 124rpx;
|
||||
height: 124rpx;
|
||||
border-radius: 50%;
|
||||
}
|
||||
}
|
||||
.onebox {
|
||||
position: relative;
|
||||
top:40rpx;
|
||||
.onebox_one {
|
||||
width: 100%;
|
||||
background: #FFFFFF;
|
||||
border-radius: 12rpx;
|
||||
padding: 32rpx;
|
||||
.onebox_one_text{
|
||||
font-size: 32rpx;
|
||||
font-family: PingFang SC-Bold, PingFang SC;
|
||||
font-weight: bold;
|
||||
color: #333333;
|
||||
}
|
||||
.onebox_one_one{
|
||||
margin-top: 32rpx;
|
||||
.flex-colum{
|
||||
image{
|
||||
width: 64rpx;
|
||||
height: 64rpx;
|
||||
}
|
||||
text{
|
||||
margin-top: 16rpx;
|
||||
font-size: 28rpx;
|
||||
font-family: PingFang SC-Medium, PingFang SC;
|
||||
font-weight: 500;
|
||||
color: #333333;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.towbox{
|
||||
margin-top: 64rpx;
|
||||
.towbox_item{
|
||||
width:48%;
|
||||
background: #FFFFFF;
|
||||
padding: 32rpx 30rpx;
|
||||
border-radius:12rpx;
|
||||
image{
|
||||
width: 100rpx;
|
||||
height: 100rpx;
|
||||
}
|
||||
.flex-colum{
|
||||
margin-left: 28rpx;
|
||||
text{
|
||||
font-size: 28rpx;
|
||||
font-family: Source Han Sans CN-Medium, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
color: #999999;
|
||||
}
|
||||
view{
|
||||
font-size: 32rpx;
|
||||
font-family: Source Han Sans CN-Medium, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
color: #333333;
|
||||
text{
|
||||
color: #333333;
|
||||
font-size: 22rpx;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
.therebox{
|
||||
margin-top: 32rpx;
|
||||
width: 100%;
|
||||
background: #FFFFFF;
|
||||
border-radius:12rpx;
|
||||
padding:0 32rpx 32rpx 32rpx;
|
||||
.therebox_item{
|
||||
padding-top: 32rpx;
|
||||
.flex-start{
|
||||
image{
|
||||
width: 32rpx;
|
||||
height: 32rpx;
|
||||
}
|
||||
text{
|
||||
margin-left: 24rpx;
|
||||
font-size: 28rpx;
|
||||
font-family: Source Han Sans CN-Regular, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
color: #333333;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
</style>
|
||||
539
pages/my/order/index.vue
Normal file
539
pages/my/order/index.vue
Normal file
@@ -0,0 +1,539 @@
|
||||
<template>
|
||||
<view class="content">
|
||||
<view class="onecontent">
|
||||
<view class="onecontent_oen flex-start">
|
||||
<input class="onecontent_oen_input" type="text" placeholder="搜索订单/商家名/商品名">
|
||||
<text class="onecontent_oen_text">搜索</text>
|
||||
</view>
|
||||
<view class="onecontent_tow flex-between">
|
||||
<view ref="uTabs" class="onecontent_tow_item flex-colum" v-for="(item,index) in swipercurrentdata"
|
||||
:key="index" @click="orderswitch(index)">
|
||||
<view :class="swiperCurrent == index?'onecontent_tow_itemtexts':'onecontent_tow_itemtext'">
|
||||
{{item.name}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="towcontent">
|
||||
<swiper :current="swiperCurrent" @animationfinish="animationfinish" :style="{height:height}">
|
||||
<swiper-item v-for="(item, index) in list_" :key="index">
|
||||
<scroll-view scroll-y style="width: 100%;" :style="{height:height}" @scrolltolower="lower">
|
||||
<view class="towcontentitem" v-for="(item,index1) in list_[index].data" :key="index1">
|
||||
<view class="towcontentitemone flex-between">
|
||||
<text class="towcontentitemone_one">KIKI美发(龙首店)</text>
|
||||
<view class="towcontentitemone_tow flex-start">
|
||||
<image class="towcontentitemone_towimage"
|
||||
src="https://ointmentweapp.oss-cn-beijing.aliyuncs.com/image/my/order/shijian.png"
|
||||
mode="">
|
||||
</image>待付款
|
||||
</view>
|
||||
</view>
|
||||
<view class="towcontentitemtow flex-start">
|
||||
<image class="towcontentitemtow_imge" src="@/static/logo.png" mode=""></image>
|
||||
<view class="towcontentitemtow_one flex-colum-start">
|
||||
<text class="towcontentitemtow_one_one">【人气】高级染烫+单人护理</text>
|
||||
<text class="towcontentitemtow_one_tow"><text
|
||||
style="font-size:28rpx;">¥</text>120.00</text>
|
||||
</view>
|
||||
<view class="towcontentitemtow_tow">
|
||||
x1
|
||||
</view>
|
||||
</view>
|
||||
<view class="towcontentitemthere">
|
||||
<view class="towcontentitemthereitem towcontentitemthereitem_tow"
|
||||
@click="overlayshow = true">
|
||||
取消订单
|
||||
</view>
|
||||
<view class="towcontentitemthereitem towcontentitemthereitem_there">
|
||||
待服务
|
||||
</view>
|
||||
<view class="towcontentitemthereitem towcontentitemthereitem_one">
|
||||
去付款
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<u-loadmore style="padding-bottom: 20rpx;"
|
||||
v-if="list_[index].is_end&&list_[index].data.length>0" :status="form.status" />
|
||||
<view v-if="list_[index].data.length<=0" class="flex-colum_image flex-colum">
|
||||
<image class=""
|
||||
src="https://ointmentweapp.oss-cn-beijing.aliyuncs.com/image/my/order/nothave.png"
|
||||
mode="">
|
||||
</image>
|
||||
<text>诶呀,暂无数据~</text>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
|
||||
</view>
|
||||
<u-overlay :show="overlayshow" @click="overlayshow = false">
|
||||
<view class="warp">
|
||||
<view class="rect flex-colum" @tap.stop>
|
||||
<view class="rectone">
|
||||
确定删除订单吗?
|
||||
</view>
|
||||
<view class="recttow flex-between">
|
||||
<view class="recttow_one">
|
||||
确定
|
||||
</view>
|
||||
<view class="recttow_tow" @click="overlayshow = false">
|
||||
取消
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</u-overlay>
|
||||
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
height: "",
|
||||
// 因为内部的滑动机制限制,请将tabs组件和swiper组件的current用不同变量赋值
|
||||
current: 0, // tabs组件的current值,表示当前活动的tab选项
|
||||
swiperCurrent: 0, // swiper组件的current值,表示当前那个swiper-item是活动的
|
||||
overlayshow: false,
|
||||
swipercurrentdata: [{
|
||||
name: '全部'
|
||||
}, {
|
||||
name: '待付款'
|
||||
}, {
|
||||
name: '待服务'
|
||||
}, {
|
||||
name: '已完成'
|
||||
}, {
|
||||
name: '退款/售后'
|
||||
}],
|
||||
form: {
|
||||
status: 'loadmore',
|
||||
},
|
||||
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
// this.swiperCurrent = option.type;
|
||||
},
|
||||
onShow() {
|
||||
this.init_fn();
|
||||
},
|
||||
mounted() {
|
||||
|
||||
var query = uni.createSelectorQuery().in(this).select('.onecontent')
|
||||
query.boundingClientRect(ele => {
|
||||
var that = this;
|
||||
uni.getSystemInfo({
|
||||
success(res) {
|
||||
console.log(res, ele)
|
||||
that.height = (res.windowHeight - ele.height) + "px";
|
||||
console.log(that.height)
|
||||
that = null;
|
||||
}
|
||||
})
|
||||
}).exec();
|
||||
},
|
||||
|
||||
methods: {
|
||||
init_fn() {
|
||||
this.list_ = {
|
||||
list1: { //全部
|
||||
data: [],
|
||||
page: 1,
|
||||
is_end: false,
|
||||
},
|
||||
list2: { //代付款
|
||||
data: [],
|
||||
page: 1,
|
||||
is_end: false,
|
||||
},
|
||||
list3: { //待发货
|
||||
data: [],
|
||||
page: 1,
|
||||
is_end: false,
|
||||
},
|
||||
list4: { //待收货
|
||||
data: [],
|
||||
page: 1,
|
||||
is_end: false,
|
||||
},
|
||||
list5: { //已完成
|
||||
data: [],
|
||||
page: 1,
|
||||
is_end: false,
|
||||
},
|
||||
}
|
||||
for (let i = 0; i <= 4; i++) {
|
||||
this.get_order_list(i);
|
||||
}
|
||||
},
|
||||
async get_order_list(order_status) {
|
||||
this.form.status = 'loading';
|
||||
let page = null; //页数
|
||||
switch (order_status) {
|
||||
case 0:
|
||||
order_status = "";
|
||||
page = this.list_.list1.page;
|
||||
break;
|
||||
case 1:
|
||||
order_status = 0;
|
||||
page = this.list_.list2.page;
|
||||
break;
|
||||
case 2:
|
||||
order_status = 1;
|
||||
page = this.list_.list3.page;
|
||||
break;
|
||||
case 3:
|
||||
order_status = 3;
|
||||
page = this.list_.list4.page;
|
||||
break;
|
||||
case 4:
|
||||
order_status = 5;
|
||||
page = this.list_.list5.page;
|
||||
break;
|
||||
}
|
||||
// let res = await uni.ajax.get_order_list({
|
||||
// order_status: order_status, //加载那个
|
||||
// page: page
|
||||
// })
|
||||
let res = []
|
||||
// res.data.forEach(item=>{//计算待支付订单剩余时间
|
||||
// if(item.order_status==0){
|
||||
// item.timeDiff=(new Date(item.estimate_close_at).getTime() -new Date().getTime())/1000;
|
||||
// }
|
||||
// })
|
||||
switch (order_status) {
|
||||
case "":
|
||||
this.paging(res, this.list_.list1)
|
||||
break;
|
||||
case 0:
|
||||
this.paging(res, this.list_.list2)
|
||||
break;
|
||||
case 1:
|
||||
this.paging(res, this.list_.list3)
|
||||
break;
|
||||
case 3:
|
||||
this.paging(res, this.list_.list4)
|
||||
break;
|
||||
case 5:
|
||||
this.paging(res, this.list_.list5)
|
||||
break;
|
||||
}
|
||||
uni.hideLoading();
|
||||
},
|
||||
paging(res, list) {
|
||||
list.data = list.data.concat(res.data);
|
||||
if (res.next_page_url == null) {
|
||||
list.is_end = true;
|
||||
this.form.status = 'nomore'
|
||||
} else {
|
||||
this.form.status = 'loading';
|
||||
list.page = list.page + 1;
|
||||
}
|
||||
},
|
||||
lower() {
|
||||
switch (this.current) {
|
||||
case 0:
|
||||
this.onReachBottom_fn(this.list_.list1)
|
||||
break;
|
||||
case 1:
|
||||
this.onReachBottom_fn(this.list_.list2)
|
||||
break;
|
||||
case 2:
|
||||
this.onReachBottom_fn(this.list_.list3)
|
||||
break;
|
||||
case 3:
|
||||
this.onReachBottom_fn(this.list_.list4)
|
||||
break;
|
||||
case 4:
|
||||
this.onReachBottom_fn(this.list_.list5)
|
||||
break;
|
||||
}
|
||||
},
|
||||
onReachBottom_fn(list) {
|
||||
if (!list.is_end) {
|
||||
this.get_order_list(this.current);
|
||||
}
|
||||
},
|
||||
// tabs通知swiper切换
|
||||
orderswitch(index) {
|
||||
this.swiperCurrent = index;
|
||||
},
|
||||
// swiper-item左右移动,通知tabs的滑块跟随移动
|
||||
transition(e) {
|
||||
let dx = e.detail.dx
|
||||
console.log(e, dx)
|
||||
this.$refs.uTabs.setDx(dx);
|
||||
},
|
||||
// 由于swiper的内部机制问题,快速切换swiper不会触发dx的连续变化,需要在结束时重置状态 swiper滑动结束,分别设置tabs和swiper的状态
|
||||
animationfinish(e) {
|
||||
let current = e.detail.current;
|
||||
this.swiperCurrent = current;
|
||||
this.current = current;
|
||||
},
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
background: #F6F6F6;
|
||||
}
|
||||
|
||||
.content {
|
||||
|
||||
.onecontent {
|
||||
width: 100%;
|
||||
background: #FFFFFF;
|
||||
padding: 10rpx 28rpx;
|
||||
|
||||
.onecontent_oen {
|
||||
margin: 0 auto;
|
||||
width: 100%;
|
||||
height: 70rpx;
|
||||
border-radius: 36rpx;
|
||||
border: 2rpx solid #333333;
|
||||
padding-right: 8rpx;
|
||||
|
||||
.onecontent_oen_input {
|
||||
padding-left: 32rpx;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.onecontent_oen_text {
|
||||
|
||||
font-size: 28rpx;
|
||||
font-family: PingFang SC-Regular, PingFang SC;
|
||||
font-weight: 400;
|
||||
color: #FFFFFF;
|
||||
text-align: center;
|
||||
line-height: 56rpx;
|
||||
width: 116rpx;
|
||||
height: 56rpx;
|
||||
background: #333333;
|
||||
border-radius: 36rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.onecontent_tow {
|
||||
padding: 32rpx 0 32rpx 0;
|
||||
width: 100%;
|
||||
|
||||
.onecontent_tow_item {
|
||||
position: relative;
|
||||
|
||||
.onecontent_tow_itemtexts {
|
||||
font-size: 32rpx;
|
||||
font-family: PingFang SC-Bold, PingFang SC;
|
||||
font-weight: bold;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.onecontent_tow_itemtext {
|
||||
font-size: 28rpx;
|
||||
font-family: PingFang SC-Regular, PingFang SC;
|
||||
font-weight: 400;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
.onecontent_tow_itemtexts::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
bottom: -10rpx;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
width: 19.33rpx;
|
||||
height: 6.66rpx;
|
||||
background: url(https://ointmentweapp.oss-cn-beijing.aliyuncs.com/image/my/order/order1.png) no-repeat;
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.towcontent {
|
||||
padding: 0 28rpx;
|
||||
|
||||
.flex-colum_image {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 100%;
|
||||
|
||||
text {
|
||||
margin-top: 30rpx;
|
||||
font-size: 32rpx;
|
||||
font-family: PingFang SC-Bold, PingFang SC;
|
||||
font-weight: bold;
|
||||
color: #666666;
|
||||
}
|
||||
}
|
||||
|
||||
.towcontentitem {
|
||||
margin-top: 32rpx;
|
||||
padding: 24rpx;
|
||||
width: 100%;
|
||||
background: #FFFFFF;
|
||||
border-radius: 12rpx;
|
||||
|
||||
.towcontentitemone {
|
||||
padding-bottom: 16rpx;
|
||||
border-bottom: 1px solid #F6F6F6;
|
||||
|
||||
.towcontentitemone_one {
|
||||
font-size: 28rpx;
|
||||
font-family: PingFang SC-Bold, PingFang SC;
|
||||
font-weight: bold;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.towcontentitemone_tow {
|
||||
font-size: 28rpx;
|
||||
font-family: PingFang SC-Regular, PingFang SC;
|
||||
font-weight: 400;
|
||||
color: #666666;
|
||||
|
||||
.towcontentitemone_towimage {
|
||||
margin-right: 10rpx;
|
||||
width: 24rpx;
|
||||
height: 24rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.towcontentitemtow {
|
||||
position: relative;
|
||||
padding: 22rpx 0;
|
||||
border-bottom: 1px solid #F6F6F6;
|
||||
|
||||
.towcontentitemtow_imge {
|
||||
width: 144rpx;
|
||||
height: 144rpx;
|
||||
background: #666666;
|
||||
border-radius: 12rpx;
|
||||
}
|
||||
|
||||
.towcontentitemtow_one {
|
||||
margin-left: 32rpx;
|
||||
|
||||
.towcontentitemtow_one_one {
|
||||
font-size: 28rpx;
|
||||
font-family: PingFang SC-Regular, PingFang SC;
|
||||
font-weight: 400;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.towcontentitemtow_one_tow {
|
||||
margin-top: 24rpx;
|
||||
font-size: 40rpx;
|
||||
font-family: Roboto-Bold, Roboto;
|
||||
font-weight: bold;
|
||||
color: #FC5F69;
|
||||
}
|
||||
}
|
||||
|
||||
.towcontentitemtow_tow {
|
||||
position: absolute;
|
||||
bottom: 32rpx;
|
||||
right: 0;
|
||||
font-size: 28rpx;
|
||||
font-family: Roboto-Regular, Roboto;
|
||||
font-weight: 400;
|
||||
color: #999999;
|
||||
}
|
||||
}
|
||||
|
||||
.towcontentitemthere {
|
||||
width: 100%;
|
||||
margin-top: 16rpx;
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
|
||||
.towcontentitemthereitem {
|
||||
margin-left: 24rpx;
|
||||
padding: 8rpx 32rpx;
|
||||
font-size: 28rpx;
|
||||
border-radius: 28rpx;
|
||||
}
|
||||
|
||||
.towcontentitemthereitem_one {
|
||||
background: linear-gradient(101deg, #FA8E5D 0%, #F45E4D 100%);
|
||||
font-family: PingFang SC-Bold, PingFang SC;
|
||||
font-weight: bold;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
.towcontentitemthereitem_tow {
|
||||
background: #F6F6F6;
|
||||
font-family: PingFang SC-Bold, PingFang SC;
|
||||
font-weight: bold;
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
.towcontentitemthereitem_there {
|
||||
background: linear-gradient(101deg, #8083A7 0%, #4D4E64 100%);
|
||||
font-family: PingFang SC-Bold, PingFang SC;
|
||||
font-weight: bold;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.warp {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 100%;
|
||||
|
||||
.rect {
|
||||
padding: 40rpx 68rpx;
|
||||
width: 480rpx;
|
||||
background: #FFFFFF;
|
||||
border-radius: 42rpx;
|
||||
|
||||
.rectone {
|
||||
font-size: 32rpx;
|
||||
font-family: Source Han Sans CN-Bold, Source Han Sans CN;
|
||||
font-weight: bold;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.recttow {
|
||||
width: 100%;
|
||||
margin-top: 32rpx;
|
||||
|
||||
.recttow_one {
|
||||
padding: 8rpx 40rpx;
|
||||
background: #FFFFFF;
|
||||
border-radius: 26rpx;
|
||||
border: 2rpx solid #999999;
|
||||
font-size: 28rpx;
|
||||
font-family: Source Han Sans CN-Regular, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.recttow_tow {
|
||||
padding: 8rpx 40rpx;
|
||||
background: #333333;
|
||||
font-size: 28rpx;
|
||||
font-family: Source Han Sans CN-Medium, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
color: #FFFFFF;
|
||||
border-radius: 26rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
</style>
|
||||
187
pages/my/setup/index.vue
Normal file
187
pages/my/setup/index.vue
Normal file
@@ -0,0 +1,187 @@
|
||||
<template>
|
||||
<view class="index">
|
||||
<view class="onecontent">
|
||||
个人信息
|
||||
</view>
|
||||
<view class="towcontent">
|
||||
<view class="towcontent_item flex-between">
|
||||
<view class="towcontent_item_text">
|
||||
头像
|
||||
</view>
|
||||
<view class="towcontent_item_box">
|
||||
<image class="towcontent_item_box_imge" src="@/static/logo.png" mode=""></image>
|
||||
</view>
|
||||
</view>
|
||||
<view class="towcontent_item flex-between">
|
||||
<view class="towcontent_item_text">
|
||||
UID
|
||||
</view>
|
||||
<view class="towcontent_item_box flex-start">
|
||||
<text class="towcontent_item_box_text">ID:1001468</text>
|
||||
<u-icon name="arrow-right" color="#909399" size="14"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
<view class="towcontent_item flex-between">
|
||||
<view class="towcontent_item_text">
|
||||
昵称
|
||||
</view>
|
||||
<view class="towcontent_item_box flex-start">
|
||||
<text class="towcontent_item_box_text">卡卡</text>
|
||||
<u-icon name="arrow-right" color="#909399" size="14"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
<view class="towcontent_item flex-between">
|
||||
<view class="towcontent_item_text">
|
||||
性别
|
||||
</view>
|
||||
<view class="towcontent_item_box flex-start">
|
||||
<u-radio-group v-model="radiovalue1" placement="row" @change="groupChange">
|
||||
<u-radio v-for="(item, index) in radiolist1" :key="index" :label="item.name" :name="item.name">
|
||||
</u-radio>
|
||||
</u-radio-group>
|
||||
</view>
|
||||
</view>
|
||||
<view class="towcontent_item flex-between" @click="datetimeshow = true">
|
||||
<view class="towcontent_item_text">
|
||||
生日
|
||||
</view>
|
||||
<view class="towcontent_item_box flex-start">
|
||||
<text class="towcontent_item_box_text">{{datetimevalue | timeFrom}}</text>
|
||||
<u-icon name="arrow-right" color="#909399" size="14"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
<navigator :url="'/pages/my/setup/phone'" class="towcontent_item flex-between">
|
||||
<view class="towcontent_item_text">
|
||||
手机号
|
||||
</view>
|
||||
<view class="towcontent_item_box flex-start">
|
||||
<text class="towcontent_item_box_text">去绑定</text>
|
||||
<u-icon name="arrow-right" color="#909399" size="14"></u-icon>
|
||||
</view>
|
||||
<!-- <view class="towcontent_item_box flex-start">
|
||||
<text class="towcontent_item_box_text">{{phone.replace(/(\d{3})\d{4}(\d{4})/, '$1****$2') }}</text>
|
||||
<view class="towcontent_item_box_ghbd">
|
||||
更换绑定
|
||||
</view>
|
||||
</view> -->
|
||||
</navigator>
|
||||
</view>
|
||||
<view class="thereconse">
|
||||
保存
|
||||
</view>
|
||||
<u-datetime-picker :minDate="-946800000000" :maxDate="2240409600000" :show="datetimeshow"
|
||||
v-model="datetimevalue" @cancel='datetimeshow = false' @confirm="confirmdatetime" mode="date"></u-datetime-picker>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
radiolist1: [{
|
||||
name: '男',
|
||||
disabled: false
|
||||
},
|
||||
{
|
||||
name: '女',
|
||||
disabled: false
|
||||
}
|
||||
],
|
||||
phone:'15309275801',
|
||||
datetimeshow: false,
|
||||
datetimevalue:'',
|
||||
// u-radio-group的v-model绑定的值如果设置为某个radio的name,就会被默认选中
|
||||
radiovalue1: '男',
|
||||
};
|
||||
},
|
||||
onLoad() {},
|
||||
computed: {},
|
||||
onShow() {
|
||||
|
||||
},
|
||||
methods: {
|
||||
confirmdatetime(e){
|
||||
this.datetimeshow = false
|
||||
this.datetimevalue = e.value
|
||||
},
|
||||
groupChange(n) {
|
||||
console.log('groupChange', n);
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
background: #F9F9F9;
|
||||
}
|
||||
|
||||
.index {
|
||||
padding: 28rpx;
|
||||
|
||||
.onecontent {
|
||||
font-size: 28rpx;
|
||||
font-family: PingFang SC-Medium, PingFang SC;
|
||||
font-weight: 500;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
.towcontent {
|
||||
padding: 0 32rpx;
|
||||
margin-top: 24rpx;
|
||||
width: 100%;
|
||||
background: #FFFFFF;
|
||||
border-radius: 12rpx;
|
||||
|
||||
.towcontent_item {
|
||||
padding: 22rpx;
|
||||
border-bottom: 1rpx dotted #ccc;
|
||||
|
||||
.towcontent_item_text {
|
||||
font-size: 28rpx;
|
||||
font-family: PingFang SC-Bold, PingFang SC;
|
||||
font-weight: bold;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.towcontent_item_box {
|
||||
.towcontent_item_box_imge {
|
||||
width: 64rpx;
|
||||
height: 64rpx;
|
||||
}
|
||||
|
||||
.towcontent_item_box_text {
|
||||
font-size: 24rpx;
|
||||
font-family: PingFang SC-Regular, PingFang SC;
|
||||
font-weight: 400;
|
||||
color: #999999;
|
||||
}
|
||||
.towcontent_item_box_ghbd{
|
||||
padding: 4rpx 8rpx;
|
||||
margin-left: 24rpx;
|
||||
font-size: 24rpx;
|
||||
font-family: PingFang SC-Regular, PingFang SC;
|
||||
font-weight: 400;
|
||||
color: #9397C1;
|
||||
border-radius: 10rpx;
|
||||
border: 2rpx solid #9397C1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.thereconse {
|
||||
width: 630rpx;
|
||||
height: 80rpx;
|
||||
background: #999999;
|
||||
border-radius: 40rpx;
|
||||
font-size: 36rpx;
|
||||
text-align: center;
|
||||
margin: 84rpx auto;
|
||||
font-family: PingFang SC-Bold, PingFang SC;
|
||||
font-weight: bold;
|
||||
color: #FFFFFF;
|
||||
line-height: 80rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
216
pages/my/setup/phone.vue
Normal file
216
pages/my/setup/phone.vue
Normal file
@@ -0,0 +1,216 @@
|
||||
<template>
|
||||
<view class="Box">
|
||||
<!-- <view class="Box_one">设置新手机</view>
|
||||
<view class="Box_T">设置新手机号需要通过短信验证</view>
|
||||
<view class="Box_there">当前手机号:{{ form.phone.replace(/(\d{3})\d{4}(\d{4})/, '$1****$2') }}</view> -->
|
||||
<view class="Box_consitem">
|
||||
<view class="Box_box flex-start">
|
||||
<text class="top_box_one_text">中国大陆+86</text>
|
||||
<input type="number" class="top_box_one_textinput" v-model="form.phone" style="font-size: 24rpx;" placeholder="请输入手机号" maxlength="11" data-key="mobile" />
|
||||
</view>
|
||||
<view class="Box_box flex-between"
|
||||
style="padding: 14rpx 0;border-top: 1rpx solid #efefef;border-bottom: 1rpx solid #efefef; margin-top: 0;">
|
||||
<text class="top_box_one_text" style="border-right:none;">验证码</text>
|
||||
<input type="number" style="font-size: 24rpx;" v-model="form.code" placeholder="请输入短信验证码"
|
||||
data-key="mobile" />
|
||||
<text class="top_box_one_texts">
|
||||
<view v-if="showText == true" class="yzm" @click="CodeRegister">{{ Recapture }}</view>
|
||||
<view v-else style="color: #ccc; background-color: #f9f9f9; border-radius:16px; padding: 10rpx;">
|
||||
{{ second }}s重新发送
|
||||
</view>
|
||||
</text>
|
||||
</view>
|
||||
<view class="flex-colum">
|
||||
<view class="Box_bottom" @click="userInfochangePhone">确定</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
form: {
|
||||
phone: '',
|
||||
code: '',
|
||||
oldPhone: '',
|
||||
password: ''
|
||||
},
|
||||
// 注册定时器 初始值
|
||||
second: 60,
|
||||
showText: true,
|
||||
Recapture: '发送验证码'
|
||||
};
|
||||
},
|
||||
onLoad() {},
|
||||
computed: {},
|
||||
methods: {
|
||||
async CodeRegister() {
|
||||
//发起验证码
|
||||
if (this.form.phone == null || this.form.phone == '') {
|
||||
uni.showToast({
|
||||
title: '请输入电话号码',
|
||||
icon: 'none'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
const res = await this.api.verifyPhoneIsExist({
|
||||
// post 手机验证码
|
||||
phone: this.form.phone
|
||||
});
|
||||
console.log(res);
|
||||
if (res.code == 200) {
|
||||
uni.showToast({
|
||||
title: '验证码获取成功',
|
||||
icon: 'none'
|
||||
});
|
||||
// 定时器
|
||||
this.showText = false;
|
||||
this.Recapture = '重新获取';
|
||||
var interval = setInterval(() => {
|
||||
let times = --this.second;
|
||||
this.second = times < 10 ? '0' + times : times; //小于10秒补 0
|
||||
}, 1000);
|
||||
setTimeout(() => {
|
||||
clearInterval(interval);
|
||||
this.second = 60;
|
||||
this.showText = true;
|
||||
}, 60000);
|
||||
}
|
||||
},
|
||||
async userInfochangePhone() {
|
||||
if (this.form.phone == null || this.form.phone == '') {
|
||||
uni.showToast({
|
||||
title: '请输入新电话号码',
|
||||
icon: 'none'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if (this.form.password == null || this.form.password == '') {
|
||||
uni.showToast({
|
||||
title: '请输入登录密码',
|
||||
icon: 'none'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if (this.form.code == null || this.form.code == '') {
|
||||
uni.showToast({
|
||||
title: '请输入验证码',
|
||||
icon: 'none'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
let res = await this.api.userInfochangePhone({
|
||||
code: this.form.code,
|
||||
password: this.form.password,
|
||||
oldPhone: this.$store.state.czguserInfo.phone,
|
||||
phone: this.form.phone
|
||||
});
|
||||
console.log(res)
|
||||
if (res.code == 200) {
|
||||
uni.showToast({
|
||||
title: '修改成功请重新登录',
|
||||
icon: 'none'
|
||||
});
|
||||
setTimeout(() => {
|
||||
uni.removeStorageSync("token");
|
||||
uni.removeStorageSync("userId");
|
||||
uni.removeStorageSync('myLoginName')
|
||||
uni.reLaunch({
|
||||
url: '../../../pages/login/login'
|
||||
});
|
||||
}, 2000);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
background: #F9F9F9;
|
||||
}
|
||||
|
||||
.Box {
|
||||
padding: 0 28rpx;
|
||||
|
||||
.Box_one {
|
||||
padding-top: 38rpx;
|
||||
font-size: 40rpx;
|
||||
font-family: Source Han Sans CN-Regular, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.Box_T {
|
||||
margin-top: 2rpx;
|
||||
font-size: 24rpx;
|
||||
font-family: Source Han Sans CN-Regular, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
.Box_there {
|
||||
margin-top: 70rpx;
|
||||
font-size: 24rpx;
|
||||
font-family: Source Han Sans CN-Regular, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.Box_consitem {
|
||||
background: #ffffff;
|
||||
padding: 32rpx;
|
||||
border-radius: 24rpx;
|
||||
margin-top: 22rpx;
|
||||
|
||||
.Box_box {
|
||||
padding: 18rpx 0;
|
||||
.top_box_one_text {
|
||||
width: auto;
|
||||
padding: 0 20rpx;
|
||||
font-size: 32rpx;
|
||||
font-family: PingFang SC-Regular, PingFang SC;
|
||||
font-weight: 400;
|
||||
color: #333333;
|
||||
border-right: 1rpx solid #ccc;
|
||||
}
|
||||
.top_box_one_textinput{
|
||||
margin-left: 20rpx;
|
||||
}
|
||||
input {
|
||||
width: auto;
|
||||
}
|
||||
|
||||
.top_box_one_texts {
|
||||
font-size: 28rpx;
|
||||
font-family: Source Han Sans CN-Regular, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
color: #5082fd;
|
||||
}
|
||||
}
|
||||
|
||||
.flex-colum {
|
||||
width: 100%;
|
||||
margin-top: 64rpx;
|
||||
|
||||
.Box_bottom {
|
||||
width: 558rpx;
|
||||
height: 72rpx;
|
||||
background: linear-gradient(115deg, #7E81A5 0%, #4D4E64 100%);
|
||||
border-radius: 50rpx;
|
||||
font-size: 36rpx;
|
||||
font-family: Source Han Sans CN-Regular, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
color: #ffffff;
|
||||
line-height: 72rpx;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
</style>
|
||||
907
pages/order/index.vue
Normal file
907
pages/order/index.vue
Normal file
@@ -0,0 +1,907 @@
|
||||
<template>
|
||||
<view class="content">
|
||||
<view class="onecontent">
|
||||
<view class="flex-start">
|
||||
<view class="onecontent_oen flex-start">
|
||||
<input class="onecontent_oen_input" type="text" v-model="like" placeholder="搜索订单/商家名/商品名">
|
||||
<text class="onecontent_oen_text" @click="init_fn">搜索</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="onecontent_tow flex-between">
|
||||
<view ref="uTabs" class="onecontent_tow_item flex-colum" v-for="(item,index) in swipercurrentdata"
|
||||
:key="index" @click="orderswitch(index)">
|
||||
<view :class="swiperCurrent == index?'onecontent_tow_itemtexts':'onecontent_tow_itemtext'">
|
||||
{{item.name}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="towcontent">
|
||||
<swiper :current="swiperCurrent" @animationfinish="animationfinish" :style="{height:height}">
|
||||
<swiper-item v-for="(item,index) in list_" :key="index">
|
||||
<scroll-view scroll-y style="width: 100%;" :style="{height:height}" @scrolltolower="lower">
|
||||
<view class="towcontentitem" v-for="(item1,index1) in list_[index].data" :key="index1"
|
||||
@click="eeInfo(item1)">
|
||||
<view class="towcontentitemone flex-between">
|
||||
<text class="towcontentitemone_one">{{item1.store_title}}</text>
|
||||
<view class="towcontentitemone_tow flex-start">
|
||||
<!-- <image class="towcontentitemone_towimage"
|
||||
:src="item.store_avatar"
|
||||
mode="">
|
||||
</image> -->
|
||||
<text v-if="item1.status == 0">未支付</text>
|
||||
<text v-if="item1.status == 1">已支付</text>
|
||||
<text v-if="item1.status == 2">等待确认</text>
|
||||
<text v-if="item1.status == 3">待服务</text>
|
||||
<text v-if="item1.status == 4">已完成 </text>
|
||||
<text v-if="item1.status == 5">已取消</text>
|
||||
<text v-if="item1.status == 6">退款中</text>
|
||||
<text v-if="item1.status == 7">已退款</text>
|
||||
<text v-if="item1.deletetime" style="color: red;">(用户已删除)</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="towcontentitemtow flex-start">
|
||||
<image class="towcontentitemtow_imge" :src="item1.store_avatar" mode=""></image>
|
||||
<view class="towcontentitemtow_one flex-colum-start">
|
||||
<text class="towcontentitemtow_one_one">{{item1.title}}</text>
|
||||
<text class="towcontentitemtow_one_tow"><text
|
||||
style="font-size:28rpx;">¥</text>{{item1.total_price}}</text>
|
||||
<text class="towcontentitemtow_one_there">{{item1.time}}</text>
|
||||
</view>
|
||||
<view class="towcontentitemtow_tow">
|
||||
{{item1.number}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="towcontentitemthere">
|
||||
<view v-if="item1.status == 2 || item1.status == 0"
|
||||
class="towcontentitemthereitem towcontentitemthereitem_there"
|
||||
@click.stop="orderokprebook(item1)">
|
||||
确认预约
|
||||
</view>
|
||||
<view v-if="item1.status == 2 || item1.status == 0"
|
||||
class="towcontentitemthereitem towcontentitemthereitem_tow"
|
||||
@click.stop="orderrefuseprebook(item1)">
|
||||
拒绝预约
|
||||
</view>
|
||||
<view v-if="item1.status == 3"
|
||||
class="towcontentitemthereitem towcontentitemthereitem_tow"
|
||||
@click.stop="orderordercancel(item1)">
|
||||
取消订单/并退款
|
||||
</view>
|
||||
<view class="towcontentitemthereitem towcontentitemthereitem_there"
|
||||
v-if="item1.status == 3" @click.stop="orderorderdelete(item1)">
|
||||
完成服务
|
||||
</view>
|
||||
</view>
|
||||
<u-overlay :show="overlayshow" @click.stop="overlayshow = false" opacity='0.1'>
|
||||
<view class="warp">
|
||||
<view class="rect flex-colum" @tap.stop>
|
||||
<view class="rectone">
|
||||
确定{{clickoverlayshowtext}}吗?
|
||||
</view>
|
||||
<view class="recttow flex-between">
|
||||
<view class="recttow_one" @click="cancelOrder(item.status)">
|
||||
确定
|
||||
</view>
|
||||
<view class="recttow_tow" @click="overlayshow = false">
|
||||
取消
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</u-overlay>
|
||||
</view>
|
||||
<view v-if="list_[index].data.length == 0 && list_[index].is_end == true" class="flex-colum">
|
||||
<image class="" style="margin-top: 100rpx;"
|
||||
src="https://ointmentweapp.oss-cn-beijing.aliyuncs.com/image/my/order/nothave.png"
|
||||
mode="">
|
||||
</image>
|
||||
</view>
|
||||
<u-loadmore :status="list_[index].status" />
|
||||
|
||||
</scroll-view>
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
|
||||
</view>
|
||||
<xc-privacyPopup ref="privacyComponent" position="center" @allowPrivacy="allowPrivacy"></xc-privacyPopup>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
height: "",
|
||||
// 因为内部的滑动机制限制,请将tabs组件和swiper组件的current用不同变量赋值
|
||||
current: 0, // tabs组件的current值,表示当前活动的tab选项
|
||||
swiperCurrent: 0, // swiper组件的current值,表示当前那个swiper-item是活动的
|
||||
overlayshow: false,
|
||||
list_: {
|
||||
list0: { //待服务
|
||||
data: [],
|
||||
page: 1,
|
||||
status: 'loadmore',
|
||||
is_end: false,
|
||||
},
|
||||
list1: { //全部
|
||||
data: [],
|
||||
page: 1,
|
||||
status: 'loadmore',
|
||||
is_end: false,
|
||||
},
|
||||
list2: { //代付款
|
||||
data: [],
|
||||
page: 1,
|
||||
status: 'loadmore',
|
||||
is_end: false,
|
||||
},
|
||||
list3: { //待服务
|
||||
data: [],
|
||||
page: 1,
|
||||
status: 'loadmore',
|
||||
is_end: false,
|
||||
}
|
||||
},
|
||||
like: '', //备注
|
||||
clickoverlayshowtext: "",
|
||||
swipercurrentdata: [{
|
||||
name: '待确认'
|
||||
}, {
|
||||
name: '待服务'
|
||||
}, {
|
||||
name: '已完成'
|
||||
}, {
|
||||
name: '退款/售后'
|
||||
}],
|
||||
form: {
|
||||
status: 'loadmore',
|
||||
},
|
||||
|
||||
}
|
||||
},
|
||||
async onLoad(e) {
|
||||
uni.hideTabBar()
|
||||
if (e.type) {
|
||||
// #ifdef MP-WEIXIN
|
||||
uni.login({
|
||||
provider: 'weixin',
|
||||
success: async (data) => {
|
||||
let res = await this.api.userautollogin({
|
||||
code: data.code,
|
||||
type: e.type,
|
||||
syb_m_id: e.syb_m_id,
|
||||
mobile: e.mobile,
|
||||
sign: uni.utils.md5('wgpdZW1YEqNlUuvJfrB2nkjRVOHIeC' + e.type + e
|
||||
.syb_m_id + e.mobile)
|
||||
})
|
||||
try {
|
||||
if (res.code == 1) {
|
||||
uni.cache.set('user', res.data.userinfo);
|
||||
uni.cache.set("token", res.data.userinfo.token);
|
||||
if (uni.cache.get('user').group_id == 2) {
|
||||
uni.pro.switchTab('order/index')
|
||||
uni.setNavigationBarTitle({
|
||||
title: uni.cache.get('user').nickname
|
||||
})
|
||||
this.init_fn();
|
||||
} else {
|
||||
setTimeout(res => {
|
||||
uni.reLaunch({
|
||||
url: '/pages/stafflist/index'
|
||||
})
|
||||
}, 1500)
|
||||
|
||||
}
|
||||
} else {
|
||||
setTimeout(res => {
|
||||
uni.reLaunch({
|
||||
url: '/pages/stafflist/index'
|
||||
})
|
||||
}, 1500)
|
||||
}
|
||||
} catch (e) {
|
||||
setTimeout(res => {
|
||||
uni.reLaunch({
|
||||
url: '/pages/stafflist/index'
|
||||
})
|
||||
}, 1500)
|
||||
}
|
||||
}
|
||||
});
|
||||
// #endif
|
||||
} else {
|
||||
if (uni.cache.get('user').group_id == 2) {
|
||||
uni.pro.switchTab('order/index')
|
||||
this.init_fn();
|
||||
} else {
|
||||
setTimeout(res => {
|
||||
uni.reLaunch({
|
||||
url: '/pages/stafflist/index'
|
||||
})
|
||||
}, 1500)
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
onShow() {
|
||||
// #ifdef H5
|
||||
uni.showTabBar()
|
||||
// #endif
|
||||
// #ifdef MP-WEIXIN
|
||||
wx.getPrivacySetting({
|
||||
success: res => {
|
||||
if (!res.needAuthorization) {
|
||||
this.$refs.privacyComponent.closePrivacy();
|
||||
uni.showTabBar()
|
||||
}
|
||||
},
|
||||
fail: () => {},
|
||||
complete: () => {}
|
||||
})
|
||||
// #endif
|
||||
if (uni.cache.get('token')) {
|
||||
uni.setNavigationBarTitle({
|
||||
title: uni.cache.get('user').nickname
|
||||
})
|
||||
this.init_fn();
|
||||
// uni.setTabBarItem({
|
||||
// index: 1,
|
||||
// visible: false
|
||||
// });
|
||||
// uni.setTabBarItem({
|
||||
// index:0,
|
||||
// visible: true
|
||||
// });
|
||||
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
var query = uni.createSelectorQuery().in(this).select('.onecontent')
|
||||
query.boundingClientRect(ele => {
|
||||
var that = this;
|
||||
uni.getSystemInfo({
|
||||
success(res) {
|
||||
that.height = (res.windowHeight - ele.height) + "px";
|
||||
that = null;
|
||||
}
|
||||
})
|
||||
}).exec();
|
||||
},
|
||||
methods: {
|
||||
showpickersetTabBar(){
|
||||
uni.switchTab({
|
||||
url:'/pages/mall/index'
|
||||
})
|
||||
},
|
||||
allowPrivacy() {
|
||||
// 同意隐私协议触发事件,有些接口需要同意授权后才能执行,比如获取手机号授权接口,可以在同意隐私协议后,再执行授权获取手机号接口,如果不需要可以不添加该方法
|
||||
uni.showTabBar()
|
||||
console.log('同意隐私授权')
|
||||
},
|
||||
init_fn() {
|
||||
this.list_ = {
|
||||
list0: { //全部
|
||||
data: [],
|
||||
page: 1,
|
||||
status: 'loading',
|
||||
is_end: false,
|
||||
},
|
||||
list1: { //全部
|
||||
data: [],
|
||||
page: 1,
|
||||
status: 'loading',
|
||||
is_end: false,
|
||||
},
|
||||
list2: { //代付款
|
||||
data: [],
|
||||
page: 1,
|
||||
status: 'loading',
|
||||
is_end: false,
|
||||
},
|
||||
list3: { //待服务
|
||||
data: [],
|
||||
page: 1,
|
||||
status: 'loadmore',
|
||||
is_end: false,
|
||||
}
|
||||
}
|
||||
for (let i = 0; i <= 3; i++) {
|
||||
this.get_order_list(i);
|
||||
}
|
||||
},
|
||||
async get_order_list(i) {
|
||||
let page = null; //页数
|
||||
let order_type = ''
|
||||
switch (i) {
|
||||
case 0:
|
||||
order_type = 2;
|
||||
page = this.list_.list0.page;
|
||||
break;
|
||||
case 1:
|
||||
order_type = 3;
|
||||
page = this.list_.list1.page;
|
||||
break;
|
||||
case 2:
|
||||
order_type = 4;
|
||||
page = this.list_.list2.page;
|
||||
break;
|
||||
case 3:
|
||||
order_type = 5;
|
||||
page = this.list_.list3.page;
|
||||
break;
|
||||
}
|
||||
let resdata = await this.api.orderlist({
|
||||
order_type: order_type,
|
||||
page: page,
|
||||
like: this.like
|
||||
})
|
||||
let res = resdata.data
|
||||
// res.data.forEach(item=>{//计算待支付订单剩余时间
|
||||
// if(item.order_type==0){
|
||||
// item.timeDiff=(new Date(item.estimate_close_at).getTime() -new Date().getTime())/1000;
|
||||
// }
|
||||
// })
|
||||
switch (order_type) {
|
||||
case 2:
|
||||
this.paging(res, this.list_.list0)
|
||||
break;
|
||||
case 3:
|
||||
this.paging(res, this.list_.list1)
|
||||
break;
|
||||
case 4:
|
||||
this.paging(res, this.list_.list2)
|
||||
break;
|
||||
case 5:
|
||||
this.paging(res, this.list_.list3)
|
||||
break;
|
||||
}
|
||||
uni.hideLoading();
|
||||
},
|
||||
paging(res, list) {
|
||||
if (res.length == 0) {
|
||||
list.status = 'nomore';
|
||||
list.is_end = true;
|
||||
return false;
|
||||
} else {
|
||||
list.status = 'loading';
|
||||
list.page = list.page + 1;
|
||||
setTimeout(() => {
|
||||
list.data = [...list.data, ...res];
|
||||
if (res.length != 10) {
|
||||
list.is_end = true;
|
||||
list.status = 'nomore';
|
||||
|
||||
} else {
|
||||
list.status = 'loading';
|
||||
}
|
||||
}, 500)
|
||||
}
|
||||
this.$forceUpdate();
|
||||
},
|
||||
lower() {
|
||||
switch (this.current) {
|
||||
case 0:
|
||||
this.onReachBottom_fn(this.list_.list0)
|
||||
break;
|
||||
case 1:
|
||||
this.onReachBottom_fn(this.list_.list1)
|
||||
break;
|
||||
case 2:
|
||||
this.onReachBottom_fn(this.list_.list2)
|
||||
break;
|
||||
case 3:
|
||||
this.onReachBottom_fn(this.list_.list3)
|
||||
break;
|
||||
}
|
||||
},
|
||||
onReachBottom_fn(list) {
|
||||
if (!list.is_end) {
|
||||
this.get_order_list(this.current);
|
||||
}
|
||||
},
|
||||
// tabs通知swiper切换
|
||||
orderswitch(index) {
|
||||
try {
|
||||
switch (index) {
|
||||
case 0:
|
||||
if (this.list_list0.data.length < 10) {
|
||||
this.form.status = 'nomore';
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if (this.list_list1.data.length < 10) {
|
||||
this.form.status = 'nomore';
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if (this.list_.list2.data.length < 10) {
|
||||
this.form.status = 'nomore';
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
if (this.list_.list3.data.length < 10) {
|
||||
this.form.status = 'nomore';
|
||||
}
|
||||
break;
|
||||
}
|
||||
} catch (e) {
|
||||
//TODO handle the exception
|
||||
}
|
||||
this.swiperCurrent = index;
|
||||
},
|
||||
// 由于swiper的内部机制问题,快速切换swiper不会触发dx的连续变化,需要在结束时重置状态 swiper滑动结束,分别设置tabs和swiper的状态
|
||||
animationfinish(e) {
|
||||
let current = e.detail.current;
|
||||
try {
|
||||
switch (current) {
|
||||
case 0:
|
||||
if (this.list_list0.data.length < 10) {
|
||||
this.form.status = 'nomore';
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if (this.list_list1.data.length < 10) {
|
||||
this.form.status = 'nomore';
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if (this.list_.list2.data.length < 10) {
|
||||
this.form.status = 'nomore';
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
if (this.list_.list3.data.length < 10) {
|
||||
this.form.status = 'nomore';
|
||||
}
|
||||
break;
|
||||
}
|
||||
} catch (e) {
|
||||
//TODO handle the exception
|
||||
}
|
||||
this.swiperCurrent = current;
|
||||
this.current = current;
|
||||
},
|
||||
// clickoverlayshow(e) { //切换文字
|
||||
// switch (e) {
|
||||
// case 1:
|
||||
// this.clickoverlayshowtext = '取消订单'
|
||||
// break;
|
||||
// case 2:
|
||||
// this.clickoverlayshowtext = '删除订单'
|
||||
// break;
|
||||
// }
|
||||
// this.overlayshow = true
|
||||
// },
|
||||
orderordercancel(item) { //取消订单
|
||||
var this_ = this
|
||||
uni.showModal({
|
||||
content: '确定取消订单吗?',
|
||||
confirmColor: '#f55850',
|
||||
cancelColor: '#333333',
|
||||
async success(resdata) {
|
||||
if (resdata.confirm) {
|
||||
let res = await this_.api.orderorderrefund({
|
||||
order_id: item.order_id
|
||||
})
|
||||
if (res.code == 1) {
|
||||
this_.init_fn()
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
async orderokprebook(item) {
|
||||
let res = await this.api.orderokprebook({
|
||||
order_id: item.order_id
|
||||
})
|
||||
if (res.code == 1) {
|
||||
uni.showToast({
|
||||
title: '确认成功',
|
||||
icon: 'none'
|
||||
});
|
||||
setTimeout(() => {
|
||||
this.init_fn()
|
||||
}, 2000);
|
||||
}
|
||||
},
|
||||
async orderrefuseprebook(e) {
|
||||
let res = await this.api.orderrefuseprebook({
|
||||
order_id: e.order_id,
|
||||
refuse_str: ''
|
||||
})
|
||||
if (res.code == 1) {
|
||||
uni.showToast({
|
||||
title: '拒绝成功',
|
||||
icon: 'none'
|
||||
});
|
||||
setTimeout(() => {
|
||||
this.init_fn()
|
||||
}, 2000);
|
||||
}
|
||||
},
|
||||
orderordercancelrefund(item) { //取消订单去退款
|
||||
uni.pro.navigateTo('my/order/refund', {
|
||||
id: item.order_id
|
||||
})
|
||||
},
|
||||
applylrefund(item) {
|
||||
uni.pro.navigateTo('my/order/applylrefund', {
|
||||
id: item.order_id
|
||||
})
|
||||
},
|
||||
orderorderdelete(item) {
|
||||
var this_ = this
|
||||
if (item.pay_status == 0) {
|
||||
uni.showModal({
|
||||
content: '该笔订单还未付款,是否继续?',
|
||||
confirmColor: '#f55850',
|
||||
cancelColor: '#333333',
|
||||
async success(resdata) {
|
||||
if (resdata.confirm) {
|
||||
let res = await this_.api.orderstartsercive({
|
||||
order_id: item.order_id
|
||||
})
|
||||
if (res.code == 1) {
|
||||
this_.init_fn()
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
} else {
|
||||
uni.showModal({
|
||||
content: '确定开始服务吗?',
|
||||
confirmColor: '#f55850',
|
||||
cancelColor: '#333333',
|
||||
async success(resdata) {
|
||||
if (resdata.confirm) {
|
||||
let res = await this_.api.orderstartsercive({
|
||||
order_id: item.order_id
|
||||
})
|
||||
if (res.code == 1) {
|
||||
this_.init_fn()
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
},
|
||||
async cancelOrder(item) { //取消订单
|
||||
console.log(item)
|
||||
// let res
|
||||
// switch (this.clickoverlayshowtext) {
|
||||
// case '取消订单':
|
||||
// if (item.status == 0) {
|
||||
// res = await this.api.orderordercancel({
|
||||
// order_id: item.order_id
|
||||
// })
|
||||
// } else {
|
||||
// uni.pro.navigateTo('my/order/orderInfo', {
|
||||
// id: e,
|
||||
// e: e
|
||||
// })
|
||||
// }
|
||||
// break;
|
||||
// case '删除订单':
|
||||
// res = await this.api.orderorderdelete({
|
||||
// order_id: item.order_id
|
||||
// })
|
||||
// break;
|
||||
// }
|
||||
// this.overlayshow = false
|
||||
// this.init_fn()
|
||||
},
|
||||
eeInfo(e) { //查看订单详情
|
||||
uni.pro.navigateTo('order/orderInfo', {
|
||||
id: e.order_id
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
background: #F9F9F9;
|
||||
}
|
||||
|
||||
.content {
|
||||
|
||||
.onecontent {
|
||||
width: 100%;
|
||||
background: #FFFFFF;
|
||||
padding: 10rpx 28rpx;
|
||||
|
||||
.flex-start {
|
||||
flex-wrap: nowrap;
|
||||
|
||||
.onecontent_oen {
|
||||
margin: 0 auto;
|
||||
flex: auto;
|
||||
height: 70rpx;
|
||||
border-radius: 14rpx;
|
||||
border: 2rpx solid #6699FF;
|
||||
padding-right: 8rpx;
|
||||
|
||||
.onecontent_oen_input {
|
||||
padding-left: 32rpx;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.onecontent_oen_text {
|
||||
font-size: 28rpx;
|
||||
font-family: PingFang SC-Regular, PingFang SC;
|
||||
font-weight: 400;
|
||||
color: #FFFFFF;
|
||||
text-align: center;
|
||||
line-height: 56rpx;
|
||||
width: 80rpx;
|
||||
height: 56rpx;
|
||||
background: #6699FF;
|
||||
border-radius: 14rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.onecontent_oen_right {
|
||||
margin-left: 26rpx;
|
||||
|
||||
.onecontent_oen_rightimage {
|
||||
width: 17.9rpx;
|
||||
height: 19.34rpx;
|
||||
}
|
||||
|
||||
.onecontent_oen_rightimageview {
|
||||
text-align: center;
|
||||
width: 140rpx;
|
||||
margin-left: 10rpx;
|
||||
font-size: 28rpx;
|
||||
font-family: PingFang SC-Regular, PingFang SC;
|
||||
font-weight: 400;
|
||||
color: #333333;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.onecontent_tow {
|
||||
padding: 32rpx 0 32rpx 0;
|
||||
width: 100%;
|
||||
|
||||
.onecontent_tow_item {
|
||||
position: relative;
|
||||
|
||||
.onecontent_tow_itemtexts {
|
||||
font-size: 32rpx;
|
||||
font-family: PingFang SC-Bold, PingFang SC;
|
||||
font-weight: bold;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.onecontent_tow_itemtext {
|
||||
font-size: 28rpx;
|
||||
font-family: PingFang SC-Regular, PingFang SC;
|
||||
font-weight: 400;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
.onecontent_tow_itemtexts::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
bottom: -10rpx;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
width: 19.33rpx;
|
||||
height: 6.66rpx;
|
||||
background: url(https://ointmentweapp.oss-cn-beijing.aliyuncs.com/image/my/order/order1.png) no-repeat;
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.towcontent {
|
||||
padding: 0 28rpx;
|
||||
|
||||
.flex-colum_image {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 100%;
|
||||
|
||||
text {
|
||||
margin-top: 30rpx;
|
||||
font-size: 32rpx;
|
||||
font-family: PingFang SC-Bold, PingFang SC;
|
||||
font-weight: bold;
|
||||
color: #666666;
|
||||
}
|
||||
}
|
||||
|
||||
.towcontentitem {
|
||||
margin-top: 32rpx;
|
||||
padding: 24rpx;
|
||||
width: 100%;
|
||||
background: #FFFFFF;
|
||||
border-radius: 12rpx;
|
||||
|
||||
.towcontentitemone {
|
||||
width: 100%;
|
||||
padding-bottom: 16rpx;
|
||||
border-bottom: 1px solid #F6F6F6;
|
||||
|
||||
.towcontentitemone_one {
|
||||
font-size: 28rpx;
|
||||
width: 60%;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
font-family: PingFang SC-Bold, PingFang SC;
|
||||
font-weight: bold;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.towcontentitemone_tow {
|
||||
font-size: 28rpx;
|
||||
font-family: PingFang SC-Regular, PingFang SC;
|
||||
font-weight: 400;
|
||||
color: #666666;
|
||||
|
||||
.towcontentitemone_towimage {
|
||||
margin-right: 10rpx;
|
||||
width: 24rpx;
|
||||
height: 24rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.towcontentitemtow {
|
||||
position: relative;
|
||||
padding: 22rpx 0;
|
||||
border-bottom: 1px solid #F6F6F6;
|
||||
|
||||
.towcontentitemtow_imge {
|
||||
width: 144rpx;
|
||||
height: 144rpx;
|
||||
background: #666666;
|
||||
border-radius: 12rpx;
|
||||
}
|
||||
|
||||
.towcontentitemtow_one {
|
||||
margin-left: 32rpx;
|
||||
width: 70%;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
position: relative;
|
||||
|
||||
.towcontentitemtow_one_one {
|
||||
width: 50%;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
font-size: 28rpx;
|
||||
font-family: PingFang SC-Regular, PingFang SC;
|
||||
font-weight: 400;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.towcontentitemtow_one_there {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
font-size: 20rpx;
|
||||
font-family: Roboto-Bold, Roboto;
|
||||
font-weight: 500;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.towcontentitemtow_one_tow {
|
||||
margin-top: 24rpx;
|
||||
font-size: 40rpx;
|
||||
font-family: Roboto-Bold, Roboto;
|
||||
font-weight: bold;
|
||||
color: #FC5F69;
|
||||
}
|
||||
}
|
||||
|
||||
.towcontentitemtow_tow {
|
||||
position: absolute;
|
||||
bottom: 32rpx;
|
||||
right: 0;
|
||||
font-size: 28rpx;
|
||||
font-family: Roboto-Regular, Roboto;
|
||||
font-weight: 400;
|
||||
color: #999999;
|
||||
}
|
||||
}
|
||||
|
||||
.towcontentitemthere {
|
||||
width: 100%;
|
||||
margin-top: 16rpx;
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
|
||||
.towcontentitemthereitem {
|
||||
margin-left: 24rpx;
|
||||
padding: 8rpx 32rpx;
|
||||
font-size: 28rpx;
|
||||
border-radius: 28rpx;
|
||||
}
|
||||
|
||||
.towcontentitemthereitem_one {
|
||||
background: linear-gradient(101deg, #FA8E5D 0%, #F45E4D 100%);
|
||||
font-family: PingFang SC-Bold, PingFang SC;
|
||||
font-weight: bold;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
.towcontentitemthereitem_tow {
|
||||
background: #F6F6F6;
|
||||
font-family: PingFang SC-Bold, PingFang SC;
|
||||
font-weight: bold;
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
.towcontentitemthereitem_there {
|
||||
background: linear-gradient(303deg, #9FC9FF 0%, #6699FF 100%);
|
||||
font-family: SourceHanSansCN-Regular, SourceHanSansCN;
|
||||
font-weight: 400;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.warp {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 100%;
|
||||
|
||||
.rect {
|
||||
padding: 40rpx 68rpx;
|
||||
width: 480rpx;
|
||||
background: #FFFFFF;
|
||||
border-radius: 42rpx;
|
||||
|
||||
.rectone {
|
||||
font-size: 32rpx;
|
||||
font-family: Source Han Sans CN-Bold, Source Han Sans CN;
|
||||
font-weight: bold;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.recttow {
|
||||
width: 100%;
|
||||
margin-top: 32rpx;
|
||||
|
||||
.recttow_one {
|
||||
padding: 8rpx 40rpx;
|
||||
background: #FFFFFF;
|
||||
border-radius: 26rpx;
|
||||
border: 2rpx solid #999999;
|
||||
font-size: 28rpx;
|
||||
font-family: Source Han Sans CN-Regular, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.recttow_tow {
|
||||
padding: 8rpx 40rpx;
|
||||
background: #333333;
|
||||
font-size: 28rpx;
|
||||
font-family: Source Han Sans CN-Medium, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
color: #FFFFFF;
|
||||
border-radius: 26rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
</style>
|
||||
610
pages/order/orderInfo.vue
Normal file
610
pages/order/orderInfo.vue
Normal file
@@ -0,0 +1,610 @@
|
||||
<template>
|
||||
<view class="index">
|
||||
<!-- <view class="onecontent">
|
||||
<view class="onecontentone">
|
||||
<text v-if="datalist.status == 0">待支付</text>
|
||||
<text v-if="datalist.status == 1">已支付</text>
|
||||
<text v-if="datalist.status == 2">等待确认</text>
|
||||
<text v-if="datalist.status == 3">已确认</text>
|
||||
<text v-if="datalist.status == 4">已完成 </text>
|
||||
<text v-if="datalist.status == 5">已取消</text>
|
||||
<text v-if="datalist.status == 6">退款中</text>
|
||||
<text v-if="datalist.status == 7">已退款</text>
|
||||
</view>
|
||||
<view class="onecontenttow">
|
||||
感谢您的支持,欢迎再次光临
|
||||
</view>
|
||||
<view class="onecontentthere flex-between">
|
||||
<view class="onecontentthere_one" v-if="datalist.status == 5 || datalist.status == 4 "
|
||||
@click="orderorderdelete(datalist)">
|
||||
删除订单
|
||||
</view>
|
||||
<view class="onecontentthere_tow"
|
||||
v-if="datalist.status == 1 || datalist.status == 2 ||datalist.status == 3"
|
||||
@click="orderordercancelrefund(datalist)">
|
||||
申请退款
|
||||
</view>
|
||||
</view>
|
||||
</view> -->
|
||||
<view class="towcontent">
|
||||
<view class="towcontentone flex-between">
|
||||
<view class="towcontentone_one flex-start">
|
||||
<u-icon name="home" color="#ffffff" size="20"></u-icon>
|
||||
<text class="towcontentone_one_text">{{datalist.store_title}}</text>
|
||||
</view>
|
||||
<u-icon @click="phonefill(datalist.store_mobile)" name="phone-fill" color="#ffffff" size="20"></u-icon>
|
||||
</view>
|
||||
<view class="towcontenttow flex-start" @click="detailsInfo(datalist.store_service_id)">
|
||||
<image class="towcontenttow_image" :src="datalist.store_avatar" mode=""></image>
|
||||
<view class="towcontenttowone flex-colum-start">
|
||||
<view class="towcontenttowone_one">
|
||||
{{datalist.title}}
|
||||
</view>
|
||||
<view class="towcontenttowone_tow flex-start">
|
||||
<view class="towcontenttowone_tow_one flex-start">
|
||||
<u-icon name="checkmark-circle" color="#999999" size="14"></u-icon>
|
||||
随时退
|
||||
</view>
|
||||
<view class="towcontenttowone_tow_one flex-start">
|
||||
<u-icon name="checkmark-circle" color="#999999" size="14"></u-icon>
|
||||
过期退
|
||||
</view>
|
||||
</view>
|
||||
<view class="towcontenttowone_there">
|
||||
¥{{datalist.total_price}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!--<view class="towcontentthere flex-between">
|
||||
<text class="towcontentthere_text"></text>
|
||||
</view>
|
||||
<view class="qr-box flex-colum" @longpress="save()">
|
||||
<canvas canvas-id="qrcode" style="width:288rpx;" />
|
||||
</view>
|
||||
<view class="towcontenttfour flex-colum">
|
||||
123 2345 567
|
||||
</view> -->
|
||||
<!-- <view class="towcontenttfive flex-between">
|
||||
<view class="towcontenttfive_one flex-start">
|
||||
<view class="towcontenttfive_oneone">
|
||||
退款:
|
||||
</view>
|
||||
<view class="towcontenttfive_onetow">
|
||||
08-22 23:59:59到期
|
||||
</view>
|
||||
</view>
|
||||
<view class="towcontenttfive_tow">
|
||||
申请退款
|
||||
</view>
|
||||
</view> -->
|
||||
</view>
|
||||
<view class="therecontent">
|
||||
<view class="therecontentone">
|
||||
订单信息
|
||||
</view>
|
||||
<view class="therecontentow entowakst">
|
||||
服务人员:<text>{{datalist.people ||'无'}}</text>
|
||||
</view>
|
||||
<view class="therecontentow entowakst">
|
||||
预约时间:<text>{{datalist.time ||'无'}}</text>
|
||||
</view>
|
||||
<view class="therecontentow entowakst">
|
||||
实付金额:<text>{{datalist.money}}</text>
|
||||
</view>
|
||||
<view class="therecontentthere entowakst">
|
||||
购买数量:{{datalist.number}}
|
||||
</view>
|
||||
<view class="therecontenfour entowakst">
|
||||
手机号码:{{datalist.mobile.replace(/(\d{3})\d{4}(\d{4})/,'$1****$2') || '-'}}
|
||||
</view>
|
||||
<view class="therecontentfive flex-start entowakst">
|
||||
订单编号:{{datalist.out_trade_no}}
|
||||
<text class="therecontentfive_box" @click="copy(datalist.out_trade_no)">复制</text>
|
||||
</view>
|
||||
<view class="therecontentsix entowakst">
|
||||
下单时间:{{datalist.createtime}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="fourcontent">
|
||||
<view class="fourcontentone">
|
||||
购买须知
|
||||
</view>
|
||||
<view v-html="datalist.details">
|
||||
|
||||
</view>
|
||||
<!-- <view class="entowakst" v-html="datalist.details">
|
||||
·预约须知:请您提前1小时预约
|
||||
</view> -->
|
||||
</view>
|
||||
<!-- <view class="fivecontent">
|
||||
<view class="fivecontentone">
|
||||
用户评价
|
||||
</view>
|
||||
<view class="fivecontenttow flex-between">
|
||||
<view class="fivecontenttow_one flex-start">
|
||||
<text class="fivecontenttow_text">综合评分</text>
|
||||
<u-rate :count="5" value="4" active-color="#f1cb66" inactive-color="#F1CB66"></u-rate>
|
||||
</view>
|
||||
<view class="fivecontenttow_tow">
|
||||
满意
|
||||
</view>
|
||||
</view>
|
||||
</view> -->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// import uQRCode from '@/common/js/uqrCode.js'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
datalist: {},
|
||||
imgCode: '', // 后续保存到手机相册所需要用到的字段}
|
||||
form: {
|
||||
phone: '18092171236'
|
||||
}
|
||||
}
|
||||
},
|
||||
async onLoad(e) {
|
||||
try {
|
||||
let res = await this.api.orderorderdetail({
|
||||
order_id: e.id
|
||||
})
|
||||
if (res) {
|
||||
this.datalist = res.data
|
||||
this.datalist.details = res.data.details.replace(/\<img/g,
|
||||
'<img style="max-width:100%;height:auto" ');
|
||||
}
|
||||
} catch (e) {}
|
||||
// this.generate()
|
||||
},
|
||||
methods: {
|
||||
orderorderdelete(item) { //删除订单
|
||||
uni.showModal({
|
||||
content: '确定删除订单吗?',
|
||||
confirmColor: '#f55850',
|
||||
cancelColor: '#333333',
|
||||
async success(resdata) {
|
||||
if (resdata.confirm) {
|
||||
await this.api.orderorderdelete({
|
||||
order_id: item.order_id
|
||||
})
|
||||
uni.navigateBack()
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
orderordercancelrefund(item) { //取消订单去退款
|
||||
console.log(item)
|
||||
uni.pro.navigateTo('my/order/refund', {
|
||||
id: item.order_id
|
||||
})
|
||||
},
|
||||
// 生成二维码事件
|
||||
generate(e) {
|
||||
uQRCode.make({
|
||||
canvasId: 'qrcode',
|
||||
componentInstance: this,
|
||||
text: "https://ky.sxczgkj.cn/wap/merchant/authPay?userAppId=244", // 想生成二维码到内容
|
||||
size: 150,
|
||||
margin: 0,
|
||||
backgroundColor: '#ffffff',
|
||||
foregroundColor: '#000000',
|
||||
fileType: 'jpg',
|
||||
errorCorrectLevel: uQRCode.errorCorrectLevel.H,
|
||||
success: res => {
|
||||
this.imgCode = res // base64的图片格式
|
||||
}
|
||||
})
|
||||
},
|
||||
// 保存到手机
|
||||
save() {
|
||||
uni.getSetting({ //获取用户的当前设置
|
||||
success: (res) => {
|
||||
if (res.authSetting['scope.writePhotosAlbum']) { //验证用户是否授权可以访问相册
|
||||
this.aveImageToPhotosAlbum();
|
||||
} else {
|
||||
uni.authorize({ //如果没有授权,向用户发起请求
|
||||
scope: 'scope.writePhotosAlbum',
|
||||
success: () => {
|
||||
this.aveImageToPhotosAlbum();
|
||||
},
|
||||
fail: () => {
|
||||
// 提示
|
||||
uni.showToast({
|
||||
title: "请打开保存相册权限,再点击保存到手机",
|
||||
icon: "none",
|
||||
duration: 3000
|
||||
});
|
||||
setTimeout(() => {
|
||||
uni.openSetting({ //调起客户端小程序设置界面,让用户开启访问相册
|
||||
success: (res2) => {
|
||||
// console.log(res2.authSetting)
|
||||
}
|
||||
});
|
||||
}, 3000);
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
copy(value) {
|
||||
//提示模板
|
||||
uni.setClipboardData({
|
||||
data: value, //要被复制的内容
|
||||
success: () => { //复制成功的回调函数
|
||||
uni.showToast({
|
||||
title: '复制成功'
|
||||
})
|
||||
}
|
||||
});
|
||||
},
|
||||
detailsInfo(e) { //查看订单详情
|
||||
uni.pro.navigateTo('my/order/cporderinfo', {
|
||||
id: e,
|
||||
})
|
||||
},
|
||||
phonefill(value) {
|
||||
uni.makePhoneCall({
|
||||
phoneNumber: value //仅为示例
|
||||
});
|
||||
},
|
||||
aveImageToPhotosAlbum() {
|
||||
let base64 = this.imgCode.replace(/^data:image\/\w+;base64,/, ""); //去掉data:image/png;base64,
|
||||
let filePath = wx.env.USER_DATA_PATH + '/ph_fit_qrcode.png'; // 路径文件名
|
||||
uni.showLoading({
|
||||
title: '加载中',
|
||||
mask: true
|
||||
})
|
||||
uni.getFileSystemManager().writeFile({ // 获取全局唯一的文件管理器
|
||||
filePath: filePath, //创建一个临时文件名
|
||||
data: base64, //写入的文本或二进制数据
|
||||
encoding: 'base64', //写入当前文件的字符编码
|
||||
success: res => {
|
||||
uni.saveImageToPhotosAlbum({ // 保存图片到系统相册
|
||||
filePath: filePath,
|
||||
success: function(res2) {
|
||||
uni.hideLoading();
|
||||
uni.showToast({
|
||||
title: '保存成功',
|
||||
icon: "none",
|
||||
duration: 5000
|
||||
})
|
||||
},
|
||||
fail: function(err) {
|
||||
uni.hideLoading();
|
||||
// console.log(err.errMsg);
|
||||
}
|
||||
})
|
||||
},
|
||||
fail: err => {
|
||||
uni.hideLoading();
|
||||
//console.log(err)
|
||||
}
|
||||
})
|
||||
},
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
background: #F6F6F6;
|
||||
}
|
||||
|
||||
.index {
|
||||
padding: 32rpx 28rpx;
|
||||
|
||||
.onecontent {
|
||||
width: 100%;
|
||||
padding: 32rpx;
|
||||
background: #FFFFFF;
|
||||
border-radius: 12rpx;
|
||||
|
||||
.onecontentone {
|
||||
font-size: 32rpx;
|
||||
font-family: SourceHanSansCN-Medium-, SourceHanSansCN-Medium;
|
||||
font-weight: normal;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.onecontenttow {
|
||||
margin-top: 16rpx;
|
||||
font-size: 24rpx;
|
||||
font-family: SourceHanSansCN-Regular-, SourceHanSansCN-Regular;
|
||||
font-weight: normal;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
.onecontentthere {
|
||||
margin-top: 24rpx;
|
||||
|
||||
.onecontentthere_one {
|
||||
background: #333333;
|
||||
border-radius: 8rpx;
|
||||
padding: 16rpx 94rpx;
|
||||
font-size: 28rpx;
|
||||
font-family: Source Han Sans CN-Medium, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
.onecontentthere_tow {
|
||||
background: #F7F7F7;
|
||||
border-radius: 8rpx;
|
||||
padding: 16rpx 94rpx;
|
||||
font-size: 28rpx;
|
||||
font-family: Source Han Sans CN-Medium, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
|
||||
color: #333333;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.towcontent {
|
||||
margin-top: 24rpx;
|
||||
width: 100%;
|
||||
background: #FFFFFF;
|
||||
border-radius: 18rpx;
|
||||
|
||||
.towcontentone {
|
||||
position: relative;
|
||||
padding: 16rpx 32rpx;
|
||||
border-radius: 18rpx 18rpx 0 0;
|
||||
background: #9397c1;
|
||||
|
||||
.towcontentone_one {
|
||||
width: 80%;
|
||||
|
||||
.towcontentone_one_image {
|
||||
width: 33.04rpx;
|
||||
height: 29.79rpx;
|
||||
}
|
||||
|
||||
.towcontentone_one_text {
|
||||
width: 80%;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
margin-left: 10rpx;
|
||||
font-size: 28rpx;
|
||||
font-family: SourceHanSansCN-Bold-, SourceHanSansCN-Bold;
|
||||
font-weight: normal;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
}
|
||||
|
||||
.towcontentone_one::after {
|
||||
z-index: 10;
|
||||
position: absolute;
|
||||
bottom: -22rpx;
|
||||
content: '';
|
||||
display: inline-block;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
width: 44rpx;
|
||||
height: 44rpx;
|
||||
border-radius: 0 0 22rpx 22rpx;
|
||||
background: #9397c1;
|
||||
}
|
||||
}
|
||||
|
||||
.towcontenttow {
|
||||
padding: 32rpx;
|
||||
width: 100%;
|
||||
background: #fff;
|
||||
|
||||
.towcontenttow_image {
|
||||
width: 128rpx;
|
||||
height: 128rpx;
|
||||
}
|
||||
|
||||
.towcontenttowone {
|
||||
height: 128rpx;
|
||||
margin-left: 36rpx;
|
||||
justify-content: space-around;
|
||||
|
||||
.towcontenttowone_one {
|
||||
font-size: 28rpx;
|
||||
font-family: SourceHanSansCN-Regular-, SourceHanSansCN-Regular;
|
||||
font-weight: normal;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.towcontenttowone_tow {
|
||||
.towcontenttowone_tow_one {
|
||||
font-size: 24rpx;
|
||||
font-family: SourceHanSansCN-Regular-, SourceHanSansCN-Regular;
|
||||
font-weight: normal;
|
||||
color: #999999;
|
||||
}
|
||||
}
|
||||
|
||||
.towcontenttowone_there {
|
||||
font-size: 32rpx;
|
||||
font-family: SourceHanSansCN-Bold-, SourceHanSansCN-Bold;
|
||||
font-weight: normal;
|
||||
color: #333333;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.towcontentthere {
|
||||
position: relative;
|
||||
height: 44rpx;
|
||||
width: 100%;
|
||||
|
||||
.towcontentthere_text {
|
||||
width: 100%;
|
||||
height: 0px;
|
||||
border: 1rpx dashed #EAEAEA;
|
||||
}
|
||||
|
||||
.towcontentthere_text::after {
|
||||
z-index: 10;
|
||||
position: absolute;
|
||||
content: '';
|
||||
display: inline-block;
|
||||
left: 0;
|
||||
top: 0;
|
||||
width: 22rpx;
|
||||
height: 44rpx;
|
||||
border-radius: 0 44rpx 44rpx 0;
|
||||
background: #f6f6f6;
|
||||
}
|
||||
|
||||
.towcontentthere_text::before {
|
||||
z-index: 10;
|
||||
position: absolute;
|
||||
content: '';
|
||||
display: inline-block;
|
||||
right: 0;
|
||||
top: 0;
|
||||
width: 22rpx;
|
||||
height: 44rpx;
|
||||
border-radius: 44rpx 0 0 44rpx;
|
||||
background: #f6f6f6;
|
||||
}
|
||||
}
|
||||
|
||||
.towcontenttfour {
|
||||
margin-top: 16rpx;
|
||||
font-size: 32rpx;
|
||||
font-family: SourceHanSansCN-Bold-, SourceHanSansCN-Bold;
|
||||
font-weight: normal;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.towcontenttfive {
|
||||
padding: 32rpx;
|
||||
width: 100%;
|
||||
|
||||
.towcontenttfive_one {
|
||||
font-size: 32rpx;
|
||||
font-family: SourceHanSansCN-Regular-, SourceHanSansCN-Regular;
|
||||
font-weight: normal;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.towcontenttfive_onetow {
|
||||
margin-left: 16rpx;
|
||||
font-size: 24rpx;
|
||||
font-family: SourceHanSansCN-Regular-, SourceHanSansCN-Regular;
|
||||
font-weight: normal;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
.towcontenttfive_tow {
|
||||
padding: 10rpx 16rpx;
|
||||
background: #FFFFFF;
|
||||
border-radius: 8rpx;
|
||||
border: 2rpx solid #D5D5D5;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.therecontent {
|
||||
margin-top: 24rpx;
|
||||
padding: 32rpx;
|
||||
width: 100%;
|
||||
background: #FFFFFF;
|
||||
border-radius: 18rpx;
|
||||
|
||||
.therecontentone {
|
||||
font-size: 28rpx;
|
||||
font-family: Source Han Sans CN-Bold, Source Han Sans CN;
|
||||
font-weight: bold;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.entowakst {
|
||||
font-size: 28rpx;
|
||||
font-family: SourceHanSansCN-Regular-, SourceHanSansCN-Regular;
|
||||
font-weight: normal;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.therecontentfive_box {
|
||||
padding: 6rpx 10rpx;
|
||||
font-size: 20rpx;
|
||||
font-family: SourceHanSansCN-Regular-, SourceHanSansCN-Regular;
|
||||
font-weight: normal;
|
||||
color: #666666;
|
||||
background: #FFFFFF;
|
||||
margin-left: 6rpx;
|
||||
border-radius: 8rpx;
|
||||
border: 2rpx solid #D5D5D5;
|
||||
}
|
||||
}
|
||||
|
||||
.fourcontent {
|
||||
margin-top: 24rpx;
|
||||
padding: 32rpx;
|
||||
width: 100%;
|
||||
background: #FFFFFF;
|
||||
border-radius: 18rpx;
|
||||
|
||||
.fourcontentone {
|
||||
font-size: 28rpx;
|
||||
font-family: Source Han Sans CN-Bold, Source Han Sans CN;
|
||||
font-weight: bold;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.fourcontentone::after {
|
||||
content: '';
|
||||
display: inline-block;
|
||||
width: 100%;
|
||||
height: 1rpx;
|
||||
border: 1px solid #F7F7F7;
|
||||
}
|
||||
|
||||
.entowakst {
|
||||
font-size: 24rpx;
|
||||
font-family: PingFang SC-Medium, PingFang SC;
|
||||
font-weight: 500;
|
||||
color: #666666;
|
||||
}
|
||||
}
|
||||
|
||||
.fivecontent {
|
||||
margin-top: 24rpx;
|
||||
padding: 32rpx;
|
||||
width: 100%;
|
||||
background: #FFFFFF;
|
||||
border-radius: 18rpx;
|
||||
|
||||
.fivecontentone {
|
||||
font-size: 28rpx;
|
||||
font-family: Source Han Sans CN-Bold, Source Han Sans CN;
|
||||
font-weight: bold;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.fivecontenttow {
|
||||
margin-top: 16rpx;
|
||||
|
||||
.fivecontenttow_one {
|
||||
.fivecontenttow_text {
|
||||
padding-right: 24rpx;
|
||||
font-size: 28rpx;
|
||||
font-family: SourceHanSansCN-Regular-, SourceHanSansCN-Regular;
|
||||
font-weight: normal;
|
||||
color: #333333;
|
||||
}
|
||||
}
|
||||
|
||||
.fivecontenttow_tow {
|
||||
font-size: 24rpx;
|
||||
font-family: SourceHanSansCN-Regular-, SourceHanSansCN-Regular;
|
||||
font-weight: normal;
|
||||
color: #666666;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
520
pages/order/paybill.vue
Normal file
520
pages/order/paybill.vue
Normal file
@@ -0,0 +1,520 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<view class="card">
|
||||
<view class="info-wrap">
|
||||
<image class="cover" :src="shopInfo.portrait" mode="aspectFill"></image>
|
||||
<text class="t">{{ shopInfo.userName }}</text>
|
||||
</view>
|
||||
<view class="input-wrap">
|
||||
<view class="input-cont">
|
||||
<text class="i">¥</text>
|
||||
<text class="num">{{ num }}</text>
|
||||
</view>
|
||||
<view class="tips"><input class="input" type="text" :maxlength="10" placeholder="添加付款备注(最多10个字)"
|
||||
v-model="remark" /></view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="card">
|
||||
<view class="title"><text>支付方式</text></view>
|
||||
<view class="pay-list">
|
||||
<view class="item">
|
||||
<view class="label">
|
||||
<image class="icon" src="@/static/4.png" mode="aspectFit"></image>
|
||||
<text class="t">微信支付</text>
|
||||
</view>
|
||||
<uni-icons type="checkbox-filled" size="18" color="#54A347"></uni-icons>
|
||||
</view>
|
||||
</view>
|
||||
<view class="num-wrap">
|
||||
<text>实付:</text>
|
||||
<text class="t b">¥{{ num || 0 }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="number-key-wrap">
|
||||
<view class="number-key">
|
||||
<view class="left">
|
||||
<view class="num-list">
|
||||
<view class="item" v-for="item in 9" :key="item" hover-class="active" hover-stay-time="50"
|
||||
@click="numHandle(`${item + 1}`)">
|
||||
<text>{{ item + 1 }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="num-foot">
|
||||
<view class="item" hover-class="active" hover-stay-time="50" @click="numHandle('0')">
|
||||
<text>0</text>
|
||||
</view>
|
||||
<view class="item" hover-class="active" hover-stay-time="50" @click="numHandle('.')">
|
||||
<text>.</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="right">
|
||||
<view class="item" hover-class="active" hover-stay-time="50" @click="delHandle" @longpress="longDel"
|
||||
@touchend="endLongDel">
|
||||
x
|
||||
<!-- <uni-icons type="arrow-left" size="24"></uni-icons> -->
|
||||
</view>
|
||||
<view class="item confirm" hover-class="active" hover-stay-time="50" @click="submitHandle">
|
||||
<text>付款</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
userAppId: '', // 用户id
|
||||
shopInfo: '', // 商户信息
|
||||
num: '', // 输入金额
|
||||
// maxNum: 200,
|
||||
remark: '', // 备注
|
||||
timer: null,
|
||||
orderNumber: '',
|
||||
type: 1,
|
||||
appid:''
|
||||
};
|
||||
},
|
||||
onLoad(e) {
|
||||
console.log(e, '111')
|
||||
uni.request({
|
||||
url: `https://ky.sxczgkj.cn/api/payConfig/appconfig`,
|
||||
method: 'get',
|
||||
header: {
|
||||
'content-type': 'application/json'
|
||||
},
|
||||
success: (res) => {
|
||||
if (res.data.code == 200) {
|
||||
this.appid = res.data.data.appid
|
||||
} else {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: res.data.message
|
||||
});
|
||||
}
|
||||
},
|
||||
fail: (err) => {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: '失败'
|
||||
});
|
||||
}
|
||||
});
|
||||
// #ifdef MP-WEIXIN
|
||||
uni.login({
|
||||
provider: 'weixin',
|
||||
success: async (data) => {
|
||||
try {
|
||||
let res = await this.api.usergetopenid({
|
||||
code: data.code
|
||||
})
|
||||
if (res) {
|
||||
uni.cache.set('openId',res.data.openid);
|
||||
}
|
||||
} catch (e) {
|
||||
console.log(e)
|
||||
}
|
||||
}
|
||||
});
|
||||
// #endif
|
||||
if (e.orderNumber) {
|
||||
this.orderNumber = e.orderNumber;
|
||||
}
|
||||
|
||||
if (e.q) {
|
||||
let urlStr = decodeURIComponent(e.q);
|
||||
if (this.getQueryString(urlStr, 'userAppId')) {
|
||||
this.type = 1;
|
||||
this.userAppId = this.getQueryString(urlStr, 'userAppId')
|
||||
} else {
|
||||
this.type = 2;
|
||||
this.userAppId = urlStr.match('[^/]+(?!.*/)')[0]
|
||||
}
|
||||
console.log(this.userAppId, 'this.userAppId')
|
||||
this.getShopInfo();
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 付款
|
||||
async submitHandle() {
|
||||
try {
|
||||
if (!this.num) {
|
||||
uni.showToast({
|
||||
title: '请输入支付金额',
|
||||
icon: 'none'
|
||||
});
|
||||
} else {
|
||||
uni.showLoading({
|
||||
title: '支付中...',
|
||||
mask: true
|
||||
});
|
||||
uni.login({
|
||||
provider: 'weixin',
|
||||
success: async (resdata) => {
|
||||
let res = await this.requestHandle('/applet-pay/java-pay', {
|
||||
store_id: this.shopInfo.store_id, // 商户id
|
||||
pay_type: '1',
|
||||
money: this.num, // 金额
|
||||
remark: this.remark, // 备注
|
||||
code: resdata.code,
|
||||
appid:this.appid
|
||||
});
|
||||
uni.requestPayment({
|
||||
provider: 'wxpay',
|
||||
timeStamp: res.data.payTimeStamp,
|
||||
nonceStr: res.data.paynonceStr,
|
||||
package: res.data.payPackage,
|
||||
signType: res.data.paySignType,
|
||||
paySign: res.data.paySign,
|
||||
success: (res) => {
|
||||
uni.hideLoading();
|
||||
uni.showModal({
|
||||
title: '注意',
|
||||
content: `成功支付${this.num}元`,
|
||||
showCancel: false,
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
// uni.reLaunch({
|
||||
// url: '/pages/index/index'
|
||||
// });
|
||||
uni.exitMiniProgram({
|
||||
success: () => {
|
||||
console.log('退出小程序成功');
|
||||
},
|
||||
fail: function(
|
||||
err) {
|
||||
console.log('退出小程序失败',err);
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
fail: (err) => {
|
||||
uni.hideLoading();
|
||||
uni.showToast({
|
||||
title: '支付失败',
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
} catch (e) {
|
||||
uni.showToast({
|
||||
title: '支付失败:' + JSON.stringify(e),
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
},
|
||||
// 删除
|
||||
delHandle() {
|
||||
uni.vibrateShort();
|
||||
this.num = this.num.slice(0, -1);
|
||||
},
|
||||
// 长按删除
|
||||
longDel() {
|
||||
this.timer = setInterval(() => {
|
||||
this.delHandle();
|
||||
}, 100);
|
||||
},
|
||||
// 结束长按删除
|
||||
endLongDel() {
|
||||
clearInterval(this.timer);
|
||||
this.timer = null;
|
||||
},
|
||||
// 输入
|
||||
numHandle(num) {
|
||||
uni.vibrateShort();
|
||||
this.num = this.clearNoNum({
|
||||
value: (this.num += num)
|
||||
});
|
||||
},
|
||||
// 封装请求
|
||||
requestHandle(url = '', data = {}, method = 'post') {
|
||||
return new Promise((resolve, reject) => {
|
||||
uni.request({
|
||||
url: `${'https://kysh.sxczgkj.cn'}/javaApi${url}`,
|
||||
method: method,
|
||||
header: {
|
||||
uniacid: '1',
|
||||
module: 'yb_o2ov2',
|
||||
appType: 'mini'
|
||||
// userId:uni.getStorageSync('userId')
|
||||
},
|
||||
data: data,
|
||||
success: (res) => {
|
||||
if (res.data.code == 1) {
|
||||
resolve(res.data);
|
||||
} else {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: res.data.msg
|
||||
});
|
||||
reject(res.data.msg);
|
||||
}
|
||||
},
|
||||
fail: (err) => {
|
||||
reject(JSON.stringify(err));
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
// 获取商户信息
|
||||
async getShopInfo() {
|
||||
try {
|
||||
const res = await this.requestHandle('/applet-pay/get-applet-store-info', {
|
||||
code_id: this.userAppId,
|
||||
type: this.type
|
||||
});
|
||||
this.shopInfo = res.data;
|
||||
} catch (e) {}
|
||||
},
|
||||
// 获取url参数
|
||||
getQueryString(url, name) {
|
||||
var reg = new RegExp('(^|&|/?)' + name + '=([^&|/?]*)(&|/?|$)', 'i');
|
||||
var r = url.substr(1).match(reg);
|
||||
if (r != null) {
|
||||
return r[2];
|
||||
}
|
||||
return null;
|
||||
},
|
||||
/**
|
||||
* 去除字符串中除了数字和点以外的其他字符
|
||||
* @param {Object} obj
|
||||
*/
|
||||
clearNoNum(obj) {
|
||||
//如果用户第一位输入的是小数点,则重置输入框内容
|
||||
if (obj.value != '' && obj.value.substr(0, 1) == '.') {
|
||||
obj.value = '';
|
||||
}
|
||||
obj.value = obj.value.replace(/^0*(0\.|[1-9])/, '$1'); //粘贴不生效
|
||||
obj.value = obj.value.replace(/[^\d.]/g, ''); //清除“数字”和“.”以外的字符
|
||||
obj.value = obj.value.replace(/\.{2,}/g, '.'); //只保留第一个. 清除多余的
|
||||
obj.value = obj.value.replace('.', '$#$').replace(/\./g, '').replace('$#$', '.');
|
||||
obj.value = obj.value.replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3'); //只能输入两个小数
|
||||
if (obj.value.indexOf('.') < 0 && obj.value != '') {
|
||||
//以上已经过滤,此处控制的是如果没有小数点,首位不能为类似于 01、02的金额
|
||||
if (obj.value.substr(0, 1) == '0' && obj.value.length == 2) {
|
||||
obj.value = obj.value.substr(1, obj.value.length);
|
||||
}
|
||||
}
|
||||
return obj.value;
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.container {
|
||||
padding: 28upx;
|
||||
padding-bottom: 640upx;
|
||||
}
|
||||
|
||||
.card {
|
||||
padding: 28upx;
|
||||
border-radius: 28upx;
|
||||
background-color: #fff;
|
||||
margin-bottom: 28upx;
|
||||
|
||||
.title {
|
||||
font-size: 32upx;
|
||||
}
|
||||
}
|
||||
|
||||
.info-wrap {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.cover {
|
||||
$size: 80upx;
|
||||
width: $size;
|
||||
height: $size;
|
||||
border-radius: 50%;
|
||||
margin-right: 20upx;
|
||||
background-color: #efefef;
|
||||
}
|
||||
|
||||
.t {
|
||||
font-size: 32upx;
|
||||
}
|
||||
}
|
||||
|
||||
.input-wrap {
|
||||
padding: 28upx 0 0;
|
||||
|
||||
.input-cont {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
border-bottom: 1upx solid #ececec;
|
||||
|
||||
.i {
|
||||
font-size: 42upx;
|
||||
font-weight: bold;
|
||||
margin-right: 12upx;
|
||||
position: relative;
|
||||
top: -4upx;
|
||||
}
|
||||
|
||||
.num {
|
||||
font-size: 48upx;
|
||||
height: 80upx;
|
||||
font-weight: bold;
|
||||
position: relative;
|
||||
padding-right: 14upx;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
|
||||
&::after {
|
||||
content: '';
|
||||
width: 4upx;
|
||||
height: 40upx;
|
||||
background-color: #333;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
margin-top: -24upx;
|
||||
right: 0;
|
||||
animation: ani 0.8s ease-in-out 1.4s infinite;
|
||||
}
|
||||
|
||||
@keyframes ani {
|
||||
0% {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
100% {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.tips {
|
||||
display: flex;
|
||||
padding-top: 24upx;
|
||||
|
||||
.input {
|
||||
flex: 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.pay-list {
|
||||
.item {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding: 28upx 0;
|
||||
|
||||
.label {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.icon {
|
||||
$size: 60upx;
|
||||
width: $size;
|
||||
height: $size;
|
||||
margin-right: 20upx;
|
||||
}
|
||||
|
||||
.t {
|
||||
font-size: 28upx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.num-wrap {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
|
||||
.t {
|
||||
font-size: 32upx;
|
||||
}
|
||||
|
||||
.b {
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
|
||||
.number-key-wrap {
|
||||
width: 100%;
|
||||
position: fixed;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
background-color: #efefef;
|
||||
z-index: 999;
|
||||
padding: 28upx 28upx calc(env(safe-area-inset-bottom) + 28upx);
|
||||
border-radius: 28upx 28upx 0 0;
|
||||
$gap: 12upx;
|
||||
$radius: 14upx;
|
||||
$itemH: 120upx;
|
||||
|
||||
.number-key {
|
||||
display: flex;
|
||||
|
||||
.item {
|
||||
display: flex;
|
||||
font-size: 48upx;
|
||||
font-weight: bold;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border-radius: $radius;
|
||||
background-color: #fff;
|
||||
|
||||
&.active {
|
||||
background-color: #d9d9d9;
|
||||
}
|
||||
}
|
||||
|
||||
.left {
|
||||
flex: 1;
|
||||
|
||||
.num-list {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr 1fr;
|
||||
grid-template-rows: $itemH $itemH $itemH;
|
||||
grid-gap: $gap;
|
||||
}
|
||||
|
||||
.num-foot {
|
||||
padding-top: $gap;
|
||||
display: grid;
|
||||
grid-gap: $gap;
|
||||
grid-template-columns: 2fr 1fr;
|
||||
grid-template-rows: $itemH;
|
||||
}
|
||||
}
|
||||
|
||||
.right {
|
||||
width: 160upx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
margin-left: $gap;
|
||||
|
||||
.item {
|
||||
flex: 1;
|
||||
|
||||
&:last-child {
|
||||
margin-top: $gap;
|
||||
font-size: 32upx;
|
||||
}
|
||||
|
||||
&.confirm {
|
||||
background-color: #ffcc17;
|
||||
|
||||
&.active {
|
||||
background-color: #e1b516;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
673
pages/project/create.vue
Normal file
673
pages/project/create.vue
Normal file
@@ -0,0 +1,673 @@
|
||||
<template>
|
||||
<view class="index">
|
||||
<view class="title_text">
|
||||
基本信息
|
||||
</view>
|
||||
<view class="onecontent">
|
||||
<view class="onecontent_item flex-between">
|
||||
<view class="onecontent_itemleft">
|
||||
项目图片
|
||||
</view>
|
||||
<view class="onecontent_itemright flex-start">
|
||||
<view v-if="form.img" class="onecontent_itemrightimges flex-colum" @click="chooseImagelist()">
|
||||
<image :src="form.img"></image>
|
||||
</view>
|
||||
<view v-else class="onecontent_itemrightimges flex-colum" @click="chooseImagelist()">
|
||||
+
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
<view class="onecontent_item flex-between">
|
||||
<view class="onecontent_itemleft">
|
||||
项目名称
|
||||
</view>
|
||||
<view class="onecontent_itemright flex-start">
|
||||
<input class="onecontent_itemright_text" v-model="form.title" type="text" placeholder="请输入项目名称">
|
||||
</view>
|
||||
</view>
|
||||
<view class="onecontent_item flex-between">
|
||||
<view class="onecontent_itemleft">
|
||||
原价
|
||||
</view>
|
||||
<view class="onecontent_itemright flex-start">
|
||||
<input class="onecontent_itemright_text" v-model="form.y_price" type="text" placeholder="给项目定个好价格">
|
||||
</view>
|
||||
</view>
|
||||
<view class="onecontent_item flex-between">
|
||||
<view class="onecontent_itemleft">
|
||||
现价
|
||||
</view>
|
||||
<view class="onecontent_itemright flex-start">
|
||||
<input class="onecontent_itemright_text" v-model="form.price" type="text" placeholder="给项目定个好价格">
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view class="onecontent_item flex-between">
|
||||
<view class="onecontent_itemleft">
|
||||
标签
|
||||
</view>
|
||||
<view class="onecontent_itemright flex-start">
|
||||
<input class="onecontent_itemright_text" type="text" placeholder="热卖、新品、爆款等,不超过两个字">
|
||||
</view>
|
||||
</view> -->
|
||||
<view class="onecontent_item flex-between">
|
||||
<view class="onecontent_itemleft">
|
||||
简单描述
|
||||
</view>
|
||||
<view class="onecontent_itemright flex-start">
|
||||
<input class="onecontent_itemright_text" v-model="form.describe" type="text"
|
||||
placeholder="显示项目列表的简单描述,不超过30个字">
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="title_text">
|
||||
项目设置
|
||||
</view>
|
||||
<view class="onecontent">
|
||||
<view class="onecontent_item flex-between">
|
||||
<view class="onecontent_itemleft">
|
||||
项目分类
|
||||
</view>
|
||||
<view class="onecontent_itemright flex-start" @click="clicksheetshow">
|
||||
<text style="flex: 1; text-align: right;" class="onecontent_itemrighttext"
|
||||
v-if="form.name">{{form.name}}</text>
|
||||
<text style="flex: 1; text-align: right;" class="onecontent_itemrighttext" v-else>请选择</text>
|
||||
<u-icon name="arrow-right" color="#999999" size="18"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
<view class="onecontent_item flex-between">
|
||||
<view class="onecontent_itemleft">
|
||||
上架
|
||||
</view>
|
||||
<u-switch v-model="form.status" @change="changeswitch" size="20"></u-switch>
|
||||
</view>
|
||||
<!-- <view class="onecontent_item flex-between">
|
||||
<view class="onecontent_itemleft">
|
||||
推荐
|
||||
</view>
|
||||
<u-switch v-model="form.is_re" @change="changeswitchs" size="20"></u-switch>
|
||||
</view> -->
|
||||
</view>
|
||||
<view class="title_text">
|
||||
项目描述
|
||||
</view>
|
||||
<view class="onecontent">
|
||||
<!-- <view @click="demos" class="onecontent_item flex-between">
|
||||
<view class="onecontent_itemleft">
|
||||
项目详情
|
||||
</view>
|
||||
<u-icon name="arrow-right" color="#999999" size="18"></u-icon>
|
||||
</view> -->
|
||||
<view class="container">
|
||||
<view class="page-body">
|
||||
<view class='wrapper'>
|
||||
<view class='toolbar' @tap="format">
|
||||
<view :class="formats.bold ? 'ql-active' : ''" class="iconfont icon-zitijiacu"
|
||||
data-name="bold">
|
||||
</view>
|
||||
<view :class="formats.italic ? 'ql-active' : ''" class="iconfont icon-zitixieti"
|
||||
data-name="italic">
|
||||
</view>
|
||||
<view :class="formats.underline ? 'ql-active' : ''" class="iconfont icon-zitixiahuaxian"
|
||||
data-name="underline"></view>
|
||||
<view :class="formats.strike ? 'ql-active' : ''" class="iconfont icon-zitishanchuxian"
|
||||
data-name="strike"></view>
|
||||
<!-- #ifndef MP-BAIDU -->
|
||||
<view :class="formats.align === 'left' ? 'ql-active' : ''" class="iconfont icon-zuoduiqi"
|
||||
data-name="align" data-value="left"></view>
|
||||
<!-- #endif -->
|
||||
<view :class="formats.align === 'center' ? 'ql-active' : ''"
|
||||
class="iconfont icon-juzhongduiqi" data-name="align" data-value="center"></view>
|
||||
<view :class="formats.align === 'right' ? 'ql-active' : ''" class="iconfont icon-youduiqi"
|
||||
data-name="align" data-value="right"></view>
|
||||
<view :class="formats.align === 'justify' ? 'ql-active' : ''"
|
||||
class="iconfont icon-zuoyouduiqi" data-name="align" data-value="justify"></view>
|
||||
<!-- #ifndef MP-BAIDU -->
|
||||
<view :class="formats.lineHeight ? 'ql-active' : ''" class="iconfont icon-line-height"
|
||||
data-name="lineHeight" data-value="2"></view>
|
||||
<view :class="formats.letterSpacing ? 'ql-active' : ''"
|
||||
class="iconfont icon-Character-Spacing" data-name="letterSpacing" data-value="2em">
|
||||
</view>
|
||||
<view :class="formats.marginTop ? 'ql-active' : ''"
|
||||
class="iconfont icon-722bianjiqi_duanqianju" data-name="marginTop" data-value="20px">
|
||||
</view>
|
||||
<view :class="formats.marginBottom ? 'ql-active' : ''"
|
||||
class="iconfont icon-723bianjiqi_duanhouju" data-name="marginBottom" data-value="20px">
|
||||
</view>
|
||||
<!-- #endif -->
|
||||
|
||||
<view class="iconfont icon-clearedformat" @tap="removeFormat"></view>
|
||||
|
||||
<!-- #ifndef MP-BAIDU -->
|
||||
<view :class="formats.fontFamily ? 'ql-active' : ''" class="iconfont icon-font"
|
||||
data-name="fontFamily" data-value="Pacifico"></view>
|
||||
<view :class="formats.fontSize === '24px' ? 'ql-active' : ''" class="iconfont icon-fontsize"
|
||||
data-name="fontSize" data-value="24px"></view>
|
||||
<!-- #endif -->
|
||||
<view :class="formats.color === '#0000ff' ? 'ql-active' : ''"
|
||||
class="iconfont icon-text_color" data-name="color" data-value="#0000ff"></view>
|
||||
<view :class="formats.backgroundColor === '#00ff00' ? 'ql-active' : ''"
|
||||
class="iconfont icon-fontbgcolor" data-name="backgroundColor" data-value="#00ff00">
|
||||
</view>
|
||||
<view class="iconfont icon-date" @tap="insertDate"></view>
|
||||
<view class="iconfont icon--checklist" data-name="list" data-value="check"></view>
|
||||
<view :class="formats.list === 'ordered' ? 'ql-active' : ''"
|
||||
class="iconfont icon-youxupailie" data-name="list" data-value="ordered"></view>
|
||||
<view :class="formats.list === 'bullet' ? 'ql-active' : ''" class="iconfont icon-wuxupailie"
|
||||
data-name="list" data-value="bullet"></view>
|
||||
|
||||
<view class="iconfont icon-undo" @tap="undo"></view>
|
||||
<view class="iconfont icon-redo" @tap="redo"></view>
|
||||
|
||||
<view class="iconfont icon-outdent" data-name="indent" data-value="-1"></view>
|
||||
<view class="iconfont icon-indent" data-name="indent" data-value="+1"></view>
|
||||
<view class="iconfont icon-fengexian" @tap="insertDivider"></view>
|
||||
<view class="iconfont icon-charutupian" @tap="insertImage"></view>
|
||||
<view :class="formats.header === 1 ? 'ql-active' : ''" class="iconfont icon-format-header-1"
|
||||
data-name="header" :data-value="1"></view>
|
||||
<view :class="formats.script === 'sub' ? 'ql-active' : ''" class="iconfont icon-zitixiabiao"
|
||||
data-name="script" data-value="sub"></view>
|
||||
<view :class="formats.script === 'super' ? 'ql-active' : ''"
|
||||
class="iconfont icon-zitishangbiao" data-name="script" data-value="super"></view>
|
||||
|
||||
<view class="iconfont icon-shanchu" @tap="clear"></view>
|
||||
|
||||
<view :class="formats.direction === 'rtl' ? 'ql-active' : ''"
|
||||
class="iconfont icon-direction-rtl" data-name="direction" data-value="rtl"></view>
|
||||
|
||||
</view>
|
||||
|
||||
<view class="editor-wrapper">
|
||||
<editor id="editor" class="ql-container" placeholder="开始输入..." show-img-size
|
||||
show-img-toolbar show-img-resize @statuschange="onStatusChange" @input="getText"
|
||||
:read-only="readOnly" @ready="onEditorReady">
|
||||
</editor>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<view class="baocun" @tap="$u.debounce(servicecreateitem,1000)">
|
||||
保存
|
||||
</view>
|
||||
<view class="baocun" v-if="form.service_id!=''" @click="servicedelservice" style="background: red;">
|
||||
删除
|
||||
</view>
|
||||
<u-action-sheet :actions="listsheet" :show="sheetshow" @select="selectClick"></u-action-sheet>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import uploadImage from "@/js_sdk/yushijie-ossutil/ossutil/uploadFile.js";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
listsheet: [],
|
||||
sheetshow: false,
|
||||
readOnly: false,
|
||||
formats: {},
|
||||
context: {},
|
||||
form: {
|
||||
service_type_id: '',
|
||||
title: '',
|
||||
y_price: '',
|
||||
price: '',
|
||||
describe: '',
|
||||
status: true,
|
||||
is_re: false,
|
||||
details: '',
|
||||
service_id: '',
|
||||
name: "",
|
||||
img: '',
|
||||
}
|
||||
}
|
||||
},
|
||||
async onLoad(e) {
|
||||
try {
|
||||
if (e.id) {
|
||||
console.log(e)
|
||||
this.form.service_id = e.id
|
||||
let res = await this.api.servicedetail({
|
||||
service_id: e.id
|
||||
})
|
||||
uni.setNavigationBarTitle({
|
||||
title: '修改项目'
|
||||
})
|
||||
if (res.code = 1) {
|
||||
this.form = res.data
|
||||
var thisdatadescribe = res.data.details
|
||||
uni.createSelectorQuery().select('#editor').context((res) => {
|
||||
if (!res) return
|
||||
res.context.setContents({
|
||||
html: thisdatadescribe
|
||||
})
|
||||
}).exec()
|
||||
console.log(this.form)
|
||||
}
|
||||
} else {
|
||||
uni.setNavigationBarTitle({
|
||||
title: '创建项目'
|
||||
})
|
||||
}
|
||||
} catch (e) {
|
||||
//TODO handle the exception
|
||||
}
|
||||
this.serviceitemclass()
|
||||
},
|
||||
onShow() {},
|
||||
mounted() {
|
||||
this.$bus.$on('editors', this.demo)
|
||||
},
|
||||
methods: {
|
||||
clicksheetshow() {
|
||||
if (this.listsheet.length == 0) {
|
||||
uni.showToast({
|
||||
title: '请先去添加分类',
|
||||
icon: 'none'
|
||||
});
|
||||
} else {
|
||||
this.sheetshow = true
|
||||
}
|
||||
|
||||
},
|
||||
demo(data) {
|
||||
this.form.details = data
|
||||
},
|
||||
demos() {
|
||||
uni.pro.navigateTo('project/editor/editor', {
|
||||
id: this.form.service_id
|
||||
})
|
||||
},
|
||||
selectClick(index) {
|
||||
this.sheetshow = false
|
||||
this.form.name = index.name
|
||||
this.form.service_type_id = index.id
|
||||
console.log(index)
|
||||
},
|
||||
changeswitch(e) {
|
||||
this.form.status = e
|
||||
},
|
||||
changeswitchs(e) {
|
||||
this.form.is_re = e
|
||||
},
|
||||
async serviceitemclass(e) { //项目分类
|
||||
let data = await this.api.serviceitemclass({
|
||||
page:1
|
||||
});
|
||||
this.listsheet = data.data
|
||||
},
|
||||
async servicecreateitem() {
|
||||
if (this.form.service_type_id == null || this.form.service_type_id == '') {
|
||||
uni.showToast({
|
||||
title: '请选择项目分类',
|
||||
icon: 'none'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if (this.form.title == null || this.form.title == '') {
|
||||
uni.showToast({
|
||||
title: '请填写项目名称',
|
||||
icon: 'none'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if (this.form.price == null || this.form.price == '') {
|
||||
uni.showToast({
|
||||
title: '原价不能为空',
|
||||
icon: 'none'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if (this.form.describe == null || this.form.describe == '') {
|
||||
uni.showToast({
|
||||
title: '项目详情不能为空',
|
||||
icon: 'none'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.form.details == null || this.form.details == '') {
|
||||
uni.showToast({
|
||||
title: '详情/规则不能为空',
|
||||
icon: 'none'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if (this.form.img == null || this.form.img == '') {
|
||||
uni.showToast({
|
||||
title: '图片不能为空',
|
||||
icon: 'none'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
let res = await this.api.servicecreateitem({
|
||||
service_type_id: this.form.service_type_id,
|
||||
title: this.form.title,
|
||||
y_price: this.form.y_price,
|
||||
price: this.form.price,
|
||||
describe: this.form.describe,
|
||||
status: this.form.status,
|
||||
is_re: this.form.is_re,
|
||||
details: this.form.details,
|
||||
img: this.form.img,
|
||||
service_id: this.form.service_id
|
||||
});
|
||||
if (res.code == 1) {
|
||||
uni.showToast({
|
||||
title: this.form.service_id ? '修改成功' : '创建成功',
|
||||
icon: 'none'
|
||||
});
|
||||
uni.navigateBack();
|
||||
}
|
||||
},
|
||||
async servicedelservice() {
|
||||
var this_ = this
|
||||
console.log(this.form.service_id)
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '确认删除该项目吗?',
|
||||
success: async (res) => {
|
||||
if (res.confirm) {
|
||||
let data = await this.api.servicedelservice({
|
||||
service_id: this.form.service_id
|
||||
});
|
||||
if (data.code == 1) {
|
||||
uni.showToast({
|
||||
title: '删除成功',
|
||||
icon: 'none'
|
||||
});
|
||||
setTimeout(() => {
|
||||
uni.navigateBack();
|
||||
}, 1000);
|
||||
}
|
||||
} else if (res.cancel) {
|
||||
console.log('用户点击取消');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
// 上传
|
||||
chooseImagelist() {
|
||||
uni.showLoading({
|
||||
title: '上传中',
|
||||
mask: true
|
||||
})
|
||||
uni.chooseImage({
|
||||
count: 1, //默认9
|
||||
sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
|
||||
sourceType: ['album'], //从相册选择
|
||||
success: (res) => {
|
||||
let file = res.tempFilePaths[0];
|
||||
uploadImage(file, 'refund/',
|
||||
result => {
|
||||
this.form.avatar = ''
|
||||
this.form.img = result
|
||||
uni.hideLoading()
|
||||
}, result => {
|
||||
console.log(result, '2222')
|
||||
uni.hideLoading()
|
||||
})
|
||||
},
|
||||
fail: (res) => {
|
||||
uni.hideLoading()
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
getText(e) {
|
||||
this.context = e.detail.html
|
||||
this.form.details = this.context
|
||||
console.log(e.detail.html, this.context); //输出相应内容的html代码
|
||||
},
|
||||
readOnlyChange() {
|
||||
this.readOnly = !this.readOnly
|
||||
},
|
||||
onEditorReady() {
|
||||
// #ifdef MP-BAIDU
|
||||
this.editorCtx = requireDynamicLib('editorLib').createEditorContext('editor');
|
||||
// #endif
|
||||
|
||||
// #ifdef APP-PLUS || MP-WEIXIN || H5
|
||||
uni.createSelectorQuery().select('#editor').context((res) => {
|
||||
this.editorCtx = res.context
|
||||
}).exec()
|
||||
// #endif
|
||||
},
|
||||
|
||||
undo() {
|
||||
this.editorCtx.undo()
|
||||
},
|
||||
redo() {
|
||||
this.editorCtx.redo()
|
||||
},
|
||||
format(e) {
|
||||
let {
|
||||
name,
|
||||
value
|
||||
} = e.target.dataset
|
||||
if (!name) return
|
||||
// console.log('format', name, value)
|
||||
this.editorCtx.format(name, value)
|
||||
},
|
||||
onStatusChange(e) {
|
||||
const formats = e.detail
|
||||
this.formats = formats
|
||||
},
|
||||
insertDivider() {
|
||||
this.editorCtx.insertDivider({
|
||||
success: function() {
|
||||
console.log('insert divider success')
|
||||
}
|
||||
})
|
||||
},
|
||||
clear() {
|
||||
uni.showModal({
|
||||
title: '清空编辑器',
|
||||
content: '确定清空编辑器全部内容?',
|
||||
success: res => {
|
||||
if (res.confirm) {
|
||||
this.editorCtx.clear({
|
||||
success: function(res) {
|
||||
console.log("clear success")
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
removeFormat() {
|
||||
this.editorCtx.removeFormat()
|
||||
},
|
||||
insertDate() {
|
||||
const date = new Date()
|
||||
const formatDate = `${date.getFullYear()}/${date.getMonth() + 1}/${date.getDate()}`
|
||||
this.editorCtx.insertText({
|
||||
text: formatDate
|
||||
})
|
||||
},
|
||||
insertImage() {
|
||||
uni.showLoading({
|
||||
title: '上传中',
|
||||
mask: true
|
||||
})
|
||||
uni.chooseImage({
|
||||
count: 1, //默认9
|
||||
sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
|
||||
sourceType: ['album'], //从相册选择
|
||||
success: (res) => {
|
||||
let file = res.tempFilePaths[0];
|
||||
uploadImage(file, 'wechat/',
|
||||
result => {
|
||||
this.editorCtx.insertImage({
|
||||
src: result,
|
||||
alt: '图像',
|
||||
})
|
||||
uni.hideLoading()
|
||||
}, result => {
|
||||
console.log(result)
|
||||
uni.hideLoading()
|
||||
})
|
||||
},
|
||||
fail: (res) => {
|
||||
uni.hideLoading()
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
@import "./editor-icon.css";
|
||||
|
||||
page {
|
||||
background: #F6F6F6;
|
||||
}
|
||||
|
||||
.index {
|
||||
.title_text {
|
||||
padding: 12rpx 40rpx;
|
||||
font-size: 28rpx;
|
||||
font-family: SourceHanSansCN-Regular, SourceHanSansCN;
|
||||
font-weight: 400;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
#editor {
|
||||
width: 100%;
|
||||
height: 456rpx;
|
||||
padding: 12rpx 40rpx;
|
||||
background: #FFFFFF;
|
||||
}
|
||||
|
||||
.baocun {
|
||||
margin: 40rpx auto;
|
||||
width: 90%;
|
||||
padding: 18rpx 0;
|
||||
background: #6699FF;
|
||||
text-align: center;
|
||||
border-radius: 16rpx;
|
||||
font-size: 32rpx;
|
||||
font-family: SourceHanSansCN-Regular, SourceHanSansCN;
|
||||
font-weight: 400;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
.onecontent {
|
||||
background: #ffffff;
|
||||
|
||||
.wrapper {
|
||||
height: 100%;
|
||||
|
||||
.editor-wrapper {
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.iconfont {
|
||||
display: inline-block;
|
||||
padding: 8px 8px;
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
cursor: pointer;
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
.toolbar {
|
||||
box-sizing: border-box;
|
||||
border-bottom: 0;
|
||||
}
|
||||
|
||||
.ql-container {
|
||||
box-sizing: border-box;
|
||||
padding: 12px 15px;
|
||||
width: 100%;
|
||||
min-height: 30vh;
|
||||
height: 100%;
|
||||
font-size: 16px;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.ql-active {
|
||||
color: #06c;
|
||||
}
|
||||
}
|
||||
|
||||
.onecontent_item {
|
||||
width: 100%;
|
||||
padding: 16rpx 46rpx;
|
||||
border-bottom: 2rpx solid #E5E5E5;
|
||||
|
||||
.onecontent_itemleft {
|
||||
flex: 1;
|
||||
font-size: 28rpx;
|
||||
font-family: SourceHanSansCN-Regular, SourceHanSansCN;
|
||||
font-weight: 400;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
.onecontent_itemright {
|
||||
flex: 3;
|
||||
|
||||
.onecontent_itemrighttext {
|
||||
font-size: 24rpx;
|
||||
font-family: SourceHanSansCN-Regular, SourceHanSansCN;
|
||||
font-weight: 400;
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
.onecontent_itemrightimges {
|
||||
width: 112rpx;
|
||||
height: 112rpx;
|
||||
background: #F5F5F5;
|
||||
border-radius: 10rpx;
|
||||
font-size: 40rpx;
|
||||
color: #878787;
|
||||
|
||||
image {
|
||||
width: 112rpx;
|
||||
height: 112rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.onecontent_itemright_text {
|
||||
width: 100%;
|
||||
font-size: 24rpx;
|
||||
font-family: SourceHanSansCN-Regular, SourceHanSansCN;
|
||||
font-weight: 400;
|
||||
color: #999999;
|
||||
}
|
||||
}
|
||||
|
||||
.flex-start {
|
||||
.fourcontent {
|
||||
.fourcontent_item {
|
||||
position: relative;
|
||||
margin-top: 16rpx;
|
||||
margin-left: 20rpx;
|
||||
width: 112rpx;
|
||||
height: 112rpx;
|
||||
border-radius: 16rpx;
|
||||
|
||||
image {
|
||||
width: 112rpx;
|
||||
height: 112rpx;
|
||||
border-radius: 16rpx;
|
||||
}
|
||||
|
||||
.fourcontent_itemtext {
|
||||
position: absolute;
|
||||
top: 0rpx;
|
||||
right: 0rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
</style>
|
||||
197
pages/project/createcap.vue
Normal file
197
pages/project/createcap.vue
Normal file
@@ -0,0 +1,197 @@
|
||||
<template>
|
||||
<view class="index">
|
||||
<view class="title_text">
|
||||
创建分类
|
||||
</view>
|
||||
<view class="onecontent">
|
||||
<view class="onecontent_item flex-between">
|
||||
<view class="onecontent_itemleft">
|
||||
项目分类
|
||||
</view>
|
||||
<view class="onecontent_itemright flex-start">
|
||||
<input class="onecontent_itemright_text" v-model="name" maxlength="8" type="text"
|
||||
placeholder="请输入项目分类">
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="thereconse thereconses" @click="servicecreateitemclass">
|
||||
确定
|
||||
</view>
|
||||
<view class="title_text">
|
||||
管理分类
|
||||
</view>
|
||||
<view class="onecontent">
|
||||
<view class="onecontent_item flex-between" v-for="(item,index) in list" :key="index"
|
||||
@click="contentfixedclick(item)">
|
||||
<view class="onecontent_itemleft">
|
||||
{{item.name}}
|
||||
</view>
|
||||
<u-icon name="arrow-right" color="#333" size="20"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="list.length==0 && is_end == true" style="margin-top: 100rpx;width: 100%;" class="flex-colum">
|
||||
<image src="https://ointmentweapp.oss-cn-beijing.aliyuncs.com/image/my/order/nothave.png" mode="">
|
||||
</image>
|
||||
</view>
|
||||
<u-loadmore :status="form.status" />
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
name: '',
|
||||
list: [],
|
||||
is_end: false,
|
||||
form: {
|
||||
page: 1,
|
||||
status: 'loadmore',
|
||||
},
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
this.init_fn()
|
||||
},
|
||||
methods: {
|
||||
init_fn() {
|
||||
this.list = []
|
||||
this.is_end = false
|
||||
this.form.page = 1
|
||||
this.form.status = 'loadmore'
|
||||
this.shoppinggooodstype()
|
||||
},
|
||||
async shoppinggooodstype() {
|
||||
let res = await this.api.serviceitemclass({
|
||||
page:1
|
||||
});
|
||||
if (res.code == 1) {
|
||||
if (res.data.length == 0) {
|
||||
this.is_end = true
|
||||
this.form.status = 'nomore'
|
||||
return false;
|
||||
} else {
|
||||
this.form.status = 'loading';
|
||||
this.form.page = ++this.form.page;
|
||||
setTimeout(() => {
|
||||
this.list = [...this.list, ...res.data];
|
||||
if (res.data.length == 10) {
|
||||
this.form.status = 'loading';
|
||||
} else {
|
||||
this.is_end = true;
|
||||
this.form.status = 'nomore';
|
||||
}
|
||||
}, 500)
|
||||
}
|
||||
}
|
||||
},
|
||||
contentfixedclick(e) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/project/createcapinfo?name=' + e.name +'&goods_type_id='+ e.id
|
||||
});
|
||||
},
|
||||
async servicecreateitemclass() {
|
||||
let res = await this.api.servicecreateitemclass({
|
||||
name: this.name,
|
||||
type:1
|
||||
});
|
||||
if (res.code == 1) {
|
||||
uni.showToast({
|
||||
title: '创建成功',
|
||||
icon: 'none'
|
||||
});
|
||||
setTimeout(() => {
|
||||
uni.navigateBack();
|
||||
}, 1000);
|
||||
}
|
||||
},
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
background: #F6F6F6;
|
||||
}
|
||||
|
||||
.index {
|
||||
.title_text {
|
||||
padding: 12rpx 40rpx;
|
||||
font-size: 28rpx;
|
||||
font-family: SourceHanSansCN-Regular, SourceHanSansCN;
|
||||
font-weight: 400;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
#editor {
|
||||
width: 100%;
|
||||
height: 456rpx;
|
||||
padding: 12rpx 40rpx;
|
||||
background: #FFFFFF;
|
||||
}
|
||||
|
||||
.onecontent {
|
||||
background: #ffffff;
|
||||
|
||||
.onecontent_item {
|
||||
width: 100%;
|
||||
padding: 16rpx 46rpx;
|
||||
border-bottom: 2rpx solid #E5E5E5;
|
||||
|
||||
.onecontent_itemleft {
|
||||
flex: 1;
|
||||
font-size: 28rpx;
|
||||
font-family: SourceHanSansCN-Regular, SourceHanSansCN;
|
||||
font-weight: 400;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
.onecontent_itemright {
|
||||
flex: 3;
|
||||
|
||||
.onecontent_itemrighttext {
|
||||
font-size: 24rpx;
|
||||
font-family: SourceHanSansCN-Regular, SourceHanSansCN;
|
||||
font-weight: 400;
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
.onecontent_itemrightimges {
|
||||
width: 112rpx;
|
||||
height: 112rpx;
|
||||
background: #F5F5F5;
|
||||
border-radius: 10rpx;
|
||||
font-size: 40rpx;
|
||||
color: #878787;
|
||||
}
|
||||
|
||||
.onecontent_itemright_text {
|
||||
width: 100%;
|
||||
font-size: 24rpx;
|
||||
font-family: SourceHanSansCN-Regular, SourceHanSansCN;
|
||||
font-weight: 400;
|
||||
color: #999999;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.thereconse {
|
||||
width: 630rpx;
|
||||
height: 80rpx;
|
||||
background: #999999;
|
||||
border-radius: 40rpx;
|
||||
font-size: 36rpx;
|
||||
text-align: center;
|
||||
margin: 84rpx auto;
|
||||
font-family: PingFang SC-Bold, PingFang SC;
|
||||
font-weight: bold;
|
||||
color: #FFFFFF;
|
||||
line-height: 80rpx;
|
||||
}
|
||||
|
||||
.thereconses {
|
||||
background: linear-gradient(115deg, #7E81A5 0%, #4D4E64 100%);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
161
pages/project/createcapinfo.vue
Normal file
161
pages/project/createcapinfo.vue
Normal file
@@ -0,0 +1,161 @@
|
||||
<template>
|
||||
<view class="index">
|
||||
<view class="title_text">
|
||||
修改分类
|
||||
</view>
|
||||
<view class="onecontent">
|
||||
<view class="onecontent_item flex-between">
|
||||
<view class="onecontent_itemleft">
|
||||
商品分类
|
||||
</view>
|
||||
<view class="onecontent_itemright flex-start">
|
||||
<input class="onecontent_itemright_text" v-model="form.name" maxlength="8" type="text"
|
||||
placeholder="请输入商品分类">
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="thereconse" @click="servicecreateitemclass">
|
||||
确定
|
||||
</view>
|
||||
<view class="thereconse thereconsess" @click="shoppingdeletegoodstype">
|
||||
刪除
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
form: {
|
||||
name:'',
|
||||
service_id:''
|
||||
},
|
||||
}
|
||||
},
|
||||
onLoad(e) {
|
||||
this.form.name = e.name
|
||||
this.form.service_id = e.goods_type_id
|
||||
},
|
||||
methods: {
|
||||
async shoppingdeletegoodstype(){
|
||||
let res = await this.api.servicedeleteitem({
|
||||
id:this.form.service_id
|
||||
});
|
||||
if (res.code == 1) {
|
||||
uni.showToast({
|
||||
title: '删除成功',
|
||||
icon: 'none'
|
||||
});
|
||||
setTimeout(() => {
|
||||
uni.navigateBack();
|
||||
}, 1000);
|
||||
}
|
||||
},
|
||||
async servicecreateitemclass() {
|
||||
let res = await this.api.servicecreateitemclass({
|
||||
name: this.form.name,
|
||||
type:2,
|
||||
id:this.form.service_id
|
||||
});
|
||||
if (res.code == 1) {
|
||||
uni.showToast({
|
||||
title: '修改成功',
|
||||
icon: 'none'
|
||||
});
|
||||
setTimeout(() => {
|
||||
uni.navigateBack();
|
||||
}, 1000);
|
||||
}
|
||||
},
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
background: #F6F6F6;
|
||||
}
|
||||
|
||||
.index {
|
||||
.title_text {
|
||||
padding: 12rpx 40rpx;
|
||||
font-size: 28rpx;
|
||||
font-family: SourceHanSansCN-Regular, SourceHanSansCN;
|
||||
font-weight: 400;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
#editor {
|
||||
width: 100%;
|
||||
height: 456rpx;
|
||||
padding: 12rpx 40rpx;
|
||||
background: #FFFFFF;
|
||||
}
|
||||
|
||||
.onecontent {
|
||||
background: #ffffff;
|
||||
|
||||
.onecontent_item {
|
||||
width: 100%;
|
||||
padding: 16rpx 46rpx;
|
||||
border-bottom: 2rpx solid #E5E5E5;
|
||||
|
||||
.onecontent_itemleft {
|
||||
flex: 1;
|
||||
font-size: 28rpx;
|
||||
font-family: SourceHanSansCN-Regular, SourceHanSansCN;
|
||||
font-weight: 400;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
.onecontent_itemright {
|
||||
flex: 3;
|
||||
|
||||
.onecontent_itemrighttext {
|
||||
font-size: 24rpx;
|
||||
font-family: SourceHanSansCN-Regular, SourceHanSansCN;
|
||||
font-weight: 400;
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
.onecontent_itemrightimges {
|
||||
width: 112rpx;
|
||||
height: 112rpx;
|
||||
background: #F5F5F5;
|
||||
border-radius: 10rpx;
|
||||
font-size: 40rpx;
|
||||
color: #878787;
|
||||
}
|
||||
|
||||
.onecontent_itemright_text {
|
||||
width: 100%;
|
||||
font-size: 24rpx;
|
||||
font-family: SourceHanSansCN-Regular, SourceHanSansCN;
|
||||
font-weight: 400;
|
||||
color: #999999;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.thereconse {
|
||||
width: 630rpx;
|
||||
height: 80rpx;
|
||||
background: #999999;
|
||||
border-radius: 40rpx;
|
||||
font-size: 36rpx;
|
||||
text-align: center;
|
||||
margin: 50rpx auto;
|
||||
font-family: PingFang SC-Bold, PingFang SC;
|
||||
font-weight: bold;
|
||||
color: #FFFFFF;
|
||||
line-height: 80rpx;
|
||||
background: #6699FF;
|
||||
border-radius: 16rpx;
|
||||
}
|
||||
.thereconsess{
|
||||
background:#fc5f69;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
238
pages/project/editor-icon.css
Normal file
238
pages/project/editor-icon.css
Normal file
File diff suppressed because one or more lines are too long
238
pages/project/editor/editor-icon.css
Normal file
238
pages/project/editor/editor-icon.css
Normal file
File diff suppressed because one or more lines are too long
271
pages/project/editor/editor.vue
Normal file
271
pages/project/editor/editor.vue
Normal file
@@ -0,0 +1,271 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<view class="page-body">
|
||||
<view class='wrapper'>
|
||||
<view class='toolbar' @tap="format">
|
||||
<view :class="formats.bold ? 'ql-active' : ''" class="iconfont icon-zitijiacu" data-name="bold">
|
||||
</view>
|
||||
<view :class="formats.italic ? 'ql-active' : ''" class="iconfont icon-zitixieti" data-name="italic">
|
||||
</view>
|
||||
<view :class="formats.underline ? 'ql-active' : ''" class="iconfont icon-zitixiahuaxian"
|
||||
data-name="underline"></view>
|
||||
<view :class="formats.strike ? 'ql-active' : ''" class="iconfont icon-zitishanchuxian"
|
||||
data-name="strike"></view>
|
||||
<!-- #ifndef MP-BAIDU -->
|
||||
<view :class="formats.align === 'left' ? 'ql-active' : ''" class="iconfont icon-zuoduiqi"
|
||||
data-name="align" data-value="left"></view>
|
||||
<!-- #endif -->
|
||||
<view :class="formats.align === 'center' ? 'ql-active' : ''" class="iconfont icon-juzhongduiqi"
|
||||
data-name="align" data-value="center"></view>
|
||||
<view :class="formats.align === 'right' ? 'ql-active' : ''" class="iconfont icon-youduiqi"
|
||||
data-name="align" data-value="right"></view>
|
||||
<view :class="formats.align === 'justify' ? 'ql-active' : ''" class="iconfont icon-zuoyouduiqi"
|
||||
data-name="align" data-value="justify"></view>
|
||||
<!-- #ifndef MP-BAIDU -->
|
||||
<view :class="formats.lineHeight ? 'ql-active' : ''" class="iconfont icon-line-height"
|
||||
data-name="lineHeight" data-value="2"></view>
|
||||
<view :class="formats.letterSpacing ? 'ql-active' : ''" class="iconfont icon-Character-Spacing"
|
||||
data-name="letterSpacing" data-value="2em"></view>
|
||||
<view :class="formats.marginTop ? 'ql-active' : ''" class="iconfont icon-722bianjiqi_duanqianju"
|
||||
data-name="marginTop" data-value="20px"></view>
|
||||
<view :class="formats.marginBottom ? 'ql-active' : ''" class="iconfont icon-723bianjiqi_duanhouju"
|
||||
data-name="marginBottom" data-value="20px"></view>
|
||||
<!-- #endif -->
|
||||
|
||||
<view class="iconfont icon-clearedformat" @tap="removeFormat"></view>
|
||||
|
||||
<!-- #ifndef MP-BAIDU -->
|
||||
<view :class="formats.fontFamily ? 'ql-active' : ''" class="iconfont icon-font"
|
||||
data-name="fontFamily" data-value="Pacifico"></view>
|
||||
<view :class="formats.fontSize === '24px' ? 'ql-active' : ''" class="iconfont icon-fontsize"
|
||||
data-name="fontSize" data-value="24px"></view>
|
||||
<!-- #endif -->
|
||||
<view :class="formats.color === '#0000ff' ? 'ql-active' : ''" class="iconfont icon-text_color"
|
||||
data-name="color" data-value="#0000ff"></view>
|
||||
<view :class="formats.backgroundColor === '#00ff00' ? 'ql-active' : ''"
|
||||
class="iconfont icon-fontbgcolor" data-name="backgroundColor" data-value="#00ff00"></view>
|
||||
<view class="iconfont icon-date" @tap="insertDate"></view>
|
||||
<view class="iconfont icon--checklist" data-name="list" data-value="check"></view>
|
||||
<view :class="formats.list === 'ordered' ? 'ql-active' : ''" class="iconfont icon-youxupailie"
|
||||
data-name="list" data-value="ordered"></view>
|
||||
<view :class="formats.list === 'bullet' ? 'ql-active' : ''" class="iconfont icon-wuxupailie"
|
||||
data-name="list" data-value="bullet"></view>
|
||||
|
||||
<view class="iconfont icon-undo" @tap="undo"></view>
|
||||
<view class="iconfont icon-redo" @tap="redo"></view>
|
||||
|
||||
<view class="iconfont icon-outdent" data-name="indent" data-value="-1"></view>
|
||||
<view class="iconfont icon-indent" data-name="indent" data-value="+1"></view>
|
||||
<view class="iconfont icon-fengexian" @tap="insertDivider"></view>
|
||||
<view class="iconfont icon-charutupian" @tap="insertImage"></view>
|
||||
<view :class="formats.header === 1 ? 'ql-active' : ''" class="iconfont icon-format-header-1"
|
||||
data-name="header" :data-value="1"></view>
|
||||
<view :class="formats.script === 'sub' ? 'ql-active' : ''" class="iconfont icon-zitixiabiao"
|
||||
data-name="script" data-value="sub"></view>
|
||||
<view :class="formats.script === 'super' ? 'ql-active' : ''" class="iconfont icon-zitishangbiao"
|
||||
data-name="script" data-value="super"></view>
|
||||
|
||||
<view class="iconfont icon-shanchu" @tap="clear"></view>
|
||||
|
||||
<view :class="formats.direction === 'rtl' ? 'ql-active' : ''" class="iconfont icon-direction-rtl"
|
||||
data-name="direction" data-value="rtl"></view>
|
||||
|
||||
</view>
|
||||
|
||||
<view class="editor-wrapper">
|
||||
<editor id="editor" class="ql-container" placeholder="开始输入..." show-img-size show-img-toolbar
|
||||
show-img-resize @statuschange="onStatusChange" @input="getText" :read-only="readOnly"
|
||||
@ready="onEditorReady">
|
||||
</editor>
|
||||
</view>
|
||||
<view
|
||||
style="display:block; width: 80%; padding: 18rpx 0; text-align: center; margin:20rpx auto 0 auto; color: #fff; background:#6699ff;border-radius:16rpx;"
|
||||
@click="determine">
|
||||
确定</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import uploadImage from "@/js_sdk/yushijie-ossutil/ossutil/uploadFile.js";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
readOnly: false,
|
||||
formats: {},
|
||||
context: {}
|
||||
}
|
||||
},
|
||||
async onLoad(e) {
|
||||
try {
|
||||
if (e.id) {
|
||||
let res = await this.api.servicedetail({
|
||||
service_id: e.id
|
||||
})
|
||||
if (res.code = 1) {
|
||||
var thisdatadescribe = res.data.details
|
||||
uni.createSelectorQuery().select('#editor').context((res) => {
|
||||
if (!res) return
|
||||
res.context.setContents({
|
||||
html: thisdatadescribe
|
||||
})
|
||||
}).exec()
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
//TODO handle the exception
|
||||
}
|
||||
// #ifndef MP-BAIDU
|
||||
uni.loadFontFace({
|
||||
family: 'Pacifico',
|
||||
source: 'url("https://sungd.github.io/Pacifico.ttf")'
|
||||
})
|
||||
// #endif
|
||||
},
|
||||
methods: {
|
||||
getText(e) {
|
||||
this.context = e.detail.html
|
||||
console.log(e.detail.html, this.context); //输出相应内容的html代码
|
||||
},
|
||||
readOnlyChange() {
|
||||
this.readOnly = !this.readOnly
|
||||
},
|
||||
onEditorReady() {
|
||||
// #ifdef MP-BAIDU
|
||||
this.editorCtx = requireDynamicLib('editorLib').createEditorContext('editor');
|
||||
// #endif
|
||||
|
||||
// #ifdef APP-PLUS || MP-WEIXIN || H5
|
||||
uni.createSelectorQuery().select('#editor').context((res) => {
|
||||
this.editorCtx = res.context
|
||||
}).exec()
|
||||
// #endif
|
||||
},
|
||||
determine() {
|
||||
this.$bus.$emit('editors', this.context)
|
||||
uni.navigateBack()
|
||||
},
|
||||
undo() {
|
||||
this.editorCtx.undo()
|
||||
},
|
||||
redo() {
|
||||
this.editorCtx.redo()
|
||||
},
|
||||
format(e) {
|
||||
let {
|
||||
name,
|
||||
value
|
||||
} = e.target.dataset
|
||||
if (!name) return
|
||||
// console.log('format', name, value)
|
||||
this.editorCtx.format(name, value)
|
||||
},
|
||||
onStatusChange(e) {
|
||||
const formats = e.detail
|
||||
this.formats = formats
|
||||
},
|
||||
insertDivider() {
|
||||
this.editorCtx.insertDivider({
|
||||
success: function() {
|
||||
console.log('insert divider success')
|
||||
}
|
||||
})
|
||||
},
|
||||
clear() {
|
||||
uni.showModal({
|
||||
title: '清空编辑器',
|
||||
content: '确定清空编辑器全部内容?',
|
||||
success: res => {
|
||||
if (res.confirm) {
|
||||
this.editorCtx.clear({
|
||||
success: function(res) {
|
||||
console.log("clear success")
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
removeFormat() {
|
||||
this.editorCtx.removeFormat()
|
||||
},
|
||||
insertDate() {
|
||||
const date = new Date()
|
||||
const formatDate = `${date.getFullYear()}/${date.getMonth() + 1}/${date.getDate()}`
|
||||
this.editorCtx.insertText({
|
||||
text: formatDate
|
||||
})
|
||||
},
|
||||
insertImage() {
|
||||
uni.showLoading({
|
||||
title: '上传中',
|
||||
mask: true
|
||||
})
|
||||
uni.chooseImage({
|
||||
count: 1, //默认9
|
||||
sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
|
||||
sourceType: ['album'], //从相册选择
|
||||
success: (res) => {
|
||||
let file = res.tempFilePaths[0];
|
||||
uploadImage(file, 'wechat/',
|
||||
result => {
|
||||
this.editorCtx.insertImage({
|
||||
src: result,
|
||||
alt: '图像',
|
||||
})
|
||||
uni.hideLoading()
|
||||
}, result => {
|
||||
console.log(result)
|
||||
uni.hideLoading()
|
||||
})
|
||||
},
|
||||
fail: (res) => {
|
||||
uni.hideLoading()
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
@import "./editor-icon.css";
|
||||
|
||||
|
||||
.wrapper {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.editor-wrapper {
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.iconfont {
|
||||
display: inline-block;
|
||||
padding: 8px 8px;
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
cursor: pointer;
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
.toolbar {
|
||||
box-sizing: border-box;
|
||||
border-bottom: 0;
|
||||
}
|
||||
|
||||
.ql-container {
|
||||
box-sizing: border-box;
|
||||
padding: 12px 15px;
|
||||
width: 100%;
|
||||
min-height: 30vh;
|
||||
height: 100%;
|
||||
font-size: 16px;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.ql-active {
|
||||
color: #06c;
|
||||
}
|
||||
</style>
|
||||
BIN
pages/project/editor/iconfont.ttf
Normal file
BIN
pages/project/editor/iconfont.ttf
Normal file
Binary file not shown.
230
pages/project/index.vue
Normal file
230
pages/project/index.vue
Normal file
@@ -0,0 +1,230 @@
|
||||
<template>
|
||||
<view class="content">
|
||||
<view class="onecontent flex-between">
|
||||
<u-search shape="square" :clearabled="true" @blur='servicelists' :showAction="false" placeholder="输入关键字"
|
||||
v-model="like"></u-search>
|
||||
<view class="flex-start" style="padding-left:20rpx;" @click="contentfixedclick()">
|
||||
<u-icon name="order" color="#666" size="22"></u-icon>
|
||||
<text class="flex-starttext">新建项目</text>
|
||||
</view>
|
||||
<view class="flex-start" style="padding-left:20rpx;" @click="createcap()">
|
||||
<u-icon name="order" color="#666" size="22"></u-icon>
|
||||
<text class="flex-starttext">新建分类</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="contenttow">
|
||||
<view class="contenttowitem" v-for="(item,index) in list" :key="index" @click="contentfixedclick(item.service_id)">
|
||||
<view class="contenttowitemone flex-between">
|
||||
<text class="contenttowitemone_one"
|
||||
:style="item.service_status == 0?'color: #ccc;':''">{{item.service_title}}</text>
|
||||
<view class="contenttowitemone_tow flex-start" >
|
||||
<text class="contenttowitemone_towtext">编辑项目</text>
|
||||
<u-icon name="file-text" color="#999" size="20"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
<view class="contenttowitemtow flex-between">
|
||||
<image class="contenttowitemtowimage" :src="item.service_img" mode=""></image>
|
||||
<view class="contenttowitemtow_item flex-colum-start">
|
||||
<view class="contenttowitemtow_itemone" :style="item.service_status == 0?'color: #ccc;':''">
|
||||
{{item.service_describe}}
|
||||
</view>
|
||||
<view class="contenttowitemtow_ittow flex-between">
|
||||
<view class="contenttowitemtow_ittowone"
|
||||
:style="item.service_status == 0?'color: #ccc;':''">
|
||||
¥{{item.service_price}}<text
|
||||
class="contenttowitemtow_ittowonetext">{{item.service_y_price}}</text>
|
||||
</view>
|
||||
<view class="contenttowitemtow_ittowtow">
|
||||
<text v-if="item.service_status == 1" style="color: green;">已上架</text>
|
||||
<text v-else style="color: red;">已下架</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="list.length==0 && form.is_end == true" class="flex-colum">
|
||||
<image src="https://ointmentweapp.oss-cn-beijing.aliyuncs.com/image/my/order/nothave.png" mode="">
|
||||
</image>
|
||||
</view>
|
||||
<u-loadmore :status="form.status" />
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
like: "",
|
||||
list: [],
|
||||
form: {
|
||||
is_end: false,
|
||||
page: 1,
|
||||
status: 'loadmore',
|
||||
},
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
this.form = {
|
||||
is_end: false,
|
||||
page: 1,
|
||||
status: 'loadmore',
|
||||
},
|
||||
this.list = []
|
||||
this.servicelist()
|
||||
},
|
||||
onReachBottom() {
|
||||
this.servicelist()
|
||||
},
|
||||
methods: {
|
||||
servicelists() {
|
||||
this.list = []
|
||||
this.form.page = 1
|
||||
this.servicelist()
|
||||
},
|
||||
contentfixedclick(e) {
|
||||
uni.pro.navigateTo('project/create', {
|
||||
id: e
|
||||
})
|
||||
},
|
||||
createcap() {
|
||||
uni.pro.navigateTo('project/createcap')
|
||||
},
|
||||
async servicelist(e) { //项目列表
|
||||
let res = await this.api.servicelist({
|
||||
page: this.form.page,
|
||||
like: this.like
|
||||
});
|
||||
if (res.data.length == 0) {
|
||||
this.form.is_end = true
|
||||
this.form.status = 'nomore'
|
||||
return false;
|
||||
} else {
|
||||
this.form.status = 'loading';
|
||||
this.form.page = ++this.form.page;
|
||||
setTimeout(() => {
|
||||
this.list = [...this.list, ...res.data];
|
||||
if (res.data.length == 10) {
|
||||
this.form.status = 'loading';
|
||||
} else {
|
||||
this.form.is_end = true;
|
||||
this.form.status = 'nomore';
|
||||
}
|
||||
}, 500)
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
background: #fbfbfa;
|
||||
}
|
||||
|
||||
.content {
|
||||
.onecontent {
|
||||
padding: 16rpx 20rpx;
|
||||
width: 100%;
|
||||
background: #FFFFFF;
|
||||
|
||||
.flex-start {
|
||||
.flex-starttext {
|
||||
font-size: 28rpx;
|
||||
font-family: SourceHanSansCN-Regular, SourceHanSansCN;
|
||||
font-weight: 400;
|
||||
color: #666666;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.contenttow {
|
||||
padding: 0 28rpx;
|
||||
|
||||
.contenttowitem {
|
||||
margin-top: 34rpx;
|
||||
padding: 24rpx;
|
||||
width: 100%;
|
||||
background: #FFFFFF;
|
||||
border-radius: 24rpx;
|
||||
|
||||
.contenttowitemone {
|
||||
width: 100%;
|
||||
padding-bottom: 18rpx;
|
||||
border-bottom: 1rpx solid #EAEAEA;
|
||||
|
||||
.contenttowitemone_one {
|
||||
width: 60%;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
font-size: 28rpx;
|
||||
font-family: SourceHanSansCN-Medium, SourceHanSansCN;
|
||||
font-weight: bold;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.contenttowitemone_tow {
|
||||
.contenttowitemone_towtext {
|
||||
font-size: 24rpx;
|
||||
font-family: SourceHanSansCN-Regular, SourceHanSansCN;
|
||||
font-weight: 400;
|
||||
color: #666666;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.contenttowitemtow {
|
||||
width: 100%;
|
||||
padding-top: 18rpx;
|
||||
|
||||
.contenttowitemtowimage {
|
||||
width: 136rpx;
|
||||
height: 136rpx;
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
|
||||
.contenttowitemtow_item {
|
||||
height: 136rpx;
|
||||
width: 75%;
|
||||
justify-content: space-between;
|
||||
|
||||
.contenttowitemtow_itemone {
|
||||
width: 100%;
|
||||
font-size: 24rpx;
|
||||
font-family: SourceHanSansCN-Regular, SourceHanSansCN;
|
||||
font-weight: 400;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.contenttowitemtow_ittow {
|
||||
width: 100%;
|
||||
|
||||
.contenttowitemtow_ittowone {
|
||||
font-size: 32rpx;
|
||||
font-family: SourceHanSansCN-Medium, SourceHanSansCN;
|
||||
font-weight: bold;
|
||||
color: #333333;
|
||||
|
||||
.contenttowitemtow_ittowonetext {
|
||||
text-decoration: line-through;
|
||||
margin-left: 10rpx;
|
||||
font-size: 22rpx;
|
||||
font-weight: 400;
|
||||
}
|
||||
}
|
||||
|
||||
.contenttowitemtow_ittowtow {
|
||||
font-size: 16rpx;
|
||||
font-family: SourceHanSansCN-Regular, SourceHanSansCN;
|
||||
font-weight: 400;
|
||||
color: #999999;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
238
pages/shop/editor/editor-icon.css
Normal file
238
pages/shop/editor/editor-icon.css
Normal file
File diff suppressed because one or more lines are too long
273
pages/shop/editor/editor.vue
Normal file
273
pages/shop/editor/editor.vue
Normal file
@@ -0,0 +1,273 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<view class="page-body">
|
||||
<view class='wrapper'>
|
||||
<view class='toolbar' @tap="format">
|
||||
<view :class="formats.bold ? 'ql-active' : ''" class="iconfont icon-zitijiacu" data-name="bold">
|
||||
</view>
|
||||
<view :class="formats.italic ? 'ql-active' : ''" class="iconfont icon-zitixieti" data-name="italic">
|
||||
</view>
|
||||
<view :class="formats.underline ? 'ql-active' : ''" class="iconfont icon-zitixiahuaxian"
|
||||
data-name="underline"></view>
|
||||
<view :class="formats.strike ? 'ql-active' : ''" class="iconfont icon-zitishanchuxian"
|
||||
data-name="strike"></view>
|
||||
<!-- #ifndef MP-BAIDU -->
|
||||
<view :class="formats.align === 'left' ? 'ql-active' : ''" class="iconfont icon-zuoduiqi"
|
||||
data-name="align" data-value="left"></view>
|
||||
<!-- #endif -->
|
||||
<view :class="formats.align === 'center' ? 'ql-active' : ''" class="iconfont icon-juzhongduiqi"
|
||||
data-name="align" data-value="center"></view>
|
||||
<view :class="formats.align === 'right' ? 'ql-active' : ''" class="iconfont icon-youduiqi"
|
||||
data-name="align" data-value="right"></view>
|
||||
<view :class="formats.align === 'justify' ? 'ql-active' : ''" class="iconfont icon-zuoyouduiqi"
|
||||
data-name="align" data-value="justify"></view>
|
||||
<!-- #ifndef MP-BAIDU -->
|
||||
<view :class="formats.lineHeight ? 'ql-active' : ''" class="iconfont icon-line-height"
|
||||
data-name="lineHeight" data-value="2"></view>
|
||||
<view :class="formats.letterSpacing ? 'ql-active' : ''" class="iconfont icon-Character-Spacing"
|
||||
data-name="letterSpacing" data-value="2em"></view>
|
||||
<view :class="formats.marginTop ? 'ql-active' : ''" class="iconfont icon-722bianjiqi_duanqianju"
|
||||
data-name="marginTop" data-value="20px"></view>
|
||||
<view :class="formats.marginBottom ? 'ql-active' : ''" class="iconfont icon-723bianjiqi_duanhouju"
|
||||
data-name="marginBottom" data-value="20px"></view>
|
||||
<!-- #endif -->
|
||||
|
||||
<view class="iconfont icon-clearedformat" @tap="removeFormat"></view>
|
||||
|
||||
<!-- #ifndef MP-BAIDU -->
|
||||
<view :class="formats.fontFamily ? 'ql-active' : ''" class="iconfont icon-font"
|
||||
data-name="fontFamily" data-value="Pacifico"></view>
|
||||
<view :class="formats.fontSize === '24px' ? 'ql-active' : ''" class="iconfont icon-fontsize"
|
||||
data-name="fontSize" data-value="24px"></view>
|
||||
<!-- #endif -->
|
||||
<view :class="formats.color === '#0000ff' ? 'ql-active' : ''" class="iconfont icon-text_color"
|
||||
data-name="color" data-value="#0000ff"></view>
|
||||
<view :class="formats.backgroundColor === '#00ff00' ? 'ql-active' : ''"
|
||||
class="iconfont icon-fontbgcolor" data-name="backgroundColor" data-value="#00ff00"></view>
|
||||
<view class="iconfont icon-date" @tap="insertDate"></view>
|
||||
<view class="iconfont icon--checklist" data-name="list" data-value="check"></view>
|
||||
<view :class="formats.list === 'ordered' ? 'ql-active' : ''" class="iconfont icon-youxupailie"
|
||||
data-name="list" data-value="ordered"></view>
|
||||
<view :class="formats.list === 'bullet' ? 'ql-active' : ''" class="iconfont icon-wuxupailie"
|
||||
data-name="list" data-value="bullet"></view>
|
||||
|
||||
<view class="iconfont icon-undo" @tap="undo"></view>
|
||||
<view class="iconfont icon-redo" @tap="redo"></view>
|
||||
|
||||
<view class="iconfont icon-outdent" data-name="indent" data-value="-1"></view>
|
||||
<view class="iconfont icon-indent" data-name="indent" data-value="+1"></view>
|
||||
<view class="iconfont icon-fengexian" @tap="insertDivider"></view>
|
||||
<view class="iconfont icon-charutupian" @tap="insertImage"></view>
|
||||
<view :class="formats.header === 1 ? 'ql-active' : ''" class="iconfont icon-format-header-1"
|
||||
data-name="header" :data-value="1"></view>
|
||||
<view :class="formats.script === 'sub' ? 'ql-active' : ''" class="iconfont icon-zitixiabiao"
|
||||
data-name="script" data-value="sub"></view>
|
||||
<view :class="formats.script === 'super' ? 'ql-active' : ''" class="iconfont icon-zitishangbiao"
|
||||
data-name="script" data-value="super"></view>
|
||||
|
||||
<view class="iconfont icon-shanchu" @tap="clear"></view>
|
||||
|
||||
<view :class="formats.direction === 'rtl' ? 'ql-active' : ''" class="iconfont icon-direction-rtl"
|
||||
data-name="direction" data-value="rtl"></view>
|
||||
|
||||
</view>
|
||||
|
||||
<view class="editor-wrapper">
|
||||
<editor id="editor" class="ql-container" placeholder="开始输入..." show-img-size show-img-toolbar
|
||||
show-img-resize @statuschange="onStatusChange" @input="getText" :read-only="readOnly"
|
||||
@ready="onEditorReady">
|
||||
</editor>
|
||||
</view>
|
||||
<view
|
||||
style="display:block; width: 80%; padding: 18rpx 0; text-align: center; margin:20rpx auto 0 auto; color: #fff; background:#6699ff;border-radius:16rpx;"
|
||||
@click="determine">
|
||||
确定</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import uploadImage from "@/js_sdk/yushijie-ossutil/ossutil/uploadFile.js";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
readOnly: false,
|
||||
formats: {},
|
||||
context: {}
|
||||
}
|
||||
},
|
||||
async onLoad(e) {
|
||||
try {
|
||||
if (e.id) {
|
||||
let res = await this.api.serviceseccarddesc({
|
||||
id: e.id
|
||||
})
|
||||
if (res.code = 1) {
|
||||
var thisdatadescribe = res.data.notice
|
||||
this.context = res.data.notice
|
||||
uni.createSelectorQuery().select('#editor').context((res) => {
|
||||
if (!res) return
|
||||
res.context.setContents({
|
||||
html: thisdatadescribe
|
||||
})
|
||||
}).exec()
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
//TODO handle the exception
|
||||
}
|
||||
// #ifndef MP-BAIDU
|
||||
uni.loadFontFace({
|
||||
family: 'Pacifico',
|
||||
source: 'url("https://sungd.github.io/Pacifico.ttf")'
|
||||
})
|
||||
// #endif
|
||||
},
|
||||
methods: {
|
||||
getText(e) {
|
||||
this.context = e.detail.html
|
||||
console.log(e.detail.html, this.context); //输出相应内容的html代码
|
||||
},
|
||||
readOnlyChange() {
|
||||
this.readOnly = !this.readOnly
|
||||
},
|
||||
onEditorReady() {
|
||||
// #ifdef MP-BAIDU
|
||||
this.editorCtx = requireDynamicLib('editorLib').createEditorContext('editor');
|
||||
// #endif
|
||||
|
||||
// #ifdef APP-PLUS || MP-WEIXIN || H5
|
||||
uni.createSelectorQuery().select('#editor').context((res) => {
|
||||
this.editorCtx = res.context
|
||||
}).exec()
|
||||
// #endif
|
||||
},
|
||||
determine() {
|
||||
this.$bus.$emit('showeditors', this.context)
|
||||
uni.navigateBack()
|
||||
},
|
||||
undo() {
|
||||
this.editorCtx.undo()
|
||||
},
|
||||
redo() {
|
||||
this.editorCtx.redo()
|
||||
},
|
||||
format(e) {
|
||||
let {
|
||||
name,
|
||||
value
|
||||
} = e.target.dataset
|
||||
if (!name) return
|
||||
// console.log('format', name, value)
|
||||
this.editorCtx.format(name, value)
|
||||
},
|
||||
onStatusChange(e) {
|
||||
const formats = e.detail
|
||||
this.formats = formats
|
||||
},
|
||||
insertDivider() {
|
||||
this.editorCtx.insertDivider({
|
||||
success: function() {
|
||||
console.log('insert divider success')
|
||||
}
|
||||
})
|
||||
},
|
||||
clear() {
|
||||
uni.showModal({
|
||||
title: '清空编辑器',
|
||||
content: '确定清空编辑器全部内容?',
|
||||
success: res => {
|
||||
if (res.confirm) {
|
||||
this.editorCtx.clear({
|
||||
success: function(res) {
|
||||
console.log("clear success")
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
removeFormat() {
|
||||
this.editorCtx.removeFormat()
|
||||
},
|
||||
insertDate() {
|
||||
const date = new Date()
|
||||
const formatDate = `${date.getFullYear()}/${date.getMonth() + 1}/${date.getDate()}`
|
||||
this.editorCtx.insertText({
|
||||
text: formatDate
|
||||
})
|
||||
},
|
||||
insertImage() {
|
||||
uni.showLoading({
|
||||
title: '上传中',
|
||||
mask: true
|
||||
})
|
||||
uni.chooseImage({
|
||||
count: 1, //默认9
|
||||
sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
|
||||
sourceType: ['album'], //从相册选择
|
||||
success: (res) => {
|
||||
let file = res.tempFilePaths[0];
|
||||
uploadImage(file, 'wechat/shopeditor/',
|
||||
result => {
|
||||
this.editorCtx.insertImage({
|
||||
src: result,
|
||||
alt: '图像',
|
||||
})
|
||||
uni.hideLoading()
|
||||
}, result => {
|
||||
console.log(result)
|
||||
uni.hideLoading()
|
||||
})
|
||||
},
|
||||
fail: (res) => {
|
||||
uni.hideLoading()
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
@import "./editor-icon.css";
|
||||
|
||||
|
||||
.wrapper {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.editor-wrapper {
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.iconfont {
|
||||
display: inline-block;
|
||||
padding: 8px 8px;
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
cursor: pointer;
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
.toolbar {
|
||||
box-sizing: border-box;
|
||||
border-bottom: 0;
|
||||
}
|
||||
|
||||
.ql-container {
|
||||
box-sizing: border-box;
|
||||
padding: 12px 15px;
|
||||
width: 100%;
|
||||
min-height: 30vh;
|
||||
height: 100%;
|
||||
font-size: 16px;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.ql-active {
|
||||
color: #06c;
|
||||
}
|
||||
</style>
|
||||
BIN
pages/shop/editor/iconfont.ttf
Normal file
BIN
pages/shop/editor/iconfont.ttf
Normal file
Binary file not shown.
201
pages/shop/index.vue
Normal file
201
pages/shop/index.vue
Normal file
@@ -0,0 +1,201 @@
|
||||
<template>
|
||||
<view class="index">
|
||||
<view class="indexone_item flex-between" @click="clickJump(5)">
|
||||
<view class="indexone_itemone flex-start">
|
||||
<image class="indexone_itemoneimage" :src="form.avatar" mode=""></image>
|
||||
<view class="flex-colum-start">
|
||||
<text class="flex-colum-start_one">{{form.title}}</text>
|
||||
<text class="flex-colum-start_tow">{{form.label || ''}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<u-icon name="arrow-right" color="#999999" size="18"></u-icon>
|
||||
</view>
|
||||
<view class="indexone_item flex-between" @click="clickJump(3)">
|
||||
<view class="indexone_itemone flex-start">
|
||||
<image src="https://ointmentweapp.oss-cn-beijing.aliyuncs.com/icon/shop2.png" mode=""></image>
|
||||
<text>创建会员卡</text>
|
||||
</view>
|
||||
<u-icon name="arrow-right" color="#999999" size="18"></u-icon>
|
||||
</view>
|
||||
<view class="indexone_item flex-between" @click="clickJump(5)">
|
||||
<view class="indexone_itemone flex-start">
|
||||
<image src="https://ointmentweapp.oss-cn-beijing.aliyuncs.com/icon/shop3.png" mode=""></image>
|
||||
<text>门店设置</text>
|
||||
</view>
|
||||
<u-icon name="arrow-right" color="#999999" size="18"></u-icon>
|
||||
</view>
|
||||
<view class="indexone_item flex-between" @click="clickJump(6)">
|
||||
<view class="indexone_itemone flex-start">
|
||||
<image src="@/static/shop/shop4.png" mode=""></image>
|
||||
<text>推广二维码</text>
|
||||
</view>
|
||||
<u-icon name="arrow-right" color="#999999" size="18"></u-icon>
|
||||
</view>
|
||||
<view class="indexone_item flex-between" @click="clickJump(8)">
|
||||
<view class="indexone_itemone flex-start">
|
||||
<image src="@/static/shop/shop5.png" mode=""></image>
|
||||
<text>商城订单</text>
|
||||
</view>
|
||||
<u-icon name="arrow-right" color="#999999" size="18"></u-icon>
|
||||
</view>
|
||||
<view class="indexone_item flex-between" @click="clickJump(9)">
|
||||
<view class="indexone_itemone flex-start">
|
||||
<image src="@/static/shop/shop6.png" mode=""></image>
|
||||
<text>商城管理</text>
|
||||
</view>
|
||||
<u-icon name="arrow-right" color="#999999" size="18"></u-icon>
|
||||
</view>
|
||||
<view class="indexone_items" style="background: #6699FF;color: #FFFFFF;" @click="clickJump(7)">
|
||||
切换账号
|
||||
</view>
|
||||
<view class="indexone_items" @click="clickJump(4)">
|
||||
退出登录
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
form: {}
|
||||
}
|
||||
},
|
||||
async onShow() {
|
||||
this.userstoredetail()
|
||||
},
|
||||
methods: {
|
||||
async userstoredetail() {
|
||||
let res = await this.api.userstoredetail()
|
||||
this.form = res.data
|
||||
this.lnglat = res.data.lat + '-' + res.data.lng
|
||||
},
|
||||
clickJump(e) {
|
||||
switch (e) {
|
||||
case 0:
|
||||
uni.pro.navigateTo('shop/create')
|
||||
break;
|
||||
case 1:
|
||||
uni.pro.navigateTo('shop/createcap')
|
||||
break;
|
||||
case 2:
|
||||
uni.pro.navigateTo('shop/upload')
|
||||
break;
|
||||
case 3:
|
||||
uni.pro.navigateTo('shop/member')
|
||||
break;
|
||||
case 4:
|
||||
this.userlogout()
|
||||
break;
|
||||
case 5:
|
||||
uni.pro.navigateTo('shop/store')
|
||||
break;
|
||||
case 6:
|
||||
uni.pro.navigateTo('shop/promotion')
|
||||
break;
|
||||
case 7:
|
||||
uni.pro.navigateTo('shop/indexes')
|
||||
break;
|
||||
case 8:
|
||||
uni.pro.navigateTo('mall/index')
|
||||
break;
|
||||
case 9:
|
||||
uni.pro.navigateTo('mailproject/index')
|
||||
break;
|
||||
}
|
||||
},
|
||||
async userlogout() { //退出登录
|
||||
uni.showModal({
|
||||
title: '注意',
|
||||
content: '确定要退出登录吗?',
|
||||
success: async (res) => {
|
||||
console.log(111)
|
||||
if (res.confirm) {
|
||||
try {
|
||||
let data = await this.api.userlogout();
|
||||
console.log(data)
|
||||
if (data.code == 1) {
|
||||
uni.cache.clear();
|
||||
uni.reLaunch({
|
||||
url: '/pages/login/login'
|
||||
});
|
||||
}
|
||||
} catch (e) {
|
||||
//TODO handle the exception
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
background: #FBFBFA;
|
||||
}
|
||||
|
||||
.index {
|
||||
.indexone_items {
|
||||
width: 80%;
|
||||
padding: 16rpx 0;
|
||||
margin: 40rpx auto;
|
||||
text-align: center;
|
||||
background: #E0E0E0;
|
||||
border-radius: 16rpx;
|
||||
font-size: 32rpx;
|
||||
font-family: SourceHanSansCN-Regular, SourceHanSansCN;
|
||||
font-weight: 400;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
.indexone_item {
|
||||
padding: 24rpx 32rpx;
|
||||
border-bottom: 2rpx solid #E5E5E5;
|
||||
|
||||
.indexone_itemone {
|
||||
image {
|
||||
width: 38rpx;
|
||||
height: 38rpx;
|
||||
}
|
||||
|
||||
.indexone_itemoneimage {
|
||||
width: 112rpx;
|
||||
height: 112rpx;
|
||||
}
|
||||
|
||||
.flex-colum-start {
|
||||
.flex-colum-start_one {
|
||||
width: 100%;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
font-size: 32rpx;
|
||||
font-family: SourceHanSansCN-Medium, SourceHanSansCN;
|
||||
font-weight: 500;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.flex-colum-start_tow {
|
||||
overflow: hidden;
|
||||
margin-top: 16rpx;
|
||||
font-size: 32rpx;
|
||||
font-family: SourceHanSansCN-Regular, SourceHanSansCN;
|
||||
font-weight: 400;
|
||||
color: #999999;
|
||||
}
|
||||
}
|
||||
|
||||
text {
|
||||
margin-left: 32rpx;
|
||||
font-size: 28rpx;
|
||||
font-family: SourceHanSansCN-Regular, SourceHanSansCN;
|
||||
font-weight: 400;
|
||||
color: #333333;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
171
pages/shop/indexes.vue
Normal file
171
pages/shop/indexes.vue
Normal file
@@ -0,0 +1,171 @@
|
||||
<template>
|
||||
<view class="index flex-colum">
|
||||
<view class="index_text">
|
||||
点击头像切换店铺账号
|
||||
</view>
|
||||
<view class="index_box">
|
||||
<view class="index_item flex-between" v-for="(item,index) in list" :key="index" @click="clickes(item)">
|
||||
<view class="index_itemone flex-start">
|
||||
<image class="index_itemoneimage" :src="item.avatar" mode=""></image>
|
||||
<view class="flex-colum-start">
|
||||
<view class="index_itemone_one">
|
||||
{{item.title}}
|
||||
</view>
|
||||
<view class="index_itemone_tow">
|
||||
{{item.class}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="index_itemonetext" v-if="item.store_id==storeid">
|
||||
当前使用
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
screenheight: '',
|
||||
list: [],
|
||||
storeid: uni.cache.get('user').store_id
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.useraccountlist()
|
||||
uni.getSystemInfo({
|
||||
success: (e) => {
|
||||
let screenHeight = 0
|
||||
console.log(e)
|
||||
screenHeight = e.windowHeight
|
||||
this.screenheight = {
|
||||
'height': screenHeight + 'px'
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
async useraccountlist() {
|
||||
let res = await this.api.useraccountlist()
|
||||
if (res.code = 1) {
|
||||
this.list = res.data
|
||||
}
|
||||
},
|
||||
async clickes(e) {
|
||||
if (e.store_id != this.storeid) {
|
||||
uni.login({
|
||||
provider: 'weixin',
|
||||
success: async (data) => {
|
||||
let res = await this.api.userautollogin({
|
||||
code: data.code,
|
||||
type: e.type,
|
||||
syb_m_id: e.syb_m_id,
|
||||
mobile: e.mobile,
|
||||
sign: uni.utils.md5('wgpdZW1YEqNlUuvJfrB2nkjRVOHIeC' + e.type + e
|
||||
.syb_m_id + e.mobile)
|
||||
})
|
||||
try {
|
||||
if (res.code == 1) {
|
||||
uni.cache.set('user', res.data.userinfo);
|
||||
uni.cache.set("token", res.data.userinfo.token);
|
||||
if (res.data.userinfo.group_id == 2) {
|
||||
uni.pro.switchTab('order/index')
|
||||
} else {
|
||||
setTimeout(res => {
|
||||
uni.reLaunch({
|
||||
url: '/pages/login/login'
|
||||
})
|
||||
}, 2000)
|
||||
}
|
||||
} else {
|
||||
setTimeout(res => {
|
||||
uni.reLaunch({
|
||||
url: '/pages/login/login'
|
||||
})
|
||||
}, 2000)
|
||||
}
|
||||
} catch (e) {
|
||||
setTimeout(res => {
|
||||
uni.reLaunch({
|
||||
url: '/pages/login/login'
|
||||
})
|
||||
}, 2000)
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
|
||||
background: #EDEDED;
|
||||
}
|
||||
|
||||
.index {
|
||||
height: 100%;
|
||||
|
||||
.index_text {
|
||||
font-size: 52rpx;
|
||||
font-family: SourceHanSansCN-Regular, SourceHanSansCN;
|
||||
font-weight: 400;
|
||||
color: #333333;
|
||||
margin-top: 220rpx;
|
||||
}
|
||||
|
||||
.index_box {
|
||||
padding: 0 48rpx;
|
||||
width: 100%;
|
||||
|
||||
.index_item {
|
||||
margin-top: 56rpx;
|
||||
width: 100%;
|
||||
padding: 40rpx 45rpx;
|
||||
background: #FFFFFF;
|
||||
border-radius: 44rpx;
|
||||
|
||||
.index_itemone {
|
||||
.index_itemoneimage {
|
||||
width: 114rpx;
|
||||
height: 114rpx;
|
||||
}
|
||||
|
||||
.flex-colum-start {
|
||||
margin-left: 32rpx;
|
||||
|
||||
.index_itemone_one {
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
width: 240rpx;
|
||||
font-size: 32rpx;
|
||||
font-family: SourceHanSansCN-Bold, SourceHanSansCN;
|
||||
font-weight: bold;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.index_itemone_tow {
|
||||
margin-top: 10rpx;
|
||||
font-size: 32rpx;
|
||||
font-family: SourceHanSansCN-Regular, SourceHanSansCN;
|
||||
font-weight: 400;
|
||||
color: #999999;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.index_itemonetext {
|
||||
font-size: 32rpx;
|
||||
font-family: SourceHanSansCN-Regular, SourceHanSansCN;
|
||||
font-weight: 400;
|
||||
color: #2F87FD;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
285
pages/shop/member.vue
Normal file
285
pages/shop/member.vue
Normal file
@@ -0,0 +1,285 @@
|
||||
<template>
|
||||
<view class="index">
|
||||
<view class="indextext">
|
||||
基本信息
|
||||
</view>
|
||||
<view class="content_item flex-between" @click="showsheetone = true">
|
||||
<view class="content_itemone">
|
||||
选择会员卡类型
|
||||
</view>
|
||||
<view class="content_itemtow flex-start">
|
||||
<!-- <view class="content_itemtow flex-start"> -->
|
||||
<text class="content_itemtow_text">{{showname}}</text>
|
||||
<u-icon name="arrow-right" color="#999999" size="18"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
<view class="content_itemecharge" v-if="showtypes ==1">
|
||||
<view class=" flex-start" v-for="(item,index) in recharge_amount" :key="index" style="margin-top: 10rpx;">
|
||||
<text>充值金额</text>
|
||||
<input type="number" v-model="recharge_amount[index].amount" :min='0' style="margin-left: 10rpx;">
|
||||
<text style="margin-left: 10rpx;">送</text>
|
||||
<input :min='0' type="number" v-model="recharge_amount[index].deliver" style="margin-left: 10rpx;">
|
||||
<text style="margin-left: 10rpx;color: #fff; padding:5rpx; border-radius: 10rpx; background: red;"
|
||||
@click="reducetext(index)">删除</text>
|
||||
</view>
|
||||
<!-- <view class="content_itemeabsolute" @click="add">
|
||||
<u-icon name="plus-circle" color="#2979ff" size="20"></u-icon>
|
||||
</view> -->
|
||||
</view>
|
||||
<view class="content_item flex-between" v-if="showtypes ==1">
|
||||
<view class="content_itemone">
|
||||
会员卡有效期
|
||||
</view>
|
||||
<view class="content_itemtow flex-start" v-if="showtypes ==1">
|
||||
<text class="content_itemtow_text">不限</text>
|
||||
<u-icon name="arrow-right" color="#999999" size="18"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
<view class="indextext" style="color: #666666;" v-if="showtypes ==1">
|
||||
<u--textarea v-model="show" placeholder="简单描述"></u--textarea>
|
||||
</view>
|
||||
<view class="baocun" @click="servicecreatevipbalabce" v-if="showtypes ==1">
|
||||
保存
|
||||
</view>
|
||||
<view class="content_item flex-between" v-if="showtypes ==2" v-for="(item,index) in listorder" :key="index"
|
||||
@click="content_itemonesitem(item)">
|
||||
<view class="content_itemones">
|
||||
{{item.title}}
|
||||
</view>
|
||||
<view class="content_itemtow flex-start">
|
||||
<text class="content_itemtow_text" style="color: red;">{{item.show}}</text>
|
||||
<u-icon name="arrow-right" color="#999999" size="18"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
<view class="contentfixed" @click="add" v-if="showtypes ==1">
|
||||
+
|
||||
</view>
|
||||
<view class="contentfixed" @click="content_itemonesitem" v-if="showtypes ==2">
|
||||
+
|
||||
</view>
|
||||
<u-action-sheet :actions="oneactionslist" :show="showsheetone" @select="selectClick"></u-action-sheet>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
show: '',
|
||||
showtypes: 1,
|
||||
showname: '充值卡',
|
||||
showsheetone: false,
|
||||
listorder: [],
|
||||
oneactionslist: [{
|
||||
name: '次卡',
|
||||
},
|
||||
{
|
||||
name: '充值卡', //开启后文字不显示
|
||||
}
|
||||
],
|
||||
recharge_amount: [{
|
||||
"amount": 100,
|
||||
"deliver": 10
|
||||
}]
|
||||
}
|
||||
},
|
||||
async onLoad() {
|
||||
try {
|
||||
this.serviceseccardlist()
|
||||
let res = await this.api.servicebalabceinfo()
|
||||
this.recharge_amount = res.data.recharge_amount
|
||||
this.show = res.data.show
|
||||
} catch (e) {
|
||||
//TODO handle the exception
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
this.serviceseccardlist()
|
||||
},
|
||||
methods: {
|
||||
selectClick(e) {
|
||||
console.log(e)
|
||||
if (e.name == '充值卡') {
|
||||
this.showtypes = 1
|
||||
} else {
|
||||
this.showtypes = 2
|
||||
}
|
||||
this.showname = e.name
|
||||
this.showsheetone = false
|
||||
},
|
||||
content_itemonesitem(e) {
|
||||
uni.pro.navigateTo('shop/secondarycard', {
|
||||
id: e.id
|
||||
})
|
||||
},
|
||||
reducetext(e) {
|
||||
if (this.recharge_amount.length < 2) {
|
||||
uni.showToast({
|
||||
title: '充值列表不能为空',
|
||||
icon: 'none'
|
||||
});
|
||||
return false
|
||||
}
|
||||
this.recharge_amount.splice(e, 1)
|
||||
},
|
||||
add() {
|
||||
if (this.recharge_amount.length > 19) {
|
||||
uni.showToast({
|
||||
title: '充值列表不能大于20条',
|
||||
icon: 'none'
|
||||
});
|
||||
return false
|
||||
}
|
||||
this.recharge_amount.push({
|
||||
"amount": 100,
|
||||
"deliver": 10
|
||||
})
|
||||
},
|
||||
async serviceseccardlist() {
|
||||
let res = await this.api.serviceseccardlist();
|
||||
this.listorder = res.data
|
||||
console.log(res.data)
|
||||
},
|
||||
async servicecreatevipbalabce(e) {
|
||||
if (this.recharge_amount == null || this.recharge_amount == '') {
|
||||
uni.showToast({
|
||||
title: '充值不能有空白',
|
||||
icon: 'none'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if (this.recharge_amount == null || this.recharge_amount == '') {
|
||||
uni.showToast({
|
||||
title: '请填写联系人',
|
||||
icon: 'none'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
let res = await this.api.servicecreatevipbalabce({
|
||||
recharge_amount: this.recharge_amount,
|
||||
show: this.show
|
||||
});
|
||||
if (res.code == 1) {
|
||||
uni.showToast({
|
||||
title: '保存成功',
|
||||
icon: 'none'
|
||||
});
|
||||
setTimeout(() => {
|
||||
uni.navigateBack();
|
||||
}, 1000);
|
||||
}
|
||||
},
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page {}
|
||||
|
||||
.index {
|
||||
.indextext {
|
||||
padding: 12rpx 24rpx;
|
||||
font-size: 28rpx;
|
||||
font-family: SourceHanSansCN-Bold, SourceHanSansCN;
|
||||
font-weight: bold;
|
||||
color: #6699FF;
|
||||
}
|
||||
|
||||
.baocun {
|
||||
margin: 40rpx auto;
|
||||
width: 90%;
|
||||
padding: 18rpx 0;
|
||||
background: #6699FF;
|
||||
text-align: center;
|
||||
border-radius: 16rpx;
|
||||
font-size: 32rpx;
|
||||
font-family: SourceHanSansCN-Regular, SourceHanSansCN;
|
||||
font-weight: 400;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
.content_itemecharge {
|
||||
width: 100%;
|
||||
position: relative;
|
||||
padding: 16rpx 46rpx;
|
||||
background: #F9F9F9;
|
||||
|
||||
.content_itemeabsolute {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 20rpx;
|
||||
}
|
||||
|
||||
.flex-start {
|
||||
text {
|
||||
font-size: 28rpx;
|
||||
font-family: SourceHanSansCN-Regular, SourceHanSansCN;
|
||||
font-weight: 400;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
input {
|
||||
width: 162rpx;
|
||||
height: 48rpx;
|
||||
background: #FFFFFF;
|
||||
border: 2rpx solid #D0CFCF;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.contentfixed {
|
||||
position: fixed;
|
||||
background: #2F87FD;
|
||||
bottom: 16%;
|
||||
right: 5%;
|
||||
font-size: 52rpx;
|
||||
color: #FFFFFF;
|
||||
width: 100rpx;
|
||||
height: 100rpx;
|
||||
line-height: 100rpx;
|
||||
text-align: center;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.content_item {
|
||||
width: 100%;
|
||||
padding: 16rpx 24rpx;
|
||||
border-bottom: 2rpx solid #E5E5E5;
|
||||
|
||||
.content_itemone::before {
|
||||
margin-left: 10px;
|
||||
content: '*';
|
||||
display: inline-block;
|
||||
font-size: 24rpx;
|
||||
font-family: SourceHanSansCN-Regular, SourceHanSansCN;
|
||||
font-weight: 400;
|
||||
color: #EE1717;
|
||||
}
|
||||
|
||||
.content_itemones {
|
||||
font-size: 24rpx;
|
||||
font-family: SourceHanSansCN-Regular, SourceHanSansCN;
|
||||
font-weight: 500;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.content_itemone {
|
||||
font-size: 28rpx;
|
||||
font-family: SourceHanSansCN-Regular, SourceHanSansCN;
|
||||
font-weight: 400;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.content_itemtow {
|
||||
font-size: 28rpx;
|
||||
|
||||
.content_itemtow_text {
|
||||
font-size: 28rpx;
|
||||
font-family: SourceHanSansCN-Regular, SourceHanSansCN;
|
||||
font-weight: 400;
|
||||
color: #333333;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
208
pages/shop/promotion.vue
Normal file
208
pages/shop/promotion.vue
Normal file
@@ -0,0 +1,208 @@
|
||||
<template>
|
||||
<view class="index">
|
||||
<view class="indextextbackground">
|
||||
<view class="indextext flex-colum">
|
||||
<view class="indextextone">
|
||||
分享到微信 提升店铺影响力
|
||||
</view>
|
||||
<image class="indextexttowimage" :src="src" @longpress="openimg" mode=""></image>
|
||||
<view class="indextextbox flex-center yks-sub1" @click="saveImg">
|
||||
<u-icon name="weixin-fill" color="#42ae3e" size="28"></u-icon>
|
||||
<text class="indextextboxtext">分享到微信</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
src: ''
|
||||
}
|
||||
},
|
||||
async onLoad() {
|
||||
let res = await this.api.usercreateminicode()
|
||||
this.src = res.data
|
||||
console.log(res.data)
|
||||
},
|
||||
onShow() {},
|
||||
methods: {
|
||||
openimg(e) {
|
||||
uni.previewImage({
|
||||
// 需要预览的图片链接列表
|
||||
urls:[this.src],
|
||||
// 为当前显示图片的链接/索引值
|
||||
current:[this.src],
|
||||
// 图片指示器样式
|
||||
indicator: 'default',
|
||||
// 是否可循环预览
|
||||
loop: false,
|
||||
// 长按图片显示操作菜单,如不填默认为保存相册
|
||||
// longPressActions:{
|
||||
// itemList:[this.l('发送给朋友'),this.l]
|
||||
// },
|
||||
success: res => {
|
||||
console.log('res', res);
|
||||
},
|
||||
fail: err => {
|
||||
console.log('err', err);
|
||||
}
|
||||
});
|
||||
},
|
||||
saveImg() {
|
||||
var this_ = this;
|
||||
//用户需要授权
|
||||
wx.getSetting({
|
||||
success: (res) => {
|
||||
if (!res.authSetting['scope.writePhotosAlbum']) {
|
||||
wx.authorize({
|
||||
scope: 'scope.writePhotosAlbum',
|
||||
success: () => { // 同意授权
|
||||
this.saveImg1();
|
||||
},
|
||||
fail: (res) => {
|
||||
//authorize:fail auth deny" 用户首次点拒绝
|
||||
//authorize:fail 系统错误,错误码:-12006,auth deny 用户点了拒绝后除非清缓存(用户删小程序),否则会默认这个选项
|
||||
//上述两个都要弹出引导说要授权相册
|
||||
var string = res.errMsg;
|
||||
if (string.indexOf("auth deny") >
|
||||
0
|
||||
) { //用户点了拒绝后,以后都会出现这个错误
|
||||
//c.handleSetting(c);
|
||||
wx.showModal({
|
||||
title: '提示',
|
||||
content: '保存图片失败,请点击下方去授权按钮开启相册访问权限再点击保存',
|
||||
showCancel: false,
|
||||
success(res) {
|
||||
if (res.confirm) {
|
||||
this_.setData({
|
||||
is_shouquan: 0
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this_.saveImg1();
|
||||
}
|
||||
},
|
||||
fail: (res) => {
|
||||
wx.showToast({
|
||||
title: res,
|
||||
icon: 'none',
|
||||
duration: 2000,
|
||||
})
|
||||
console.log(res);
|
||||
}
|
||||
})
|
||||
},
|
||||
saveImg1() {
|
||||
uni.downloadFile({
|
||||
url: this.src,
|
||||
success: (data) => {
|
||||
console.log(data)
|
||||
wx.showShareImageMenu({
|
||||
path: data.tempFilePath,
|
||||
success: (res) => {
|
||||
wx.showToast({
|
||||
title: '已成功!',
|
||||
icon: 'none',
|
||||
duration: 3000,
|
||||
});
|
||||
},
|
||||
})
|
||||
|
||||
},
|
||||
fail: (res) => {
|
||||
console.log(res)
|
||||
if (res.errMsg.indexOf('deny') != -1 || res.errMsg.indexOf('denied') != -1) {
|
||||
wx.showToast({
|
||||
title: '保存相册失败,请设置权限!',
|
||||
icon: 'none',
|
||||
duration: 2000,
|
||||
})
|
||||
|
||||
} else {
|
||||
wx.showToast({
|
||||
title: '保存相册失败,请重试!',
|
||||
icon: 'none',
|
||||
duration: 2000,
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
// uni.getimageinfo({
|
||||
// src: this.src,
|
||||
// success:(data)=>{
|
||||
// console.log(data)
|
||||
// wx.showShareImageMenu({
|
||||
// path: data.path
|
||||
// })
|
||||
// },
|
||||
|
||||
// })
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
background: #f5f5f5;
|
||||
}
|
||||
|
||||
.index {
|
||||
.indextextbackground {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 250rpx;
|
||||
padding: 28rpx 32rpx;
|
||||
border-bottom-left-radius: 35%;
|
||||
border-bottom-right-radius: 35%;
|
||||
background: #fec24d;
|
||||
|
||||
.indextext {
|
||||
width: 100%;
|
||||
margin-top: 40rpx;
|
||||
padding: 28rpx 0;
|
||||
justify-content: flex-start;
|
||||
border-radius: 20rpx;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.indextexttowimage {
|
||||
width: 400rpx;
|
||||
height: 400rpx;
|
||||
}
|
||||
|
||||
.indextextone {
|
||||
font-size: 28rpx;
|
||||
font-family: PingFang SC-Bold, PingFang SC;
|
||||
font-weight: bold;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.indextextbox {
|
||||
margin-top: 20rpx;
|
||||
border-radius: 50rpx;
|
||||
padding: 16rpx 0;
|
||||
text-align: center;
|
||||
width: 70%;
|
||||
background: linear-gradient(115deg, #ffe873 0%, #fec44f 100%);
|
||||
|
||||
.indextextboxtext {
|
||||
margin-left: 20rpx;
|
||||
font-size: 28rpx;
|
||||
font-family: PingFang SC-Bold, PingFang SC;
|
||||
font-weight: 400;
|
||||
color: #000;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
404
pages/shop/secondarycard.vue
Normal file
404
pages/shop/secondarycard.vue
Normal file
@@ -0,0 +1,404 @@
|
||||
<template>
|
||||
<view class="index">
|
||||
<view class="indextext">
|
||||
基本信息
|
||||
</view>
|
||||
<view class="onecontent">
|
||||
<view class="onecontent_item flex-between">
|
||||
<view class="onecontent_itemleft">
|
||||
标题
|
||||
</view>
|
||||
<view class="onecontent_itemright flex-start">
|
||||
<input class="onecontent_itemright_text" v-model="form.title" type="text" placeholder="请输入标题" />
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="onecontent_item flex-between">
|
||||
<view class="onecontent_itemleft">
|
||||
说明
|
||||
</view>
|
||||
<view class="onecontent_itemright flex-start">
|
||||
<input class="onecontent_itemright_text" v-model="form.show" type="text" placeholder="请输入说明" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="onecontent_item flex-between">
|
||||
<view class="onecontent_itemleft">
|
||||
价格
|
||||
</view>
|
||||
<view class="onecontent_itemright flex-start">
|
||||
<input class="onecontent_itemright_text" v-model="form.price" @input="checkNum(1,$event)"
|
||||
type="text" placeholder="请输入价格" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="onecontent_item flex-between">
|
||||
<view class="onecontent_itemleft">
|
||||
次数
|
||||
</view>
|
||||
<u-number-box integer v-model="form.frequ"></u-number-box>
|
||||
</view>
|
||||
<view @click="showsheetone = true" class="onecontent_item flex-between">
|
||||
<view class="onecontent_itemleft">
|
||||
会员卡有效期
|
||||
</view>
|
||||
<text>{{form.duration_str}}</text>
|
||||
<u-icon name="arrow-right" color="#999999" size="18"></u-icon>
|
||||
</view>
|
||||
<view @click="demos" class="onecontent_item flex-between">
|
||||
<view class="onecontent_itemleft">
|
||||
购买须知
|
||||
</view>
|
||||
<u-icon name="arrow-right" color="#999999" size="18"></u-icon>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
||||
<view class="baocun" @click="servicecreateseccard">
|
||||
保存
|
||||
</view>
|
||||
<u-action-sheet :actions="oneactionslist" :show="showsheetone" @select="selectClick"></u-action-sheet>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import editor from '@/components/editor/editor.vue';
|
||||
export default {
|
||||
components: {
|
||||
//引入项目组件
|
||||
editor
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
showsheetone: false,
|
||||
oneactionslist: [{
|
||||
id: 1,
|
||||
name: '一个月',
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
name: '半年', //开启后文字不显示
|
||||
}, {
|
||||
id: 3,
|
||||
name: '一年', //开启后文字不显示
|
||||
}
|
||||
],
|
||||
form: {
|
||||
frequ: 1
|
||||
},
|
||||
}
|
||||
},
|
||||
async onLoad(e) {
|
||||
let ress = await this.api.staffgetvipduratio();
|
||||
this.oneactionslist = ress.data
|
||||
if (e.id) {
|
||||
uni.setNavigationBarTitle({
|
||||
title: '修改次卡'
|
||||
})
|
||||
let res = await this.api.serviceseccarddesc({
|
||||
id: e.id
|
||||
});
|
||||
this.form = res.data
|
||||
} else {
|
||||
uni.setNavigationBarTitle({
|
||||
title: '添加次卡'
|
||||
})
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$bus.$on('showeditors', this.demo)
|
||||
},
|
||||
methods: {
|
||||
selectClick(e) {
|
||||
this.form.duration = e.id
|
||||
this.form.duration_str = e.name
|
||||
this.showsheetone = false
|
||||
},
|
||||
demo(data) {
|
||||
console.log(data)
|
||||
this.form.notice = data
|
||||
},
|
||||
demos() {
|
||||
uni.pro.navigateTo('shop/editor/editor', {
|
||||
id: this.form.id
|
||||
})
|
||||
},
|
||||
// 方法
|
||||
checkNum(a, e) {
|
||||
let val = e.target.value.replace(/(^\s*)|(\s*$)/g, "")
|
||||
console.log(val);
|
||||
if (!val) {
|
||||
this.form.price = '';
|
||||
return
|
||||
}
|
||||
var reg = /[^\d.]/g
|
||||
// 只能是数字和小数点,不能是其他输入
|
||||
val = val.replace(reg, "")
|
||||
// // 保证第一位只能是数字,不能是点
|
||||
val = val.replace(/^\./g, "");
|
||||
// // 小数只能出现1位
|
||||
val = val.replace(".", "$#$").replace(/\./g, "").replace("$#$", ".");
|
||||
// // 小数点后面保留2位
|
||||
val = val.replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3');
|
||||
console.log(val);
|
||||
this.$nextTick(() => {
|
||||
this.form.price = val;
|
||||
})
|
||||
},
|
||||
async servicecreateseccard() {
|
||||
if (this.form.title == null || this.form.title == '') {
|
||||
uni.showToast({
|
||||
title: '标题不能为空',
|
||||
icon: 'none'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if (this.form.show == null || this.form.show == '') {
|
||||
uni.showToast({
|
||||
title: '说明不能为空',
|
||||
icon: 'none'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if (this.form.price == null || this.form.price == '') {
|
||||
uni.showToast({
|
||||
title: '价格不能为空',
|
||||
icon: 'none'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if (this.form.frequ == null || this.form.frequ == '') {
|
||||
uni.showToast({
|
||||
title: '次数不能为空',
|
||||
icon: 'none'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if (this.form.notice == null || this.form.notice == '') {
|
||||
uni.showToast({
|
||||
title: '购买须知不能为空',
|
||||
icon: 'none'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
let res = await this.api.servicecreateseccard({
|
||||
title: this.form.title,
|
||||
show: this.form.show,
|
||||
price: this.form.price,
|
||||
frequ: this.form.frequ,
|
||||
notice: this.form.notice,
|
||||
id: this.form.id,
|
||||
duration:this.form.duration
|
||||
});
|
||||
if (res.code == 1) {
|
||||
uni.showToast({
|
||||
title: '保存成功',
|
||||
icon: 'none'
|
||||
});
|
||||
setTimeout(() => {
|
||||
uni.navigateBack();
|
||||
}, 1000);
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page {}
|
||||
|
||||
.index {
|
||||
.indextext {
|
||||
padding: 12rpx 24rpx;
|
||||
font-size: 28rpx;
|
||||
font-family: SourceHanSansCN-Bold, SourceHanSansCN;
|
||||
font-weight: bold;
|
||||
color: #6699FF;
|
||||
}
|
||||
|
||||
.baocun {
|
||||
margin: 40rpx auto;
|
||||
width: 90%;
|
||||
padding: 18rpx 0;
|
||||
background: #6699FF;
|
||||
text-align: center;
|
||||
border-radius: 16rpx;
|
||||
font-size: 32rpx;
|
||||
font-family: SourceHanSansCN-Regular, SourceHanSansCN;
|
||||
font-weight: 400;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
.content_item {
|
||||
width: 100%;
|
||||
padding: 16rpx 24rpx;
|
||||
border-bottom: 2rpx solid #E5E5E5;
|
||||
|
||||
.content_itemone::before {
|
||||
margin-left: 10px;
|
||||
content: '*';
|
||||
display: inline-block;
|
||||
font-size: 24rpx;
|
||||
font-family: SourceHanSansCN-Regular, SourceHanSansCN;
|
||||
font-weight: 400;
|
||||
color: #EE1717;
|
||||
}
|
||||
|
||||
.content_itemone {
|
||||
font-size: 28rpx;
|
||||
font-family: SourceHanSansCN-Regular, SourceHanSansCN;
|
||||
font-weight: 400;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.content_itemtow {
|
||||
font-size: 28rpx;
|
||||
|
||||
.content_itemtow_text {
|
||||
font-size: 28rpx;
|
||||
font-family: SourceHanSansCN-Regular, SourceHanSansCN;
|
||||
font-weight: 400;
|
||||
color: #333333;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.onecontent {
|
||||
background: #ffffff;
|
||||
|
||||
.onecontent_item {
|
||||
width: 100%;
|
||||
padding: 16rpx 46rpx;
|
||||
border-bottom: 2rpx solid #E5E5E5;
|
||||
|
||||
.onecontent_itemleft {
|
||||
flex: 1;
|
||||
font-size: 28rpx;
|
||||
font-family: SourceHanSansCN-Regular, SourceHanSansCN;
|
||||
font-weight: 400;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
.onecontent_itemright {
|
||||
flex: 3;
|
||||
|
||||
.onecontent_itemrighttext {
|
||||
font-size: 24rpx;
|
||||
font-family: SourceHanSansCN-Regular, SourceHanSansCN;
|
||||
font-weight: 400;
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
.onecontent_itemrightimges {
|
||||
width: 112rpx;
|
||||
height: 112rpx;
|
||||
background: #F5F5F5;
|
||||
border-radius: 10rpx;
|
||||
font-size: 40rpx;
|
||||
color: #878787;
|
||||
|
||||
image {
|
||||
width: 112rpx;
|
||||
height: 112rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.onecontent_itemright_text {
|
||||
width: 100%;
|
||||
font-size: 24rpx;
|
||||
font-family: SourceHanSansCN-Regular, SourceHanSansCN;
|
||||
font-weight: 400;
|
||||
color: #999999;
|
||||
}
|
||||
}
|
||||
|
||||
.flex-start {
|
||||
.fourcontent {
|
||||
.fourcontent_item {
|
||||
position: relative;
|
||||
margin-top: 16rpx;
|
||||
margin-left: 20rpx;
|
||||
width: 112rpx;
|
||||
height: 112rpx;
|
||||
border-radius: 16rpx;
|
||||
|
||||
image {
|
||||
width: 112rpx;
|
||||
height: 112rpx;
|
||||
border-radius: 16rpx;
|
||||
}
|
||||
|
||||
.fourcontent_itemtext {
|
||||
position: absolute;
|
||||
top: 0rpx;
|
||||
right: 0rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.onecontent {
|
||||
background: #ffffff;
|
||||
padding-bottom: 20rpx;
|
||||
|
||||
.onecontentscrolls {
|
||||
width: 564rpx;
|
||||
height: 190rpx;
|
||||
margin: 0 auto;
|
||||
border-radius: 10rpx;
|
||||
background: #f5f5f5;
|
||||
|
||||
.onecontentscrollsimage {
|
||||
width: 564rpx;
|
||||
height: 190rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.onecontentone {
|
||||
width: 694rpx;
|
||||
text-align: center;
|
||||
margin: 20rpx auto;
|
||||
background: #6699FF;
|
||||
border-radius: 16rpx;
|
||||
padding: 18rpx 0;
|
||||
font-size: 32rpx;
|
||||
font-family: SourceHanSansCN-Regular, SourceHanSansCN;
|
||||
font-weight: 400;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
.onecontentscrolllang {
|
||||
padding: 28rpx 20rpx;
|
||||
|
||||
.onecontentscroll_item {
|
||||
background: #f5f5f5;
|
||||
border-radius: 10rpx;
|
||||
width: 140rpx;
|
||||
height: 140rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.onecontentscroll {
|
||||
padding: 28rpx 20rpx;
|
||||
|
||||
.onecontentscroll_item {
|
||||
position: relative;
|
||||
|
||||
.onecontentscroll_itemimage {
|
||||
border-radius: 10rpx;
|
||||
width: 140rpx;
|
||||
height: 140rpx;
|
||||
}
|
||||
|
||||
.onecontentscrollicon {
|
||||
position: absolute;
|
||||
top: -10rpx;
|
||||
right: -10rpx;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
562
pages/shop/store.vue
Normal file
562
pages/shop/store.vue
Normal file
@@ -0,0 +1,562 @@
|
||||
<template>
|
||||
<view class="index">
|
||||
<view class="title_text">
|
||||
基本信息
|
||||
</view>
|
||||
<view class="onecontent">
|
||||
<view class="onecontent_item flex-between">
|
||||
<view class="onecontent_itemleft">
|
||||
门店logo
|
||||
</view>
|
||||
<view class="onecontent_itemright flex-start">
|
||||
<view class="onecontent_itemrightimges flex-colum" v-if="!form.avatar" @click="chooseImagelist()">
|
||||
+
|
||||
</view>
|
||||
<view v-else class="onecontent_itemrightimges flex-colum" @click="chooseImagelist()">
|
||||
<image :src="form.avatar"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="onecontent_item flex-between">
|
||||
<view class="onecontent_itemleft">
|
||||
门店名称
|
||||
</view>
|
||||
<view class="onecontent_itemright flex-start">
|
||||
<input class="onecontent_itemright_text" v-model="form.title" type="text" placeholder="请输入门店名称">
|
||||
</view>
|
||||
</view>
|
||||
<view class="onecontent_item flex-between">
|
||||
<view class="onecontent_itemleft">
|
||||
门店ID
|
||||
</view>
|
||||
<view class="onecontent_itemright flex-start">
|
||||
<input disabled class="onecontent_itemright_text" v-model="form.id" type="text" placeholder="001">
|
||||
</view>
|
||||
</view>
|
||||
<view class="onecontent_item flex-between">
|
||||
<view class="onecontent_itemleft">
|
||||
营业时间
|
||||
</view>
|
||||
<view class="onecontent_itemright flex-start" @click="showpicker = true">
|
||||
<text class="onecontent_itemright_text">{{form.b_hours || '请选择营业时间'}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="onecontent_item flex-between">
|
||||
<view class="onecontent_itemleft">
|
||||
联系人
|
||||
</view>
|
||||
<view class="onecontent_itemright flex-start">
|
||||
<input class="onecontent_itemright_text" v-model="form.contacts" type="text" placeholder="请输入联系人">
|
||||
</view>
|
||||
</view>
|
||||
<view class="onecontent_item flex-between">
|
||||
<view class="onecontent_itemleft">
|
||||
门店电话
|
||||
</view>
|
||||
<view class="onecontent_itemright flex-start">
|
||||
<input class="onecontent_itemright_text" v-model="form.mobile" type="text" placeholder="请输入门店电话">
|
||||
</view>
|
||||
</view>
|
||||
<view class="onecontent_item flex-between">
|
||||
<view class="onecontent_itemleft">
|
||||
详细地址
|
||||
</view>
|
||||
<view class="onecontent_itemright flex-start">
|
||||
<input class="onecontent_itemright_text" v-model="form.address" type="text" placeholder="请输入详细地址">
|
||||
</view>
|
||||
</view>
|
||||
<view class="onecontent_item flex-between">
|
||||
<view class="onecontent_itemleft">
|
||||
我的背景
|
||||
</view>
|
||||
<view class="onecontent_itemright flex-start">
|
||||
<view class="onecontent_itemrightimges flex-colum" v-if="!form.my_background"
|
||||
@click="chooseImagelists()">
|
||||
+
|
||||
</view>
|
||||
<view v-else class="onecontent_itemrightimges flex-colum" @click="chooseImagelists()">
|
||||
<image :src="form.my_background"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="title_text">
|
||||
上传图片
|
||||
</view>
|
||||
<view class="onecontent" style="margin-left: 26rpx;">
|
||||
<u-scroll-list :indicator="false">
|
||||
<view v-for="(item, index) in form.bananer" :key="index" class="onecontentscroll">
|
||||
<view class="onecontentscroll_item">
|
||||
<image class="onecontentscroll_itemimage" :src="item"></image>
|
||||
<view class="onecontentscrollicon" @click="remove(index)">
|
||||
<u-icon name="close-circle-fill" color="#333" size="20"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="onecontentscrolllang" v-if="form.bananer.length<10" @click="add()">
|
||||
<view class="onecontentscroll_item flex-colum">
|
||||
<u-icon name="plus" color="#333" size="20"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
</u-scroll-list>
|
||||
</view>
|
||||
<!-- <view class="onecontent_item flex-between" @click="chooseLocation">
|
||||
<view class="onecontent_itemleft">
|
||||
门店经纬度
|
||||
</view>
|
||||
<view class="onecontent_itemright flex-start">
|
||||
<input disabled class="onecontent_itemright_text" v-model="lnglat" type="text" placeholder="门店经纬度">
|
||||
</view>
|
||||
</view> -->
|
||||
</view>
|
||||
<view class="baocun" @click="userstoreset">
|
||||
保存
|
||||
</view>
|
||||
<u-picker :show="showpicker" @cancel='showpicker = false' ref="uPicker" :columns="columnspicker"
|
||||
@confirm="confirm"></u-picker>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import uploadImage from "@/js_sdk/yushijie-ossutil/ossutil/uploadFile.js";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
sheetshow: false,
|
||||
placeholder: '开始输入文章内容...',
|
||||
editorCtx: '',
|
||||
lnglat: '',
|
||||
showpicker: false,
|
||||
columnspicker: [
|
||||
['00:00', '01:00', '02:00', '03:00', '04:00', '05:00', '06:00', '07:00', '08:00', '09:00', '10:00',
|
||||
'11:00', '12:00', '13:00', '14:00', '15:00', '16:00', '17:00', '18:00', '19:00', '20:00',
|
||||
'21:00', '22:00', '23:00', '24:00'
|
||||
],
|
||||
['00:00', '01:00', '02:00', '03:00', '04:00', '05:00', '06:00', '07:00', '08:00', '09:00', '10:00',
|
||||
'11:00', '12:00', '13:00', '14:00', '15:00', '16:00', '17:00', '18:00', '19:00', '20:00',
|
||||
'21:00', '22:00', '23:00', '24:00'
|
||||
],
|
||||
],
|
||||
form: {
|
||||
title: '',
|
||||
details: '',
|
||||
avatar: '',
|
||||
my_background: '',
|
||||
b_hours: '',
|
||||
bananer: ''
|
||||
}
|
||||
}
|
||||
},
|
||||
async onLoad() {
|
||||
try {
|
||||
let res = await this.api.userstoredetail()
|
||||
this.form = res.data
|
||||
this.lnglat = res.data.lat + '-' + res.data.lng
|
||||
} catch (e) {
|
||||
//TODO handle the exception
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
|
||||
},
|
||||
mounted() {
|
||||
this.$bus.$on('editors', this.demo)
|
||||
},
|
||||
methods: {
|
||||
|
||||
confirm(e) {
|
||||
if (e.indexs[0] == e.indexs[1]) {
|
||||
uni.showToast({
|
||||
title: '选择时间不能相同'
|
||||
})
|
||||
} else {
|
||||
console.log(e)
|
||||
this.form.b_hours = e.value[0] + '-' + e.value[1]
|
||||
this.showpicker = false
|
||||
}
|
||||
},
|
||||
remove(e) {
|
||||
console.log(e)
|
||||
this.form.bananer.splice(e, 1)
|
||||
},
|
||||
add() {
|
||||
uni.showLoading({
|
||||
title: '上传中',
|
||||
mask: true
|
||||
})
|
||||
uni.chooseImage({
|
||||
count: 1, //默认9
|
||||
sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
|
||||
sourceType: ['album'], //从相册选择
|
||||
success: (res) => {
|
||||
let file = res.tempFilePaths[0];
|
||||
uploadImage(file, 'wechat/indexbananer/',
|
||||
result => {
|
||||
this.form.bananer.push(result)
|
||||
uni.hideLoading()
|
||||
}, result => {
|
||||
uni.hideLoading()
|
||||
})
|
||||
},
|
||||
fail: (res) => {
|
||||
uni.hideLoading()
|
||||
}
|
||||
});
|
||||
},
|
||||
chooseLocation() {
|
||||
uni.chooseLocation({
|
||||
success: (res) => {
|
||||
this.form.address = res.address
|
||||
this.form.lat = res.latitude
|
||||
this.form.lng = res.longitude
|
||||
this.lnglat = res.latitude + '-' + res.longitude
|
||||
console.log('位置名称:' + res.name);
|
||||
console.log('详细地址:' + res.address);
|
||||
console.log('纬度:' + res.latitude);
|
||||
console.log('经度:' + res.longitude);
|
||||
},
|
||||
fail: (res) => {
|
||||
console.log(res)
|
||||
}
|
||||
});
|
||||
},
|
||||
demo(data) {
|
||||
this.form.details = data
|
||||
},
|
||||
demos() {
|
||||
uni.pro.navigateTo('project/editor/editor', {
|
||||
id: this.form.service_id
|
||||
})
|
||||
},
|
||||
async userstoreset() {
|
||||
console.log(this.form)
|
||||
if (this.form.title == null || this.form.title == '') {
|
||||
uni.showToast({
|
||||
title: '商户名称不能为空',
|
||||
icon: 'none'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if (this.form.contacts == null || this.form.contacts == '') {
|
||||
uni.showToast({
|
||||
title: '请填写联系人',
|
||||
icon: 'none'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if (this.form.mobile == null || this.form.mobile == '') {
|
||||
uni.showToast({
|
||||
title: '手机号不能为空',
|
||||
icon: 'none'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if (this.form.address == null || this.form.address == '') {
|
||||
uni.showToast({
|
||||
title: '地址不能为空',
|
||||
icon: 'none'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if (this.form.avatar == null || this.form.avatar == '') {
|
||||
uni.showToast({
|
||||
title: '图片不能为空',
|
||||
icon: 'none'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
let res = await this.api.userstoreset({
|
||||
title: this.form.title,
|
||||
contacts: this.form.contacts,
|
||||
mobile: this.form.mobile,
|
||||
address: this.form.address,
|
||||
lng: this.form.lng,
|
||||
lat: this.form.lat,
|
||||
avatar: this.form.avatar,
|
||||
background: this.form.my_background,
|
||||
bananer: this.form.bananer.toString(),
|
||||
b_hours: this.form.b_hours
|
||||
});
|
||||
if (res.code == 1) {
|
||||
uni.showToast({
|
||||
title: '保存成功',
|
||||
icon: 'none'
|
||||
});
|
||||
setTimeout(() => {
|
||||
uni.navigateBack();
|
||||
}, 1000);
|
||||
}
|
||||
},
|
||||
async servicedelservice() {
|
||||
var this_ = this
|
||||
console.log(this.form.service_id)
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '确认删除该商品吗?',
|
||||
success: async (res) => {
|
||||
if (res.confirm) {
|
||||
let data = await this.api.servicedelservice({
|
||||
service_id: this.form.service_id
|
||||
});
|
||||
if (data.code == 1) {
|
||||
uni.showToast({
|
||||
title: '删除成功',
|
||||
icon: 'none'
|
||||
});
|
||||
setTimeout(() => {
|
||||
uni.navigateBack();
|
||||
}, 1000);
|
||||
}
|
||||
} else if (res.cancel) {
|
||||
console.log('用户点击取消');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
// 上传
|
||||
chooseImagelist() {
|
||||
uni.showLoading({
|
||||
title: '上传中',
|
||||
mask: true
|
||||
})
|
||||
uni.chooseImage({
|
||||
count: 1, //默认9
|
||||
sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
|
||||
sourceType: ['album'], //从相册选择
|
||||
success: (res) => {
|
||||
let file = res.tempFilePaths[0];
|
||||
uploadImage(file, 'wechat/store/',
|
||||
result => {
|
||||
this.form.avatar = ''
|
||||
this.form.avatar = result
|
||||
uni.hideLoading()
|
||||
}, result => {
|
||||
uni.hideLoading()
|
||||
})
|
||||
},
|
||||
fail: (res) => {
|
||||
uni.hideLoading()
|
||||
}
|
||||
});
|
||||
},
|
||||
// 上传
|
||||
chooseImagelists() {
|
||||
uni.showLoading({
|
||||
title: '上传中',
|
||||
mask: true
|
||||
})
|
||||
uni.chooseImage({
|
||||
count: 1, //默认9
|
||||
sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
|
||||
sourceType: ['album'], //从相册选择
|
||||
success: (res) => {
|
||||
let file = res.tempFilePaths[0];
|
||||
uploadImage(file, 'wechat/store/',
|
||||
result => {
|
||||
this.form.my_background = ''
|
||||
this.form.my_background = result
|
||||
uni.hideLoading()
|
||||
}, result => {
|
||||
uni.hideLoading()
|
||||
})
|
||||
},
|
||||
fail: (res) => {
|
||||
uni.hideLoading()
|
||||
}
|
||||
});
|
||||
},
|
||||
onEditorReady() {
|
||||
// #ifdef MP-BAIDU
|
||||
this.editorCtx = requireDynamicLib('editorLib').createEditorContext('editor');
|
||||
// #endif
|
||||
|
||||
// #ifdef APP-PLUS || H5 ||MP-WEIXIN
|
||||
uni.createSelectorQuery().select('#editor').context((res) => {
|
||||
this.editorCtx = res.context
|
||||
}).exec()
|
||||
// #endif
|
||||
},
|
||||
undo() {
|
||||
this.editorCtx.undo()
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
background: #F6F6F6;
|
||||
}
|
||||
|
||||
.index {
|
||||
.title_text {
|
||||
padding: 12rpx 40rpx;
|
||||
font-size: 28rpx;
|
||||
font-family: SourceHanSansCN-Regular, SourceHanSansCN;
|
||||
font-weight: 400;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
#editor {
|
||||
width: 100%;
|
||||
height: 456rpx;
|
||||
padding: 12rpx 40rpx;
|
||||
background: #FFFFFF;
|
||||
}
|
||||
|
||||
.baocun {
|
||||
margin: 40rpx auto;
|
||||
width: 90%;
|
||||
padding: 18rpx 0;
|
||||
background: #6699FF;
|
||||
text-align: center;
|
||||
border-radius: 16rpx;
|
||||
font-size: 32rpx;
|
||||
font-family: SourceHanSansCN-Regular, SourceHanSansCN;
|
||||
font-weight: 400;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
.onecontent {
|
||||
background: #ffffff;
|
||||
|
||||
.onecontent_item {
|
||||
width: 100%;
|
||||
padding: 16rpx 46rpx;
|
||||
border-bottom: 2rpx solid #E5E5E5;
|
||||
|
||||
.onecontent_itemleft {
|
||||
flex: 1;
|
||||
font-size: 28rpx;
|
||||
font-family: SourceHanSansCN-Regular, SourceHanSansCN;
|
||||
font-weight: 400;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
.onecontent_itemright {
|
||||
flex: 3;
|
||||
|
||||
.onecontent_itemrighttext {
|
||||
font-size: 24rpx;
|
||||
font-family: SourceHanSansCN-Regular, SourceHanSansCN;
|
||||
font-weight: 400;
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
.onecontent_itemrightimges {
|
||||
width: 112rpx;
|
||||
height: 112rpx;
|
||||
background: #F5F5F5;
|
||||
border-radius: 10rpx;
|
||||
font-size: 40rpx;
|
||||
color: #878787;
|
||||
|
||||
image {
|
||||
width: 112rpx;
|
||||
height: 112rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.onecontent_itemright_text {
|
||||
width: 100%;
|
||||
font-size: 24rpx;
|
||||
font-family: SourceHanSansCN-Regular, SourceHanSansCN;
|
||||
font-weight: 400;
|
||||
color: #999999;
|
||||
}
|
||||
}
|
||||
|
||||
.flex-start {
|
||||
.fourcontent {
|
||||
.fourcontent_item {
|
||||
position: relative;
|
||||
margin-top: 16rpx;
|
||||
margin-left: 20rpx;
|
||||
width: 112rpx;
|
||||
height: 112rpx;
|
||||
border-radius: 16rpx;
|
||||
|
||||
image {
|
||||
width: 112rpx;
|
||||
height: 112rpx;
|
||||
border-radius: 16rpx;
|
||||
}
|
||||
|
||||
.fourcontent_itemtext {
|
||||
position: absolute;
|
||||
top: 0rpx;
|
||||
right: 0rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.onecontent {
|
||||
background: #ffffff;
|
||||
padding-bottom: 20rpx;
|
||||
|
||||
.onecontentscrolls {
|
||||
width: 564rpx;
|
||||
height: 190rpx;
|
||||
margin: 0 auto;
|
||||
border-radius: 10rpx;
|
||||
background: #f5f5f5;
|
||||
|
||||
.onecontentscrollsimage {
|
||||
width: 564rpx;
|
||||
height: 190rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.onecontentone {
|
||||
width: 694rpx;
|
||||
text-align: center;
|
||||
margin: 20rpx auto;
|
||||
background: #6699FF;
|
||||
border-radius: 16rpx;
|
||||
padding: 18rpx 0;
|
||||
font-size: 32rpx;
|
||||
font-family: SourceHanSansCN-Regular, SourceHanSansCN;
|
||||
font-weight: 400;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
.onecontentscrolllang {
|
||||
padding: 28rpx 20rpx;
|
||||
|
||||
.onecontentscroll_item {
|
||||
background: #f5f5f5;
|
||||
border-radius: 10rpx;
|
||||
width: 140rpx;
|
||||
height: 140rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.onecontentscroll {
|
||||
padding: 28rpx 20rpx;
|
||||
|
||||
.onecontentscroll_item {
|
||||
position: relative;
|
||||
|
||||
.onecontentscroll_itemimage {
|
||||
border-radius: 10rpx;
|
||||
width: 140rpx;
|
||||
height: 140rpx;
|
||||
}
|
||||
|
||||
.onecontentscrollicon {
|
||||
position: absolute;
|
||||
top: -10rpx;
|
||||
right: -10rpx;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
</style>
|
||||
187
pages/shop/upload.vue
Normal file
187
pages/shop/upload.vue
Normal file
@@ -0,0 +1,187 @@
|
||||
<template>
|
||||
<view class="index">
|
||||
<view class="title_text">
|
||||
上传图片
|
||||
</view>
|
||||
<view class="onecontent">
|
||||
<u-scroll-list :indicator="false">
|
||||
<view v-for="(item, index) in list" :key="index" class="onecontentscroll">
|
||||
<view class="onecontentscroll_item">
|
||||
<image class="onecontentscroll_itemimage" :src="item"></image>
|
||||
<view class="onecontentscrollicon" @click="remove(index)">
|
||||
<u-icon name="close-circle-fill" color="#333" size="20"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="onecontentscrolllang" v-if="list.length<25" @click="add(1)">
|
||||
<view class="onecontentscroll_item flex-colum">
|
||||
<u-icon name="plus" color="#333" size="20"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
</u-scroll-list>
|
||||
</view>
|
||||
<view class="title_text">
|
||||
上传首页背景
|
||||
</view>
|
||||
<view class="onecontent" style="padding-top: 20rpx;">
|
||||
<view class="onecontentscrolls flex-colum">
|
||||
<image class="onecontentscrollsimage" @click="add(2)" v-if="background" :src="background" mode="">
|
||||
</image>
|
||||
<u-icon name="plus" v-else color="#333" size="20"></u-icon>
|
||||
|
||||
</view>
|
||||
<view class="onecontentone" @click="useruploadalbum">
|
||||
保存
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import uploadImage from "@/js_sdk/yushijie-ossutil/ossutil/uploadFile.js";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
background: "https://cdn.uviewui.com/uview/goods/1.jpg",
|
||||
list: ["https://cdn.uviewui.com/uview/goods/1.jpg", "https://cdn.uviewui.com/uview/goods/2.jpg"]
|
||||
}
|
||||
},
|
||||
async onLoad() {
|
||||
let res = await this.api.useralbumview()
|
||||
this.background = res.data.background
|
||||
this.list = res.data.album
|
||||
},
|
||||
onShow() {},
|
||||
methods: {
|
||||
remove(e) {
|
||||
this.list.splice(e, 1)
|
||||
},
|
||||
add(elang) {
|
||||
// 上传
|
||||
uni.showLoading({
|
||||
title: '上传中',
|
||||
mask: true
|
||||
})
|
||||
uni.chooseImage({
|
||||
count: 1, //默认9
|
||||
sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
|
||||
sourceType: ['album'], //从相册选择
|
||||
success: (res) => {
|
||||
let file = res.tempFilePaths[0];
|
||||
uploadImage(file, 'wechat/upload/',
|
||||
result => {
|
||||
if (elang == 1) {
|
||||
this.list.push(result)
|
||||
} else {
|
||||
this.background = result
|
||||
}
|
||||
uni.hideLoading()
|
||||
}, result => {
|
||||
uni.hideLoading()
|
||||
})
|
||||
},
|
||||
fail: (res) => {
|
||||
uni.hideLoading()
|
||||
}
|
||||
});
|
||||
},
|
||||
async useruploadalbum(e) { //上传相册
|
||||
console.log( this.list)
|
||||
let res = await this.api.useruploadalbum({
|
||||
album: this.list,
|
||||
background: this.background
|
||||
});
|
||||
console.log(res)
|
||||
if (res.code == 1) {
|
||||
uni.showToast({
|
||||
title: '保存成功',
|
||||
icon: 'none'
|
||||
});
|
||||
setTimeout(() => {
|
||||
uni.navigateBack()
|
||||
}, 1000);
|
||||
}
|
||||
},
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
background: #F6F6F6;
|
||||
}
|
||||
|
||||
.index {
|
||||
.title_text {
|
||||
padding: 12rpx 40rpx;
|
||||
font-size: 28rpx;
|
||||
font-family: SourceHanSansCN-Regular, SourceHanSansCN;
|
||||
font-weight: 400;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
.onecontent {
|
||||
background: #ffffff;
|
||||
padding-bottom: 20rpx;
|
||||
|
||||
.onecontentscrolls {
|
||||
width: 564rpx;
|
||||
height: 190rpx;
|
||||
margin: 0 auto;
|
||||
border-radius: 10rpx;
|
||||
background: #f5f5f5;
|
||||
|
||||
.onecontentscrollsimage {
|
||||
width: 564rpx;
|
||||
height: 190rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.onecontentone {
|
||||
width: 694rpx;
|
||||
text-align: center;
|
||||
margin: 20rpx auto;
|
||||
background: #6699FF;
|
||||
border-radius: 16rpx;
|
||||
padding: 18rpx 0;
|
||||
font-size: 32rpx;
|
||||
font-family: SourceHanSansCN-Regular, SourceHanSansCN;
|
||||
font-weight: 400;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
.onecontentscrolllang {
|
||||
padding: 50rpx 20rpx;
|
||||
|
||||
.onecontentscroll_item {
|
||||
background: #f5f5f5;
|
||||
border-radius: 10rpx;
|
||||
width: 140rpx;
|
||||
height: 140rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.onecontentscroll {
|
||||
padding: 50rpx 20rpx;
|
||||
|
||||
.onecontentscroll_item {
|
||||
position: relative;
|
||||
|
||||
.onecontentscroll_itemimage {
|
||||
border-radius: 10rpx;
|
||||
width: 140rpx;
|
||||
height: 140rpx;
|
||||
}
|
||||
|
||||
.onecontentscrollicon {
|
||||
position: absolute;
|
||||
top: -10rpx;
|
||||
right: -10rpx;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
395
pages/staff/add.vue
Normal file
395
pages/staff/add.vue
Normal file
@@ -0,0 +1,395 @@
|
||||
<template>
|
||||
<view class="content">
|
||||
|
||||
<view class="contentitem flex-between">
|
||||
<view class="contentitemtext">
|
||||
头像
|
||||
</view>
|
||||
<view class="onecontent_itemright flex-start">
|
||||
|
||||
<view class="onecontent_itemrightimges flex-colum" v-if="avatar" @click="chooseImagelist()">
|
||||
<image :src="avatar"></image>
|
||||
</view>
|
||||
<view class="onecontent_itemrightimges flex-colum" v-else @click="chooseImagelist()">
|
||||
+
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="contentitem flex-between">
|
||||
<text class="contentitemtext">姓名</text>
|
||||
<input class="contentiteminput" v-model="form.nickname" type="text" placeholder="请输入员工姓名">
|
||||
</view>
|
||||
<view class="contentitem flex-between" style="border-radius: 10rpx 10rpx 0 0 ;">
|
||||
<text class="contentitemtext">账号/手机号</text>
|
||||
<input class="contentiteminput" v-model="form.mobile" type="text" placeholder="请设置员工账号/手机号">
|
||||
</view>
|
||||
<view class="contentitem flex-between" style="border-radius: 10rpx 10rpx 0 0 ; margin-top:32rpx ;">
|
||||
<text class="contentitemtext">登录密码</text>
|
||||
<input class="contentiteminput" v-model="form.password" password="false" type="text" placeholder="员工登录密码">
|
||||
</view>
|
||||
<view v-if="staff_id" style="font-size: 24rpx; padding: 10rpx 0;">不修改密码请留空</view>
|
||||
<view class="contentitem flex-between" style="border-radius:0 0 10rpx 10rpx;">
|
||||
<text class="contentitemtext">确认密码</text>
|
||||
<input class="contentiteminput" password="false" v-model="form.passwords" type="text" placeholder="再次输入密码">
|
||||
</view>
|
||||
<view class="contentitem flex-between" style="border-radius:10rpx; margin-top:32rpx;"
|
||||
>
|
||||
<text class="contentitemtext">排序</text>
|
||||
<u-number-box integer v-model="form.sort"></u-number-box>
|
||||
</view>
|
||||
<view v-if="staff_id" class="positionfixed" @click="staffsavestaff">
|
||||
确认修改
|
||||
</view>
|
||||
<view v-else class="positionfixed" @click="staffcreatestaff">
|
||||
确认创建
|
||||
</view>
|
||||
<view class="positionfixeds" @click="staffdeletestaff">
|
||||
删除员工
|
||||
</view>
|
||||
<view class="contentitem flex-between" style="border-radius:10rpx; margin-top:32rpx;"
|
||||
@click="pickershow = true">
|
||||
<text class="contentitemtext">全部订单权限</text>
|
||||
<view class="flex-start">
|
||||
<view class="contentiteminput">{{nameis_limits}}</view>
|
||||
<u-icon name="arrow-right" color="#999999" size="18"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
<u-picker :show="pickershow" :columns="columns" @confirm='confirm' keyName="label"
|
||||
@cancel='pickershow = false'></u-picker>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import uploadImage from "@/js_sdk/yushijie-ossutil/ossutil/uploadFile.js";
|
||||
import {
|
||||
nextTick
|
||||
} from "vue";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
columns: [
|
||||
[{
|
||||
label: '允许',
|
||||
id: 1
|
||||
}, {
|
||||
label: '不允许',
|
||||
id: 2
|
||||
}],
|
||||
],
|
||||
pickershow: false,
|
||||
staff_id: '',
|
||||
avatar: '',
|
||||
nameis_limits: '允许',
|
||||
form: {
|
||||
nickname: '',
|
||||
mobile: '',
|
||||
store_id: '',
|
||||
password: '',
|
||||
passwords: "",
|
||||
sort: 1,
|
||||
is_limits: 1,
|
||||
avatar: ""
|
||||
}
|
||||
}
|
||||
},
|
||||
onLoad(e) {
|
||||
if (e.id) {
|
||||
uni.setNavigationBarTitle({
|
||||
title: '修改员工'
|
||||
})
|
||||
this.staff_id = e.id
|
||||
this.staffstaffreturn()
|
||||
} else {
|
||||
uni.setNavigationBarTitle({
|
||||
title: '添加员工'
|
||||
})
|
||||
}
|
||||
},
|
||||
onShow() {},
|
||||
methods: {
|
||||
async staffdeletestaff(){
|
||||
let res = await this.api.staffdeletestaff({
|
||||
staff_id:this.staff_id
|
||||
})
|
||||
if (res.code == 1) {
|
||||
uni.showToast({
|
||||
title: '删除成功',
|
||||
icon: 'none'
|
||||
});
|
||||
setTimeout(() => {
|
||||
uni.navigateBack();
|
||||
}, 2000);
|
||||
}
|
||||
},
|
||||
confirm(e) {
|
||||
this.pickershow = false
|
||||
this.form.is_limits = e.value[0].id
|
||||
this.nameis_limits = e.value[0].label
|
||||
console.log(e)
|
||||
},
|
||||
// 上传
|
||||
chooseImagelist() {
|
||||
uni.showLoading({
|
||||
title: '上传中',
|
||||
mask: true
|
||||
})
|
||||
uni.chooseImage({
|
||||
count: 1, //默认9
|
||||
sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
|
||||
sourceType: ['album'], //从相册选择
|
||||
success: (res) => {
|
||||
let file = res.tempFilePaths[0];
|
||||
uploadImage(file, 'wechat/staffadd/',
|
||||
result => {
|
||||
this.avatar = ''
|
||||
this.$nextTick(() => {
|
||||
this.form.avatar = result
|
||||
this.avatar = result
|
||||
uni.hideLoading()
|
||||
})
|
||||
}, result => {
|
||||
uni.hideLoading()
|
||||
})
|
||||
},
|
||||
fail: (res) => {
|
||||
uni.hideLoading()
|
||||
}
|
||||
});
|
||||
},
|
||||
async staffstaffreturn() { //员工信息回显
|
||||
let res = await this.api.staffstaffreturn({
|
||||
staff_id: this.staff_id,
|
||||
});
|
||||
if (res.code == 1) {
|
||||
this.form = res.data
|
||||
this.avatar = res.data.avatar
|
||||
if (this.form.is_limits == 1) {
|
||||
this.nameis_limits = '允许'
|
||||
} else {
|
||||
this.nameis_limits = '不允许'
|
||||
}
|
||||
}
|
||||
},
|
||||
async staffsavestaff() { //修改员工
|
||||
if (this.form.avatar == null || this.form.avatar == '') {
|
||||
uni.showToast({
|
||||
title: '请上传头像',
|
||||
icon: 'none'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if (this.form.nickname == null || this.form.nickname == '') {
|
||||
uni.showToast({
|
||||
title: '请输入姓名',
|
||||
icon: 'none'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if (this.form.mobile == null || this.form.mobile == '') {
|
||||
uni.showToast({
|
||||
title: '请输入电话/员工账号',
|
||||
icon: 'none'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if (this.form.password != null || this.form.passwords != '' || this.form.password != '' || this.form
|
||||
.passwords != null) {
|
||||
if (this.form.password != this.form.passwords) {
|
||||
uni.showToast({
|
||||
title: '两次输入密码不相同',
|
||||
icon: 'none'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (this.form.password != this.form.passwords) {
|
||||
uni.showToast({
|
||||
title: '两次输入密码不相同',
|
||||
icon: 'none'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if (this.form.sort == null || this.form.sort == '') {
|
||||
uni.showToast({
|
||||
title: '请输入排序',
|
||||
icon: 'none'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
let res = await this.api.staffsavestaff({
|
||||
nickname: this.form.nickname,
|
||||
mobile: this.form.mobile,
|
||||
staff_id: this.staff_id,
|
||||
sort: this.form.sort,
|
||||
is_limits:this.form.is_limits,
|
||||
avatar:this.form.avatar
|
||||
});
|
||||
if (res.code == 1) {
|
||||
uni.showToast({
|
||||
title: '修改成功',
|
||||
icon: 'none'
|
||||
});
|
||||
setTimeout(() => {
|
||||
uni.navigateBack();
|
||||
}, 2000);
|
||||
}
|
||||
},
|
||||
async staffcreatestaff() { //创建员工
|
||||
if (this.form.avatar == null || this.form.avatar == '') {
|
||||
uni.showToast({
|
||||
title: '请上传头像',
|
||||
icon: 'none'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if (this.form.nickname == null || this.form.nickname == '') {
|
||||
uni.showToast({
|
||||
title: '请输入姓名',
|
||||
icon: 'none'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if (this.form.mobile == null || this.form.mobile == '') {
|
||||
uni.showToast({
|
||||
title: '请输入电话/员工账号',
|
||||
icon: 'none'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if (this.form.password == null || this.form.password == '') {
|
||||
uni.showToast({
|
||||
title: '请输入密码',
|
||||
icon: 'none'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if (this.form.passwords == null || this.form.passwords == '') {
|
||||
uni.showToast({
|
||||
title: '请输入确认密码',
|
||||
icon: 'none'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if (this.form.password != this.form.passwords) {
|
||||
uni.showToast({
|
||||
title: '两次输入密码不相同',
|
||||
icon: 'none'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if (this.form.sort == null || this.form.sort == '') {
|
||||
uni.showToast({
|
||||
title: '请输入排序',
|
||||
icon: 'none'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
let res = await this.api.staffcreatestaff(this.form);
|
||||
if (res.code == 1) {
|
||||
uni.showToast({
|
||||
title: '创建成功',
|
||||
icon: 'none'
|
||||
});
|
||||
setTimeout(() => {
|
||||
uni.navigateBack();
|
||||
}, 2000);
|
||||
}
|
||||
},
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
background: #FBFBFA;
|
||||
}
|
||||
|
||||
.content {
|
||||
margin: 32rpx 28rpx;
|
||||
|
||||
.positionfixeds {
|
||||
position: fixed;
|
||||
width: 70%;
|
||||
bottom: 120rpx;
|
||||
left: 15%;
|
||||
padding: 10rpx 0;
|
||||
text-align: center;
|
||||
background: #d4d4d4;
|
||||
font-size: 36rpx;
|
||||
border-radius: 18rpx;
|
||||
font-family: SourceHanSansCN-Regular, SourceHanSansCN;
|
||||
font-weight: 400;
|
||||
color: #707070;
|
||||
}
|
||||
|
||||
.positionfixed {
|
||||
position: fixed;
|
||||
width: 70%;
|
||||
bottom: 40rpx;
|
||||
left: 15%;
|
||||
padding: 10rpx 0;
|
||||
text-align: center;
|
||||
background: #2F87FD;
|
||||
font-size: 36rpx;
|
||||
border-radius: 18rpx;
|
||||
font-family: SourceHanSansCN-Regular, SourceHanSansCN;
|
||||
font-weight: 400;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
.contentitem {
|
||||
width: 100%;
|
||||
padding: 12rpx 16rpx;
|
||||
border-bottom: 2rpx solid #E5E5E5;
|
||||
background: #FFFFFF;
|
||||
|
||||
.contentitemtext {
|
||||
font-size: 32rpx;
|
||||
font-family: SourceHanSansCN-Regular, SourceHanSansCN;
|
||||
font-weight: 400;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.onecontent_itemright {
|
||||
.onecontent_itemrighttext {
|
||||
font-size: 24rpx;
|
||||
font-family: SourceHanSansCN-Regular, SourceHanSansCN;
|
||||
font-weight: 400;
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
.onecontent_itemrightimges {
|
||||
width: 112rpx;
|
||||
height: 112rpx;
|
||||
background: #F5F5F5;
|
||||
border-radius: 10rpx;
|
||||
font-size: 40rpx;
|
||||
color: #878787;
|
||||
|
||||
image {
|
||||
width: 112rpx;
|
||||
height: 112rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.onecontent_itemright_text {
|
||||
width: 100%;
|
||||
font-size: 24rpx;
|
||||
font-family: SourceHanSansCN-Regular, SourceHanSansCN;
|
||||
font-weight: 400;
|
||||
color: #999999;
|
||||
}
|
||||
}
|
||||
|
||||
.contentiteminput {
|
||||
padding-left: 20rpx;
|
||||
text-align: right;
|
||||
flex: auto;
|
||||
font-size: 28rpx;
|
||||
font-family: SourceHanSansCN-Regular, SourceHanSansCN;
|
||||
font-weight: 400;
|
||||
color: #999999;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
204
pages/staff/createcap.vue
Normal file
204
pages/staff/createcap.vue
Normal file
@@ -0,0 +1,204 @@
|
||||
<template>
|
||||
<view class="index">
|
||||
<view class="title_text">
|
||||
创建分类
|
||||
</view>
|
||||
<view class="onecontent">
|
||||
<view class="onecontent_item flex-between">
|
||||
<view class="onecontent_itemleft">
|
||||
员工分类
|
||||
</view>
|
||||
<view class="onecontent_itemright flex-start">
|
||||
<input class="onecontent_itemright_text" v-model="name" maxlength="8" type="text"
|
||||
placeholder="请输入员工分类">
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="thereconse" @click="servicecreateitemclass">
|
||||
确定
|
||||
</view>
|
||||
<view class="title_text">
|
||||
管理分类
|
||||
</view>
|
||||
<view class="onecontent">
|
||||
<view class="onecontent_item flex-between" v-for="(item,index) in list" :key="index"
|
||||
@click="contentfixedclick(item)">
|
||||
<view class="onecontent_itemleft">
|
||||
{{item.name}}
|
||||
</view>
|
||||
<u-icon name="arrow-right" color="#333" size="20"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="list.length==0 && is_end == true" style="margin-top: 100rpx;width: 100%;" class="flex-colum">
|
||||
<image src="https://ointmentweapp.oss-cn-beijing.aliyuncs.com/image/my/order/nothave.png" mode="">
|
||||
</image>
|
||||
</view>
|
||||
<u-loadmore :status="form.status" />
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
name: '',
|
||||
list: [],
|
||||
is_end: false,
|
||||
form: {
|
||||
page: 1,
|
||||
status: 'loadmore',
|
||||
},
|
||||
}
|
||||
},
|
||||
onReachBottom() {
|
||||
this.shoppinggooodstype()
|
||||
},
|
||||
onShow() {
|
||||
this.init_fn()
|
||||
},
|
||||
methods: {
|
||||
init_fn() {
|
||||
this.list = []
|
||||
this.is_end = false
|
||||
this.form.page = 1
|
||||
this.form.status = 'loadmore'
|
||||
this.shoppinggooodstype()
|
||||
},
|
||||
async shoppinggooodstype() {
|
||||
let res = await this.api.staffemployee({
|
||||
page:this.form.page
|
||||
});
|
||||
if (res.code == 1) {
|
||||
if (res.data.length == 0) {
|
||||
this.is_end = true
|
||||
this.form.status = 'nomore'
|
||||
return false;
|
||||
} else {
|
||||
this.form.status = 'loading';
|
||||
this.form.page = ++this.form.page;
|
||||
setTimeout(() => {
|
||||
this.list = [...this.list, ...res.data];
|
||||
if (res.data.length == 10) {
|
||||
this.form.status = 'loading';
|
||||
} else {
|
||||
this.is_end = true;
|
||||
this.form.status = 'nomore';
|
||||
}
|
||||
}, 500)
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
contentfixedclick(e) {
|
||||
// let data = {
|
||||
// title: e.title,
|
||||
// goods_type_id: e.id
|
||||
// }
|
||||
uni.navigateTo({
|
||||
url: '/pages/staff/createcapinfo?name=' + e.name +'&goods_type_id='+ e.id
|
||||
});
|
||||
},
|
||||
async servicecreateitemclass() {
|
||||
let res = await this.api.staffemployeeadd({
|
||||
name: this.name,
|
||||
type: 1,
|
||||
id: ''
|
||||
});
|
||||
if (res.code == 1) {
|
||||
uni.showToast({
|
||||
title: '创建成功',
|
||||
icon: 'none'
|
||||
});
|
||||
setTimeout(() => {
|
||||
uni.navigateBack();
|
||||
}, 1000);
|
||||
}
|
||||
},
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
background: #F6F6F6;
|
||||
}
|
||||
|
||||
.index {
|
||||
.title_text {
|
||||
padding: 12rpx 40rpx;
|
||||
font-size: 28rpx;
|
||||
font-family: SourceHanSansCN-Regular, SourceHanSansCN;
|
||||
font-weight: 400;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
#editor {
|
||||
width: 100%;
|
||||
height: 456rpx;
|
||||
padding: 12rpx 40rpx;
|
||||
background: #FFFFFF;
|
||||
}
|
||||
|
||||
.onecontent {
|
||||
background: #ffffff;
|
||||
|
||||
.onecontent_item {
|
||||
width: 100%;
|
||||
padding: 16rpx 46rpx;
|
||||
border-bottom: 2rpx solid #E5E5E5;
|
||||
|
||||
.onecontent_itemleft {
|
||||
flex: 1;
|
||||
font-size: 28rpx;
|
||||
font-family: SourceHanSansCN-Regular, SourceHanSansCN;
|
||||
font-weight: 400;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
.onecontent_itemright {
|
||||
flex: 3;
|
||||
|
||||
.onecontent_itemrighttext {
|
||||
font-size: 24rpx;
|
||||
font-family: SourceHanSansCN-Regular, SourceHanSansCN;
|
||||
font-weight: 400;
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
.onecontent_itemrightimges {
|
||||
width: 112rpx;
|
||||
height: 112rpx;
|
||||
background: #F5F5F5;
|
||||
border-radius: 10rpx;
|
||||
font-size: 40rpx;
|
||||
color: #878787;
|
||||
}
|
||||
|
||||
.onecontent_itemright_text {
|
||||
width: 100%;
|
||||
font-size: 24rpx;
|
||||
font-family: SourceHanSansCN-Regular, SourceHanSansCN;
|
||||
font-weight: 400;
|
||||
color: #999999;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.thereconse {
|
||||
width: 630rpx;
|
||||
height: 80rpx;
|
||||
background: #999999;
|
||||
border-radius: 40rpx;
|
||||
font-size: 36rpx;
|
||||
text-align: center;
|
||||
margin: 50rpx auto;
|
||||
font-family: PingFang SC-Bold, PingFang SC;
|
||||
font-weight: bold;
|
||||
color: #FFFFFF;
|
||||
line-height: 80rpx;
|
||||
background: #6699FF;
|
||||
border-radius: 16rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
161
pages/staff/createcapinfo.vue
Normal file
161
pages/staff/createcapinfo.vue
Normal file
@@ -0,0 +1,161 @@
|
||||
<template>
|
||||
<view class="index">
|
||||
<view class="title_text">
|
||||
修改分类
|
||||
</view>
|
||||
<view class="onecontent">
|
||||
<view class="onecontent_item flex-between">
|
||||
<view class="onecontent_itemleft">
|
||||
员工分类
|
||||
</view>
|
||||
<view class="onecontent_itemright flex-start">
|
||||
<input class="onecontent_itemright_text" v-model="form.name" maxlength="8" type="text"
|
||||
placeholder="请输入员工分类">
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="thereconse" @click="servicecreateitemclass">
|
||||
确定
|
||||
</view>
|
||||
<view class="thereconse thereconsess" @click="shoppingdeletegoodstype">
|
||||
刪除
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
form: {
|
||||
name:'',
|
||||
goods_type_id:''
|
||||
},
|
||||
}
|
||||
},
|
||||
onLoad(e) {
|
||||
this.form.name = e.name
|
||||
this.form.goods_type_id = e.goods_type_id
|
||||
},
|
||||
methods: {
|
||||
async shoppingdeletegoodstype(){
|
||||
let res = await this.api.staffemployeedel({
|
||||
id:this.form.goods_type_id
|
||||
});
|
||||
if (res.code == 1) {
|
||||
uni.showToast({
|
||||
title: '删除成功',
|
||||
icon: 'none'
|
||||
});
|
||||
setTimeout(() => {
|
||||
uni.navigateBack();
|
||||
}, 1000);
|
||||
}
|
||||
},
|
||||
async servicecreateitemclass() {
|
||||
let res = await this.api.staffemployeeadd({
|
||||
name:this.form.name,
|
||||
type:2,
|
||||
id: this.form.goods_type_id
|
||||
});
|
||||
if (res.code == 1) {
|
||||
uni.showToast({
|
||||
title: '修改成功',
|
||||
icon: 'none'
|
||||
});
|
||||
setTimeout(() => {
|
||||
uni.navigateBack();
|
||||
}, 1000);
|
||||
}
|
||||
},
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
background: #F6F6F6;
|
||||
}
|
||||
|
||||
.index {
|
||||
.title_text {
|
||||
padding: 12rpx 40rpx;
|
||||
font-size: 28rpx;
|
||||
font-family: SourceHanSansCN-Regular, SourceHanSansCN;
|
||||
font-weight: 400;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
#editor {
|
||||
width: 100%;
|
||||
height: 456rpx;
|
||||
padding: 12rpx 40rpx;
|
||||
background: #FFFFFF;
|
||||
}
|
||||
|
||||
.onecontent {
|
||||
background: #ffffff;
|
||||
|
||||
.onecontent_item {
|
||||
width: 100%;
|
||||
padding: 16rpx 46rpx;
|
||||
border-bottom: 2rpx solid #E5E5E5;
|
||||
|
||||
.onecontent_itemleft {
|
||||
flex: 1;
|
||||
font-size: 28rpx;
|
||||
font-family: SourceHanSansCN-Regular, SourceHanSansCN;
|
||||
font-weight: 400;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
.onecontent_itemright {
|
||||
flex: 3;
|
||||
|
||||
.onecontent_itemrighttext {
|
||||
font-size: 24rpx;
|
||||
font-family: SourceHanSansCN-Regular, SourceHanSansCN;
|
||||
font-weight: 400;
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
.onecontent_itemrightimges {
|
||||
width: 112rpx;
|
||||
height: 112rpx;
|
||||
background: #F5F5F5;
|
||||
border-radius: 10rpx;
|
||||
font-size: 40rpx;
|
||||
color: #878787;
|
||||
}
|
||||
|
||||
.onecontent_itemright_text {
|
||||
width: 100%;
|
||||
font-size: 24rpx;
|
||||
font-family: SourceHanSansCN-Regular, SourceHanSansCN;
|
||||
font-weight: 400;
|
||||
color: #999999;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.thereconse {
|
||||
width: 630rpx;
|
||||
height: 80rpx;
|
||||
background: #999999;
|
||||
border-radius: 40rpx;
|
||||
font-size: 36rpx;
|
||||
text-align: center;
|
||||
margin: 50rpx auto;
|
||||
font-family: PingFang SC-Bold, PingFang SC;
|
||||
font-weight: bold;
|
||||
color: #FFFFFF;
|
||||
line-height: 80rpx;
|
||||
background: #6699FF;
|
||||
border-radius: 16rpx;
|
||||
}
|
||||
.thereconsess{
|
||||
background:#fc5f69;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
202
pages/staff/index.vue
Normal file
202
pages/staff/index.vue
Normal file
@@ -0,0 +1,202 @@
|
||||
<template>
|
||||
<view class="content">
|
||||
<view class="flex-start">
|
||||
<view class="onecontent_oen flex-start">
|
||||
<input class="onecontent_oen_input" type="text" v-model="like" placeholder="请输入员工姓名">
|
||||
<text class="onecontent_oen_text" @click="inif">搜索</text>
|
||||
</view>
|
||||
<view class="onecontent_oen_right flex-start" @click="showpickerclick">
|
||||
<view class="onecontent_oen_rightimageview">员工分类</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="towcontent">
|
||||
<view class="towcontentitem flex-between" v-for="(item,index) in list" :key="index"
|
||||
@click="contentfixedclick(item)">
|
||||
<view class="towcontentitem_one flex-colum-start">
|
||||
<text class="towcontentitem_onetext">{{item.nickname}}</text>
|
||||
<text class="towcontentitem_towtext">{{item.mobile}}</text>
|
||||
</view>
|
||||
<u-icon name="arrow-right" color="#999999" size="18"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="list.length==0 && is_end == true" class="flex-colum">
|
||||
<image style="margin-top:100rpx;"
|
||||
src="https://ointmentweapp.oss-cn-beijing.aliyuncs.com/image/my/order/nothave.png" mode="">
|
||||
</image>
|
||||
</view>
|
||||
<u-loadmore :status="form.status" />
|
||||
<view class="contentfixed" @click="contentfixedclick">
|
||||
+
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
list: [],
|
||||
is_end: false,
|
||||
like: '',
|
||||
form: {
|
||||
page: 1,
|
||||
status: 'loadmore',
|
||||
},
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
this.inif()
|
||||
},
|
||||
onReachBottom() {
|
||||
this.stafflist()
|
||||
},
|
||||
methods: {
|
||||
showpickerclick() {
|
||||
uni.pro.navigateTo('staff/createcap')
|
||||
},
|
||||
inif() {
|
||||
this.list = []
|
||||
this.is_end = false,
|
||||
this.form = {
|
||||
page: 1,
|
||||
status: 'loadmore',
|
||||
},
|
||||
this.stafflist()
|
||||
},
|
||||
contentfixedclick(e) {
|
||||
uni.pro.navigateTo('staff/add', {
|
||||
id: e.staff_id
|
||||
})
|
||||
},
|
||||
async stafflist() { //
|
||||
let res = await this.api.stafflist({
|
||||
like: this.like,
|
||||
page: this.form.page
|
||||
});
|
||||
if (res.code == 1) {
|
||||
if (res.data.length == 0) {
|
||||
this.is_end = true
|
||||
this.form.status = 'nomore'
|
||||
return false;
|
||||
} else {
|
||||
this.form.status = 'loading';
|
||||
this.form.page = ++this.form.page;
|
||||
setTimeout(() => {
|
||||
this.list = [...this.list, ...res.data];
|
||||
if (res.data.length == 10) {
|
||||
this.form.status = 'loading';
|
||||
} else {
|
||||
this.is_end = true;
|
||||
this.form.status = 'nomore';
|
||||
}
|
||||
}, 500)
|
||||
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
background: #FBFBFA;
|
||||
}
|
||||
|
||||
.content {
|
||||
margin: 28rpx 30rpx;
|
||||
position: relative;
|
||||
top: 0;
|
||||
right: 0;
|
||||
|
||||
.contentfixed {
|
||||
position: fixed;
|
||||
background: #2F87FD;
|
||||
bottom: 16%;
|
||||
right: 5%;
|
||||
font-size: 52rpx;
|
||||
color: #FFFFFF;
|
||||
width: 100rpx;
|
||||
height: 100rpx;
|
||||
line-height: 100rpx;
|
||||
text-align: center;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.flex-start {
|
||||
flex-wrap: nowrap;
|
||||
|
||||
.onecontent_oen {
|
||||
margin: 0 auto;
|
||||
flex: auto;
|
||||
height: 70rpx;
|
||||
border-radius: 36rpx;
|
||||
border: 2rpx solid #6699FF;
|
||||
padding-right: 8rpx;
|
||||
|
||||
.onecontent_oen_input {
|
||||
padding-left: 32rpx;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.onecontent_oen_text {
|
||||
font-size: 28rpx;
|
||||
font-family: PingFang SC-Regular, PingFang SC;
|
||||
font-weight: 400;
|
||||
color: #FFFFFF;
|
||||
text-align: center;
|
||||
line-height: 56rpx;
|
||||
width: 116rpx;
|
||||
height: 56rpx;
|
||||
background: #6699FF;
|
||||
border-radius: 36rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.onecontent_oen_right {
|
||||
margin-left: 26rpx;
|
||||
|
||||
.onecontent_oen_rightimage {
|
||||
width: 17.9rpx;
|
||||
height: 19.34rpx;
|
||||
}
|
||||
|
||||
.onecontent_oen_rightimageview {
|
||||
text-align: center;
|
||||
margin-left: 10rpx;
|
||||
font-size: 28rpx;
|
||||
font-family: PingFang SC-Regular, PingFang SC;
|
||||
font-weight: 400;
|
||||
color: #333333;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.towcontent {
|
||||
width: 100%;
|
||||
|
||||
.towcontentitem {
|
||||
margin-top: 30rpx;
|
||||
padding-bottom: 14rpx;
|
||||
border-bottom: 2rpx solid #E5E5E5;
|
||||
|
||||
.towcontentitem_one {
|
||||
font-size: 32rpx;
|
||||
font-family: SourceHanSansCN-Regular, SourceHanSansCN;
|
||||
font-weight: 400;
|
||||
color: #000000;
|
||||
}
|
||||
|
||||
.towcontentitem_towtext {
|
||||
margin-top: 10rpx;
|
||||
font-size: 24rpx;
|
||||
font-family: SourceHanSansCN-Regular, SourceHanSansCN;
|
||||
font-weight: 400;
|
||||
color: #999999;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
343
pages/stafflist/index.vue
Normal file
343
pages/stafflist/index.vue
Normal file
@@ -0,0 +1,343 @@
|
||||
<template>
|
||||
<view class="content">
|
||||
<view class="contentitem" v-for="(item,index) in list" :key="index">
|
||||
<view class="onecontentitem flex-start">
|
||||
<view class="onecontentitemone flex-colum-start">
|
||||
<image :src="item.user_avatar" mode=""></image>
|
||||
</view>
|
||||
<view class="onecontentitemtow flex-colum-start">
|
||||
<view class="onecontentitemtowone flex-start" @click="makePhoneCall(item.mobile)">
|
||||
<view class="onecontentitemtowone_text">
|
||||
{{item.user_nickname}}
|
||||
</view>
|
||||
<view class="onecontentitemtowone_phone">
|
||||
{{item.mobile.replace(/(\d{3})\d{4}(\d{4})/,'$1****$2')}}
|
||||
</view>
|
||||
<u-icon name="phone" color="#000" size="18"></u-icon>
|
||||
</view>
|
||||
<view class="onecontentitemtowtow">
|
||||
预约项目:{{item.title}}
|
||||
</view>
|
||||
<view class="onecontentitemtowthere">
|
||||
预约时间:{{item.time}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="onecontentitembox flex-center">
|
||||
<view class="onecontentitemboxone" @click="orderokprebook(item)"
|
||||
v-if="item.status == 2 || item.status == 0 ||item.status == 1">
|
||||
确认预约
|
||||
</view>
|
||||
<view style="background:#F9F9F9;color:#999999 ;" class="onecontentitemboxone" v-if="item.status == 3">
|
||||
已预约
|
||||
</view>
|
||||
<view class="onecontentitemboxtow" @click="orderrefuseprebook(item)">
|
||||
拒绝预约
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="contentfixed" @click="userlogout">
|
||||
<image src="@/static/exit.png" mode=""></image>
|
||||
</view>
|
||||
<view class="positionfixed flex-between">
|
||||
<view class="positionfixeditem flex-center positionfixeditems" @click="ange(1)">
|
||||
<u-icon name="list-dot" color="#2979ff" size="14"></u-icon>
|
||||
<text class="positionfixedtext">预约列表</text>
|
||||
</view>
|
||||
<view class="positionfixeditem flex-center" @click="ange(2)">
|
||||
<u-icon name="clock" color="#2979ff" size="14"></u-icon>
|
||||
<text class="positionfixedtext">修改时间</text>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="list.length==0 && is_end == true" class="flex-colum">
|
||||
<image style="margin-top:100rpx;"
|
||||
src="https://ointmentweapp.oss-cn-beijing.aliyuncs.com/image/my/order/nothave.png" mode="">
|
||||
</image>
|
||||
</view>
|
||||
<u-loadmore :status="form.status" />
|
||||
<view :style="{height:height}"></view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
height: '',
|
||||
list: [],
|
||||
is_end: false,
|
||||
form: {
|
||||
page: 1,
|
||||
status: 'loadmore',
|
||||
},
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
this.infn()
|
||||
},
|
||||
onLoad() {
|
||||
// #ifdef MP-WEIXIN
|
||||
wx.hideHomeButton()
|
||||
// #endif
|
||||
},
|
||||
mounted() {
|
||||
var query = uni.createSelectorQuery().in(this).select('.positionfixed')
|
||||
query.boundingClientRect(ele => {
|
||||
var that = this;
|
||||
uni.getSystemInfo({
|
||||
success(res) {
|
||||
that.height = ele.height + "px";
|
||||
that = null;
|
||||
}
|
||||
})
|
||||
}).exec();
|
||||
},
|
||||
onReachBottom() {
|
||||
this.orderreselist()
|
||||
},
|
||||
methods: {
|
||||
async userlogout() { //退出登录
|
||||
uni.showModal({
|
||||
title: '注意',
|
||||
content: '确定要退出登录吗?',
|
||||
success: async (res) => {
|
||||
console.log(111)
|
||||
if (res.confirm) {
|
||||
try {
|
||||
let data = await this.api.userlogout();
|
||||
console.log(data)
|
||||
if (data.code == 1) {
|
||||
uni.cache.clear();
|
||||
uni.reLaunch({
|
||||
url: '/pages/login/login'
|
||||
});
|
||||
}
|
||||
} catch (e) {
|
||||
//TODO handle the exception
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
infn() {
|
||||
this.list = []
|
||||
this.form = {
|
||||
page: 1,
|
||||
status: 'loadmore',
|
||||
},
|
||||
this.is_end = false
|
||||
this.orderreselist()
|
||||
},
|
||||
makePhoneCall(e) {
|
||||
uni.makePhoneCall({
|
||||
phoneNumber: e //仅为示例
|
||||
});
|
||||
},
|
||||
async orderokprebook(e) {
|
||||
let res = await this.api.orderokprebook({
|
||||
order_id: e.id
|
||||
})
|
||||
if (res.code == 1) {
|
||||
uni.showToast({
|
||||
title: '预约成功',
|
||||
icon: 'none'
|
||||
});
|
||||
this.infn()
|
||||
}
|
||||
},
|
||||
async orderrefuseprebook(e) {
|
||||
let res = await this.api.orderrefuseprebook({
|
||||
order_id: e.id,
|
||||
refuse_str: ''
|
||||
})
|
||||
if (res.code == 1) {
|
||||
uni.showToast({
|
||||
title: '拒绝成功',
|
||||
icon: 'none'
|
||||
});
|
||||
this.infn()
|
||||
}
|
||||
},
|
||||
async orderreselist() {
|
||||
let res = await this.api.orderreselist({
|
||||
page: this.form.page
|
||||
})
|
||||
if (res.code == 1) {
|
||||
if (res.data.length == 0) {
|
||||
this.is_end = true
|
||||
this.form.status = 'nomore'
|
||||
return false;
|
||||
} else {
|
||||
this.form.status = 'loading';
|
||||
this.form.page = ++this.form.page;
|
||||
setTimeout(() => {
|
||||
this.list = [...this.list, ...res.data];
|
||||
if (res.data.length == 10) {
|
||||
this.form.status = 'loading';
|
||||
} else {
|
||||
this.is_end = true;
|
||||
this.form.status = 'nomore';
|
||||
}
|
||||
}, 500)
|
||||
|
||||
}
|
||||
}
|
||||
},
|
||||
ange(w) {
|
||||
if (w == 1) {
|
||||
uni.reLaunch({
|
||||
url: '/pages/stafflist/index'
|
||||
})
|
||||
} else {
|
||||
uni.reLaunch({
|
||||
url: '/pages/stafflist/time'
|
||||
})
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
background: #F6F6F6;
|
||||
}
|
||||
|
||||
.content {
|
||||
padding: 32rpx 28rpx 0 28rpx;
|
||||
|
||||
.contentitem {
|
||||
width: 100%;
|
||||
padding: 24rpx 32rpx;
|
||||
background: #FFFFFF;
|
||||
border-radius: 12rpx;
|
||||
|
||||
.onecontentitem {
|
||||
height: 100%;
|
||||
|
||||
.onecontentitemone {
|
||||
height: 100%;
|
||||
justify-content: flex-start;
|
||||
|
||||
image {
|
||||
width: 72rpx;
|
||||
height: 72rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.onecontentitemtow {
|
||||
margin-left: 14rpx;
|
||||
height: 100%;
|
||||
|
||||
.onecontentitemtowone {
|
||||
.onecontentitemtowone_text {
|
||||
font-size: 32rpx;
|
||||
font-family: Source Han Sans CN-Regular, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.onecontentitemtowone_phone {
|
||||
margin: 0 15rpx;
|
||||
font-size: 28rpx;
|
||||
font-family: Roboto-Regular, Roboto;
|
||||
font-weight: 400;
|
||||
color: #999999;
|
||||
}
|
||||
}
|
||||
|
||||
.onecontentitemtowtow {
|
||||
font-size: 28rpx;
|
||||
font-family: Source Han Sans CN-Regular, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
.onecontentitemtowthere {
|
||||
font-size: 28rpx;
|
||||
font-family: Source Han Sans CN-Regular, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
color: #999999;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.onecontentitembox {
|
||||
margin-top: 32rpx;
|
||||
|
||||
.onecontentitemboxone {
|
||||
background: #2F87FD;
|
||||
padding: 16rpx 58rpx;
|
||||
border-radius: 8rpx;
|
||||
font-size: 28rpx;
|
||||
font-family: Source Han Sans CN-Medium, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
.onecontentitemboxtow {
|
||||
margin-left: 52rpx;
|
||||
padding: 16rpx 58rpx;
|
||||
border-radius: 8rpx;
|
||||
border: 2rpx solid #2F87FD;
|
||||
font-size: 28rpx;
|
||||
font-family: Source Han Sans CN-Medium, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
color: #2F87FD;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.contentfixed {
|
||||
position: fixed;
|
||||
bottom: 16%;
|
||||
right: 5%;
|
||||
font-size: 52rpx;
|
||||
color: #FFFFFF;
|
||||
|
||||
image {
|
||||
width: 100rpx;
|
||||
height: 100rpx;
|
||||
}
|
||||
|
||||
// width: 100rpx;
|
||||
// height: 100rpx;
|
||||
// line-height: 100rpx;
|
||||
// text-align: center;
|
||||
// border-radius: 50%;
|
||||
}
|
||||
|
||||
.positionfixed {
|
||||
position: fixed;
|
||||
background: #FFFFFF;
|
||||
width: 100%;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
padding: 15rpx;
|
||||
|
||||
.positionfixeditems::after {
|
||||
position: absolute;
|
||||
content: '';
|
||||
height: 50rpx;
|
||||
left: 50%;
|
||||
border-right: 1rpx solid #999;
|
||||
}
|
||||
|
||||
.positionfixeditem {
|
||||
padding: 20rpx 0;
|
||||
text-align: center;
|
||||
width: 50%;
|
||||
font-size: 28rpx;
|
||||
font-family: Source Han Sans CN-Regular, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
color: #333333;
|
||||
|
||||
.positionfixedtext {
|
||||
margin-left: 10rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
445
pages/stafflist/time.vue
Normal file
445
pages/stafflist/time.vue
Normal file
@@ -0,0 +1,445 @@
|
||||
<template>
|
||||
<view class="content">
|
||||
<view class="contentone">
|
||||
<view class="onecontenttowone flex-start">
|
||||
<view class="onecontenttowone_one">
|
||||
选择休息时间
|
||||
</view>
|
||||
</view>
|
||||
<view class="onecontenttowtow flex-between">
|
||||
<view class="onecontenttowtow_item flex-between">
|
||||
<view class=" flex-colum" v-for="(item,index) in reservationlist" :key="index"
|
||||
:class="reservationshow == index ? 'onecontenttowtow_item_ones':'onecontenttowtow_item_one'"
|
||||
@click="reservation(item,index)">
|
||||
<text class="onecontenttowtow_item_one_textone">{{item.week}}</text>
|
||||
<text class="onecontenttowtow_item_one_texttow">{{item.date.slice(5,10)}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="onecontenttowtow_left flex-colum" @click="calendarshow = true">
|
||||
<u-icon name="calendar" color="#b4b4b4" size="20"></u-icon>
|
||||
<text class="onecontenttowtow_lefttext">选择</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="onecontenttowthere flex-start">
|
||||
<view v-for="(item,index) in listday_time" :key="index" @click="clicktime(item,index)"
|
||||
:class="item.select?'onecontenttowthere_items':'onecontenttowthere_item'">
|
||||
{{item.time}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="contentone" style="margin-top: 40rpx;">
|
||||
<view class="onecontenttowone flex-start">
|
||||
<view class="onecontenttowone_one">
|
||||
我的休息时间
|
||||
</view>
|
||||
</view>
|
||||
<view class="onecontenttowthere flex-start">
|
||||
<view v-for="(item,index) in listday_xx" :key="index" class="onecontenttowthere_item">
|
||||
{{item.time}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="contentbox" @click="staffsavestaffhours">
|
||||
提交
|
||||
</view>
|
||||
<view class="positionfixed flex-between">
|
||||
<view class="positionfixeditem flex-center positionfixeditems" @click="ange(1)">
|
||||
<u-icon name="list-dot" color="#2979ff" size="14"></u-icon>
|
||||
<text class="positionfixedtext">预约列表</text>
|
||||
</view>
|
||||
<view class="positionfixeditem flex-center" @click="ange(2)">
|
||||
<u-icon name="clock" color="#2979ff" size="14"></u-icon>
|
||||
<text class="positionfixedtext">修改时间</text>
|
||||
</view>
|
||||
</view>
|
||||
<view :style="{height:height}"></view>
|
||||
<u-calendar mode="single" @confirm="confirm" :show="calendarshow" @close="calendarshow = false"></u-calendar>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
height: '',
|
||||
reservationshow: 0,
|
||||
reservationlist: [],
|
||||
calendarshow: false,
|
||||
listday_time: [],
|
||||
listday_xx: [],
|
||||
listday_xxxxx: [],
|
||||
day_time: '', //日期
|
||||
day_hour: '', //小时
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
// #ifdef MP-WEIXIN
|
||||
wx.hideHomeButton()
|
||||
// #endif
|
||||
this.confirm() //初始时间
|
||||
},
|
||||
onShow() {},
|
||||
mounted() {
|
||||
var query = uni.createSelectorQuery().in(this).select('.positionfixed')
|
||||
query.boundingClientRect(ele => {
|
||||
var that = this;
|
||||
uni.getSystemInfo({
|
||||
success(res) {
|
||||
that.height = ele.height + "px";
|
||||
that = null;
|
||||
}
|
||||
})
|
||||
}).exec();
|
||||
},
|
||||
methods: {
|
||||
ange(w) {
|
||||
if (w == 1) {
|
||||
uni.reLaunch({
|
||||
url: '/pages/stafflist/index'
|
||||
})
|
||||
} else {
|
||||
uni.reLaunch({
|
||||
url: '/pages/stafflist/time'
|
||||
})
|
||||
}
|
||||
},
|
||||
clicktime(d, p) {
|
||||
this.listday_time[p].select = !d.select
|
||||
let res = this.listday_time.filter((num, index) => {
|
||||
return num.select !== false
|
||||
})
|
||||
this.listday_xx = [...this.listday_xxxxx, ...res]
|
||||
},
|
||||
reservation(a, b) {
|
||||
this.reservationshow = b
|
||||
this.day_time = a.date
|
||||
this.staffbhoures() //获取预约时间
|
||||
},
|
||||
async staffsavestaffhours() { //提交
|
||||
let hours_str = this.listday_xx.map(ele => {
|
||||
return ele.time
|
||||
});
|
||||
let res = await this.api.staffsavestaffhours({
|
||||
day_time: this.day_time,
|
||||
hours_str: hours_str.toString()
|
||||
})
|
||||
if (res.code == 1) {
|
||||
uni.showToast({
|
||||
title: '修改成功',
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
|
||||
},
|
||||
async staffbhoures() {
|
||||
let res = await this.api.staffbhoures({
|
||||
day_time: this.day_time
|
||||
})
|
||||
this.listday_xxxxx = []
|
||||
if (res.length != 0) {
|
||||
this.listday_time = res.data.hours
|
||||
let dataxx = res.data.hours.filter((num, index) => {
|
||||
return num.select !== false
|
||||
})
|
||||
try {
|
||||
if (res.data.xx.split(",").length > dataxx.length) {
|
||||
this.listday_xxxxx = res.data.xx.split(",").slice(0, (res.data.xx.split(",").length -
|
||||
dataxx
|
||||
.length)).map(ele => {
|
||||
return {
|
||||
select: true,
|
||||
time: ele
|
||||
}
|
||||
});
|
||||
}
|
||||
} catch (e) {
|
||||
//TODO handle the exception
|
||||
}
|
||||
this.listday_xx = [...this.listday_xxxxx, ...dataxx]
|
||||
} else {
|
||||
this.listday_time = []
|
||||
}
|
||||
},
|
||||
confirm(e) {
|
||||
if (e) {
|
||||
this.calendarshow = false
|
||||
console.log(new Date(e[0]));
|
||||
var now = new Date(e[0]);
|
||||
} else {
|
||||
//获取当前年月日
|
||||
var now = new Date();
|
||||
// var year = now.getFullYear(); //得到年份
|
||||
// var month = now.getMonth() + 1; //得到月份
|
||||
// var date = now.getDate(); //得到日期
|
||||
// data = year + "年" + month + "月" + date + "日";
|
||||
}
|
||||
this.reservationlist = []
|
||||
for (let i = 0; i < 7; i++) {
|
||||
var date = new Date(now.getTime() + i * 24 * 3600 * 1000);
|
||||
var year = date.getFullYear();
|
||||
var month = (date.getMonth() + 1) > 9 ? (date.getMonth() + 1) : '0' + (date.getMonth() + 1);
|
||||
var day = (date.getDate()) > 9 ? (date.getDate()) : '0' + (date.getDate());
|
||||
var dt2 = new Date(now.getTime() + i * 24 * 3600 * 1000);
|
||||
var weekDay = ["周日", "周一", "周二", "周三", "周四", "周五", "周六"];
|
||||
// var weekDays = ["sun", "mon", "tue", "wed", "thu", "fri", "sat"];
|
||||
this.reservationlist.push({
|
||||
date: year + "-" + month + "-" + day,
|
||||
// date: month + "-" + day,
|
||||
// day: day,
|
||||
// weekday: weekDays[dt2.getDay()],
|
||||
week: weekDay[dt2.getDay()],
|
||||
});
|
||||
}
|
||||
this.day_time = this.reservationlist[0].date
|
||||
this.staffbhoures() //获取预约时间
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
background: #F6F6F6;
|
||||
}
|
||||
|
||||
.content {
|
||||
padding: 32rpx 28rpx 0 28rpx;
|
||||
|
||||
.contentbox {
|
||||
width: 80%;
|
||||
margin: 40rpx auto;
|
||||
padding: 24rpx 0;
|
||||
background: #2F87FD;
|
||||
font-size: 36rpx;
|
||||
font-family: PingFang SC-Bold, PingFang SC;
|
||||
font-weight: bold;
|
||||
color: #FFFFFF;
|
||||
text-align: center;
|
||||
border-radius: 48rpx;
|
||||
}
|
||||
|
||||
.contentone {
|
||||
background: #FFFFFF;
|
||||
border-radius: 24rpx;
|
||||
padding: 32rpx 28rpx;
|
||||
|
||||
.onecontenttowone {
|
||||
.onecontenttowone_one {
|
||||
font-family: Source Han Sans CN-Bold, Source Han Sans CN;
|
||||
font-size: 28rpx;
|
||||
font-weight: 500;
|
||||
color: #333333;
|
||||
}
|
||||
}
|
||||
|
||||
.onecontenttowtow {
|
||||
margin-top: 32rpx;
|
||||
|
||||
.onecontenttowtow_item {
|
||||
flex: 1;
|
||||
flex-wrap: nowrap;
|
||||
|
||||
.onecontenttowtow_item_one:nth-child(1) {
|
||||
margin: 0 !important;
|
||||
}
|
||||
|
||||
.onecontenttowtow_item_one {
|
||||
padding: 6rpx;
|
||||
|
||||
.onecontenttowtow_item_one_textone {
|
||||
font-size: 28rpx;
|
||||
font-family: Source Han Sans CN-Medium, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.onecontenttowtow_item_one_texttow {
|
||||
margin-top: 5rpx;
|
||||
font-size: 24rpx;
|
||||
font-family: Source Han Sans CN-Regular, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
color: #999999;
|
||||
}
|
||||
}
|
||||
|
||||
.onecontenttowtow_item_ones {
|
||||
padding: 6rpx;
|
||||
border-radius: 10rpx;
|
||||
background: #2f87fd;
|
||||
|
||||
.onecontenttowtow_item_one_textone {
|
||||
font-size: 28rpx;
|
||||
font-family: Source Han Sans CN-Medium, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
.onecontenttowtow_item_one_texttow {
|
||||
margin-top: 5rpx;
|
||||
font-size: 24rpx;
|
||||
font-family: Source Han Sans CN-Regular, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.onecontenttowtow_left {
|
||||
border-left: 1rpx solid #f9f9f9;
|
||||
background: #FFFFFF;
|
||||
padding-left: 24rpx;
|
||||
box-shadow: -2rpx 0px 4rpx 2rpx rgba(193, 193, 193, 0.09);
|
||||
|
||||
.onecontenttowtow_lefttext {
|
||||
font-size: 24rpx;
|
||||
font-family: Source Han Sans CN-Regular, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
color: #999999;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.onecontenttowthere {
|
||||
.onecontenttowthere_item {
|
||||
width: 20%;
|
||||
margin: 16rpx 2.5%;
|
||||
text-align: center;
|
||||
background: #F7F7F7;
|
||||
border-radius: 8rpx;
|
||||
border: 2rpx solid #F7F7F7;
|
||||
padding: 8rpx 26rpx;
|
||||
font-size: 28rpx;
|
||||
font-family: Source Han Sans CN-Medium, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
.onecontenttowthere_items {
|
||||
width: 20%;
|
||||
margin: 16rpx 2.5%;
|
||||
background: #FFFFFF;
|
||||
border: 2rpx solid #2F87FD;
|
||||
text-align: center;
|
||||
border-radius: 8rpx;
|
||||
padding: 8rpx 26rpx;
|
||||
font-size: 28rpx;
|
||||
font-family: Source Han Sans CN-Medium, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
color: #2F87FD;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.contentitem {
|
||||
width: 100%;
|
||||
padding: 24rpx 32rpx;
|
||||
background: #FFFFFF;
|
||||
border-radius: 12rpx;
|
||||
|
||||
.onecontentitem {
|
||||
height: 100%;
|
||||
|
||||
.onecontentitemone {
|
||||
height: 100%;
|
||||
justify-content: flex-start;
|
||||
|
||||
image {
|
||||
width: 72rpx;
|
||||
height: 72rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.onecontentitemtow {
|
||||
margin-left: 14rpx;
|
||||
height: 100%;
|
||||
|
||||
.onecontentitemtowone {
|
||||
.onecontentitemtowone_text {
|
||||
font-size: 32rpx;
|
||||
font-family: Source Han Sans CN-Regular, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.onecontentitemtowone_phone {
|
||||
font-size: 28rpx;
|
||||
font-family: Roboto-Regular, Roboto;
|
||||
font-weight: 400;
|
||||
color: #999999;
|
||||
}
|
||||
}
|
||||
|
||||
.onecontentitemtowtow {
|
||||
font-size: 28rpx;
|
||||
font-family: Source Han Sans CN-Regular, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
.onecontentitemtowthere {
|
||||
font-size: 28rpx;
|
||||
font-family: Source Han Sans CN-Regular, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
color: #999999;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.onecontentitembox {
|
||||
margin-top: 32rpx;
|
||||
|
||||
.onecontentitemboxone {
|
||||
background: #2F87FD;
|
||||
padding: 16rpx 58rpx;
|
||||
border-radius: 8rpx;
|
||||
font-size: 28rpx;
|
||||
font-family: Source Han Sans CN-Medium, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
.onecontentitemboxtow {
|
||||
margin-left: 52rpx;
|
||||
padding: 16rpx 58rpx;
|
||||
border-radius: 8rpx;
|
||||
border: 2rpx solid #2F87FD;
|
||||
font-size: 28rpx;
|
||||
font-family: Source Han Sans CN-Medium, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
color: #2F87FD;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.positionfixed {
|
||||
position: fixed;
|
||||
background: #FFFFFF;
|
||||
width: 100%;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
padding: 15rpx;
|
||||
|
||||
.positionfixeditems::after {
|
||||
position: absolute;
|
||||
content: '';
|
||||
height: 50rpx;
|
||||
left: 50%;
|
||||
border-right: 1rpx solid #999;
|
||||
}
|
||||
|
||||
.positionfixeditem {
|
||||
padding: 20rpx 0;
|
||||
text-align: center;
|
||||
width: 50%;
|
||||
font-size: 28rpx;
|
||||
font-family: Source Han Sans CN-Regular, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
color: #333333;
|
||||
|
||||
.positionfixedtext {
|
||||
margin-left: 10rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
29
pages/webview/html.vue
Normal file
29
pages/webview/html.vue
Normal file
@@ -0,0 +1,29 @@
|
||||
<template>
|
||||
<view class="content" v-html="src">
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
src: ''
|
||||
};
|
||||
},
|
||||
async onLoad(options) {
|
||||
let res = await this.api.useruserpolicy();
|
||||
if (options.src == 1) {
|
||||
//用户协议
|
||||
this.src = res.data.agreement
|
||||
} else {
|
||||
this.src = res.data.policy
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
.content {
|
||||
padding: 20rpx 30rpx;
|
||||
}
|
||||
</style>
|
||||
55
pages/webview/imge.vue
Normal file
55
pages/webview/imge.vue
Normal file
@@ -0,0 +1,55 @@
|
||||
<template>
|
||||
<view class="box flex-colum">
|
||||
<image src="@/static/logo.png" mode="widthFix"></image>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
imge: '',
|
||||
tyte: '',
|
||||
name: ''
|
||||
};
|
||||
},
|
||||
async onLoad(e) {
|
||||
this.name = e.name
|
||||
this.tyte = e.tyte
|
||||
this.imge = str;
|
||||
|
||||
},
|
||||
methods: {}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
background: #f9f9f9;
|
||||
}
|
||||
|
||||
v-deep {
|
||||
p {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.box {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
image{
|
||||
margin-top:120rpx;
|
||||
}
|
||||
.view {
|
||||
position: fixed;
|
||||
width: 50%;
|
||||
padding: 10rpx;
|
||||
text-align: center;
|
||||
bottom: 20rpx;
|
||||
margin: 0 auto;
|
||||
background: #3089fd;
|
||||
border-radius: 50rpx;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
16
pages/webview/webview.vue
Normal file
16
pages/webview/webview.vue
Normal file
@@ -0,0 +1,16 @@
|
||||
<template>
|
||||
<web-view :src="src"></web-view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
src: ''
|
||||
};
|
||||
},
|
||||
onLoad(options) {
|
||||
this.src = options.url;
|
||||
}
|
||||
};
|
||||
</script>
|
||||
Reference in New Issue
Block a user