首次提交

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

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

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

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

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

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

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