首次提交
This commit is contained in:
312
my/components/com-input.vue
Normal file
312
my/components/com-input.vue
Normal file
@@ -0,0 +1,312 @@
|
||||
<template>
|
||||
<view>
|
||||
<view class="mix-list-cell" :class="border" hover-class="cell-hover" :hover-stay-time="50">
|
||||
<text class="cell-tit">{{title}}</text>
|
||||
<input class="main-input" :value="value" :type="_type" placeholder-class="placeholder-class"
|
||||
:maxlength="maxlength" :placeholder="placeholder" :password="type==='password'&&!showPassword"
|
||||
@input="onInput" :disabled="readOnly" />
|
||||
|
||||
<!-- 是否可见密码 -->
|
||||
<image v-if="_isShowPass&&type==='password'&&!_isShowCode" class="img cuIcon"
|
||||
:class="showPassword?'cuIcon-attention':'cuIcon-attentionforbid'" @tap="showPass"></image>
|
||||
<!-- 倒计时 -->
|
||||
<view v-if="_isShowCode&&!_isShowPass" :class="['vercode',{'vercode-run': second>0}]" @click="setCode">
|
||||
{{ getVerCodeSecond }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
var _this, countDown;
|
||||
/**
|
||||
* 简单封装了下, 应用范围比较狭窄,可以在此基础上进行扩展使用
|
||||
* 比如加入image, iconSize可控等
|
||||
*/
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
showPassword: false, //是否显示明文
|
||||
second: 0, //倒计时
|
||||
isRunCode: false, //是否开始倒计时
|
||||
typeList: {
|
||||
left: 'icon-zuo',
|
||||
right: 'icon-you',
|
||||
up: 'icon-shang',
|
||||
down: 'icon-xia'
|
||||
},
|
||||
}
|
||||
},
|
||||
props: {
|
||||
readOnly: {
|
||||
//是否显示获取验证码(二选一)
|
||||
type: [Boolean, String],
|
||||
default: false,
|
||||
},
|
||||
type: String, //类型
|
||||
logo: String, //类型
|
||||
value: String, //值
|
||||
placeholder: String, //框内提示
|
||||
isShowCode: {
|
||||
//是否显示获取验证码(二选一)
|
||||
type: [Boolean, String],
|
||||
default: false,
|
||||
},
|
||||
codeText: {
|
||||
type: String,
|
||||
default: "获取验证码",
|
||||
},
|
||||
setTime: {
|
||||
//倒计时时间设置
|
||||
type: [Number, String],
|
||||
default: 60,
|
||||
},
|
||||
maxlength: {
|
||||
//最大长度
|
||||
type: [Number, String],
|
||||
default: 30,
|
||||
},
|
||||
isShowPass: {
|
||||
//是否显示密码图标(二选一)
|
||||
type: [Boolean, String],
|
||||
default: false,
|
||||
},
|
||||
icon: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
title: {
|
||||
type: String,
|
||||
default: '标题'
|
||||
},
|
||||
tips: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
navigateType: {
|
||||
type: String,
|
||||
default: 'right'
|
||||
},
|
||||
border: {
|
||||
type: String,
|
||||
default: 'b-b'
|
||||
},
|
||||
hoverClass: {
|
||||
type: String,
|
||||
default: 'cell-hover'
|
||||
},
|
||||
iconColor: {
|
||||
type: String,
|
||||
default: '#333'
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
_this = this
|
||||
//准备触发
|
||||
this.$on('runCodes', (val) => {
|
||||
this.runCodes(val);
|
||||
});
|
||||
clearInterval(countDown); //先清理一次循环,避免缓存
|
||||
},
|
||||
methods: {
|
||||
showPass() {
|
||||
//是否显示密码
|
||||
this.showPassword = !this.showPassword
|
||||
},
|
||||
onInput(e) {
|
||||
//传出值
|
||||
this.$emit('input', e.target.value)
|
||||
},
|
||||
setCode() {
|
||||
//设置获取验证码的事件
|
||||
if (this.isRunCode) {
|
||||
//判断是否开始倒计时,避免重复点击
|
||||
return false;
|
||||
}
|
||||
this.$emit('setCode')
|
||||
},
|
||||
runCodes(val) {
|
||||
console.error("runCodes")
|
||||
//开始倒计时
|
||||
if (String(val) == "0") {
|
||||
|
||||
//判断是否需要终止循环
|
||||
this.second = 0; //初始倒计时
|
||||
clearInterval(countDown); //清理循环
|
||||
this.isRunCode = false; //关闭循环状态
|
||||
return false;
|
||||
}
|
||||
if (this.isRunCode) {
|
||||
//判断是否开始倒计时,避免重复点击
|
||||
return false;
|
||||
}
|
||||
this.isRunCode = true
|
||||
this.second = this._setTime //倒数秒数
|
||||
|
||||
let _this = this;
|
||||
countDown = setInterval(function() {
|
||||
_this.second--
|
||||
if (_this.second == 0) {
|
||||
_this.isRunCode = false
|
||||
clearInterval(countDown)
|
||||
}
|
||||
}, 1000)
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
computed: {
|
||||
_type() {
|
||||
//处理值
|
||||
const type = this.type
|
||||
return type == 'password' ? 'text' : type
|
||||
},
|
||||
_isShowPass() {
|
||||
//处理值
|
||||
return String(this.isShowPass) !== 'false'
|
||||
},
|
||||
_isShowCode() {
|
||||
//处理值
|
||||
return String(this.isShowCode) !== 'false'
|
||||
},
|
||||
_setTime() {
|
||||
//处理值
|
||||
const setTime = Number(this.setTime)
|
||||
return setTime > 0 ? setTime : 60
|
||||
},
|
||||
getVerCodeSecond() {
|
||||
//验证码倒计时计算
|
||||
if (this.second <= 0) {
|
||||
return this.codeText;
|
||||
} else {
|
||||
if (this.second < 10) {
|
||||
return '0' + this.second + "s";
|
||||
} else {
|
||||
return this.second + "s";
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang='scss'>
|
||||
.main-input {
|
||||
flex: 1;
|
||||
text-align: left;
|
||||
/* color: white; */
|
||||
font-size: 16px;
|
||||
padding-right: 6px;
|
||||
margin-left: 10px;
|
||||
border: 1rpx solid #d9d9d9;
|
||||
height: 90rpx;
|
||||
border-radius: 10rpx;
|
||||
padding: 0px 10px;
|
||||
}
|
||||
|
||||
.icon .mix-list-cell.b-b:after {
|
||||
left: 45px;
|
||||
}
|
||||
|
||||
.placeholder-class {
|
||||
color: white;
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
.mix-list-cell {
|
||||
border-radius: 32upx;
|
||||
margin-top: 1px;
|
||||
font-size: 32upx;
|
||||
background: #ffffff;
|
||||
text-align: left;
|
||||
display: flex;
|
||||
margin: 32upx;
|
||||
/* padding: 24upx 32upx; */
|
||||
position: relative;
|
||||
|
||||
&.cell-hover {
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
&.b-b:after {
|
||||
left: 16px;
|
||||
}
|
||||
|
||||
.cell-icon {
|
||||
align-self: center;
|
||||
width: 28px;
|
||||
max-height: 30px;
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
.cell-more {
|
||||
align-self: center;
|
||||
font-size: 16px;
|
||||
color: #606266;
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
.cell-tit {
|
||||
width: 80px;
|
||||
font-size: 16px;
|
||||
/* color: white; */
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.cell-tip {
|
||||
font-size: 14px;
|
||||
color: white;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.items {
|
||||
position: absolute;
|
||||
height: 48px;
|
||||
width: 100%;
|
||||
background: #FFFFFF;
|
||||
/*opacity:0.05;*/
|
||||
}
|
||||
|
||||
.main-list {
|
||||
opacity: 0.8;
|
||||
z-index: 88;
|
||||
background: white;
|
||||
border: 1px solid white;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
height: 18px;
|
||||
/* Input 高度 */
|
||||
color: #333333;
|
||||
padding: 16px;
|
||||
margin-top: 12px;
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
.img {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.vercode {
|
||||
color: #e10a07;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.vercode-run {
|
||||
color: black !important;
|
||||
}
|
||||
|
||||
.oBorder {
|
||||
|
||||
border-radius: 2.5rem;
|
||||
-webkit-box-shadow: 0 0 30px 0 rgba(43, 86, 112, .1);
|
||||
box-shadow: 0 0 30px 0 rgba(43, 86, 112, .1);
|
||||
}
|
||||
</style>
|
||||
1226
my/components/watch-login/css/icon.css
Normal file
1226
my/components/watch-login/css/icon.css
Normal file
File diff suppressed because one or more lines are too long
109
my/components/watch-login/watch-button.vue
Normal file
109
my/components/watch-login/watch-button.vue
Normal file
@@ -0,0 +1,109 @@
|
||||
<template>
|
||||
<view>
|
||||
<!-- 按钮 -->
|
||||
<button :class="['buttonBorder',!_rotate?'dlbutton':'dlbutton_loading']" :style="{'background':bgColor, 'color': fontColor}">
|
||||
<view :class="_rotate?'rotate_loop':''">
|
||||
<text v-if="_rotate" class="cuIcon cuIcon-loading1 "></text>
|
||||
<text v-if="!_rotate">{{ text }}</text>
|
||||
</view>
|
||||
</button>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default{
|
||||
props:{
|
||||
text: String, //显示文本
|
||||
rotate:{
|
||||
//是否启动加载
|
||||
type: [Boolean,String],
|
||||
default: false,
|
||||
},
|
||||
bgColor:{
|
||||
//按钮背景颜色
|
||||
type: String,
|
||||
// default: "linear-gradient(to right, rgba(0,0,0,0.7), rgba(0,0,0,0.6))",
|
||||
},
|
||||
fontColor:{
|
||||
//按钮字体颜色
|
||||
type: String,
|
||||
default: "#000000",
|
||||
},
|
||||
},
|
||||
computed:{
|
||||
_rotate() {
|
||||
//处理值
|
||||
return String(this.rotate) !== 'false'
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
@import url("./css/icon.css");
|
||||
|
||||
.dlbutton {
|
||||
/* color: #FFFFFF; */
|
||||
font-size: 30upx;
|
||||
width:601upx;
|
||||
height:90upx;
|
||||
/* background: #352680; */
|
||||
background: #FCD202;
|
||||
box-shadow:0upx 0upx 13upx 0upx rgba(164,217,228,0.4);
|
||||
border-radius:2.5rem;
|
||||
line-height: 90upx;
|
||||
text-align: center;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
margin-top: 96upx;
|
||||
}
|
||||
.dlbutton_loading {
|
||||
color: #FFFFFF;
|
||||
font-size: 30upx;
|
||||
width:100upx;
|
||||
height:100upx;
|
||||
background: #5E81F9;
|
||||
box-shadow:0upx 0upx 13upx 0upx rgba(164,217,228,0.4);
|
||||
border-radius:2.5rem;
|
||||
line-height: 100upx;
|
||||
text-align: center;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
margin-top: 96upx;
|
||||
}
|
||||
.buttonBorder{
|
||||
border: none ;
|
||||
border-radius: 2.5rem ;
|
||||
-webkit-box-shadow: 0 0 60upx 0 rgba(0,0,0,.2) ;
|
||||
box-shadow: 0 0 60upx 0 rgba(0,0,0,.2) ;
|
||||
-webkit-transition: all 0.4s cubic-bezier(.57,.19,.51,.95);
|
||||
-moz-transition: all 0.4s cubic-bezier(.57,.19,.51,.95);
|
||||
-ms-transition: all 0.4s cubic-bezier(.57,.19,.51,.95);
|
||||
-o-transition: all 0.4s cubic-bezier(.57,.19,.51,.95);
|
||||
transition: all 0.4s cubic-bezier(.57,.19,.51,.95);
|
||||
}
|
||||
|
||||
/* 旋转动画 */
|
||||
.rotate_loop{
|
||||
-webkit-transition-property: -webkit-transform;
|
||||
-webkit-transition-duration: 1s;
|
||||
-moz-transition-property: -moz-transform;
|
||||
-moz-transition-duration: 1s;
|
||||
-webkit-animation: rotate 1s linear infinite;
|
||||
-moz-animation: rotate 1s linear infinite;
|
||||
-o-animation: rotate 1s linear infinite;
|
||||
animation: rotate 1s linear infinite;
|
||||
}
|
||||
@-webkit-keyframes rotate{from{-webkit-transform: rotate(0deg)}
|
||||
to{-webkit-transform: rotate(360deg)}
|
||||
}
|
||||
@-moz-keyframes rotate{from{-moz-transform: rotate(0deg)}
|
||||
to{-moz-transform: rotate(359deg)}
|
||||
}
|
||||
@-o-keyframes rotate{from{-o-transform: rotate(0deg)}
|
||||
to{-o-transform: rotate(359deg)}
|
||||
}
|
||||
@keyframes rotate{from{transform: rotate(0deg)}
|
||||
to{transform: rotate(359deg)}
|
||||
}
|
||||
</style>
|
||||
223
my/components/watch-login/watch-input.vue
Normal file
223
my/components/watch-login/watch-input.vue
Normal file
@@ -0,0 +1,223 @@
|
||||
<template>
|
||||
<view class="main-list oBorder">
|
||||
<!-- 文本框 -->
|
||||
<input
|
||||
class="main-input"
|
||||
:value="value"
|
||||
:type="_type"
|
||||
:maxlength="maxlength"
|
||||
:placeholder="placeholder"
|
||||
:password="type==='password'&&!showPassword"
|
||||
@input="onInput"
|
||||
/>
|
||||
<!-- 是否可见密码 -->
|
||||
<image
|
||||
v-if="_isShowPass&&type==='password'&&!_isShowCode"
|
||||
class="img cuIcon"
|
||||
:class="showPassword?'cuIcon-attention':'cuIcon-attentionforbid'"
|
||||
@tap="showPass"
|
||||
></image>
|
||||
<!-- 倒计时 -->
|
||||
<view
|
||||
v-if="_isShowCode&&!_isShowPass"
|
||||
:class="['vercode',{'vercode-run': second>0}]"
|
||||
@click="setCode"
|
||||
>{{ getVerCodeSecond }}</view>
|
||||
|
||||
|
||||
<view
|
||||
v-if="_isShowGet"
|
||||
class="vercode"
|
||||
@click="setNumberCode"
|
||||
>官方邀请码</view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
var _this, countDown;
|
||||
export default{
|
||||
data(){
|
||||
return{
|
||||
showPassword: false, //是否显示明文
|
||||
second: 0, //倒计时
|
||||
isRunCode: false, //是否开始倒计时
|
||||
}
|
||||
},
|
||||
props:{
|
||||
type: String, //类型
|
||||
value: String, //值
|
||||
placeholder: String, //框内提示
|
||||
maxlength: {
|
||||
//最大长度
|
||||
type: [Number,String],
|
||||
default: 20,
|
||||
},
|
||||
isShowPass:{
|
||||
//是否显示密码图标(二选一)
|
||||
type: [Boolean,String],
|
||||
default: false,
|
||||
},
|
||||
isShowCode:{
|
||||
//是否显示获取验证码(二选一)
|
||||
type: [Boolean,String],
|
||||
default: false,
|
||||
},
|
||||
isShowGet:{
|
||||
//是否显示获取验证码(二选一)
|
||||
type: [Boolean,String],
|
||||
default: false,
|
||||
},
|
||||
codeText:{
|
||||
type: String,
|
||||
default: "获取验证码",
|
||||
},
|
||||
setTime:{
|
||||
//倒计时时间设置
|
||||
type: [Number,String],
|
||||
default: 60,
|
||||
}
|
||||
},
|
||||
model: {
|
||||
prop: 'value',
|
||||
event: 'input'
|
||||
},
|
||||
mounted() {
|
||||
_this=this
|
||||
//准备触发
|
||||
this.$on('runCode',(val)=>{
|
||||
this.runCode(val);
|
||||
});
|
||||
clearInterval(countDown);//先清理一次循环,避免缓存
|
||||
},
|
||||
methods:{
|
||||
showPass(){
|
||||
//是否显示密码
|
||||
this.showPassword = !this.showPassword
|
||||
},
|
||||
onInput(e) {
|
||||
//传出值
|
||||
this.$emit('input', e.target.value)
|
||||
},
|
||||
setCode(){
|
||||
//设置获取验证码的事件
|
||||
if(this.isRunCode){
|
||||
//判断是否开始倒计时,避免重复点击
|
||||
return false;
|
||||
}
|
||||
this.$emit('setCode')
|
||||
},
|
||||
setNumberCode(){
|
||||
this.$emit('setNumberCode')
|
||||
},
|
||||
runCode(val){
|
||||
//开始倒计时
|
||||
if(String(val)=="0"){
|
||||
|
||||
//判断是否需要终止循环
|
||||
this.second = 0; //初始倒计时
|
||||
clearInterval(countDown);//清理循环
|
||||
this.isRunCode= false; //关闭循环状态
|
||||
return false;
|
||||
}
|
||||
if(this.isRunCode){
|
||||
//判断是否开始倒计时,避免重复点击
|
||||
return false;
|
||||
}
|
||||
this.isRunCode= true
|
||||
this.second = this._setTime //倒数秒数
|
||||
|
||||
let _this=this;
|
||||
countDown = setInterval(function(){
|
||||
_this.second--
|
||||
if(_this.second==0){
|
||||
_this.isRunCode= false
|
||||
clearInterval(countDown)
|
||||
}
|
||||
},1000)
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
computed:{
|
||||
_type(){
|
||||
//处理值
|
||||
const type = this.type
|
||||
return type == 'password' ? 'text' : type
|
||||
},
|
||||
_isShowPass() {
|
||||
//处理值
|
||||
return String(this.isShowPass) !== 'false'
|
||||
},
|
||||
_isShowCode() {
|
||||
//处理值
|
||||
return String(this.isShowCode) !== 'false'
|
||||
},
|
||||
_isShowGet() {
|
||||
//处理值
|
||||
return String(this.isShowGet) !== 'false'
|
||||
},
|
||||
_setTime() {
|
||||
//处理值
|
||||
const setTime = Number(this.setTime)
|
||||
return setTime>0 ? setTime : 60
|
||||
},
|
||||
getVerCodeSecond(){
|
||||
//验证码倒计时计算
|
||||
if(this.second<=0){
|
||||
return this.codeText;
|
||||
}else{
|
||||
if(this.second<10){
|
||||
return '0'+this.second;
|
||||
}else{
|
||||
return this.second;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
@import url("./css/icon.css");
|
||||
|
||||
.main-list{
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
height: 90upx; /* Input 高度 */
|
||||
color: #333333;
|
||||
padding: 32upx;
|
||||
margin-top:18upx;
|
||||
margin-bottom: 18upx;
|
||||
}
|
||||
.img{
|
||||
width: 32upx;
|
||||
height: 32upx;
|
||||
font-size: 32upx;
|
||||
}
|
||||
.main-input{
|
||||
flex: 1;
|
||||
text-align: left;
|
||||
font-size: 28upx;
|
||||
/* line-height: 100upx; */
|
||||
padding-right: 10upx;
|
||||
margin-left: 20upx;
|
||||
}
|
||||
.vercode {
|
||||
color: rgba(0,0,0,0.7);
|
||||
font-size: 24upx;
|
||||
line-height: 100upx;
|
||||
}
|
||||
.vercode-run {
|
||||
color: rgba(0,0,0,0.4) !important;
|
||||
}
|
||||
.oBorder{
|
||||
border: none;
|
||||
border-radius: 2.5rem ;
|
||||
-webkit-box-shadow: 0 0 60upx 0 rgba(43,86,112,.1) ;
|
||||
box-shadow: 0 0 60upx 0 rgba(43,86,112,.1) ;
|
||||
}
|
||||
</style>
|
||||
183
my/feedback/index.vue
Normal file
183
my/feedback/index.vue
Normal file
@@ -0,0 +1,183 @@
|
||||
<template>
|
||||
<view class="page" style="background-color: #ffffff;">
|
||||
<view class="feedback-title">
|
||||
<text>问题和意见</text>
|
||||
<text @tap="chooseMsg">快速键入</text>
|
||||
</view>
|
||||
<view class="feedback-body"><textarea placeholder="请详细描述你的问题和意见..." v-model="sendDate.feedbackMessage" class="feedback-textare" /></view>
|
||||
<view class="feedback-title"><text>QQ/邮箱</text></view>
|
||||
<view class="feedback-body"><input class="feedback-input" v-model="sendDate.userEmail" placeholder="方便我们联系你" /></view>
|
||||
|
||||
<button style="" class="feedback-submit" @tap="send">提交</button>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
msgContents: ['界面显示错乱', '启动缓慢,卡出翔了', 'UI无法直视,丑哭了', '偶发性崩溃'],
|
||||
stars: [1, 2, 3, 4, 5],
|
||||
imageList: [],
|
||||
sendDate: {
|
||||
score: 5,
|
||||
feedbackMessage: '',
|
||||
userEmail: ''
|
||||
}
|
||||
};
|
||||
},
|
||||
onLoad() {
|
||||
// let deviceInfo = {
|
||||
// appid: plus.runtime.appid,
|
||||
// imei: plus.device.imei, //设备标识
|
||||
// p: plus.os.name === 'Android' ? 'a' : 'i', //平台类型,i表示iOS平台,a表示Android平台。
|
||||
// md: plus.device.model, //设备型号
|
||||
// app_version: plus.runtime.version,
|
||||
// plus_version: plus.runtime.innerVersion, //基座版本号
|
||||
// os: plus.os.version,
|
||||
// net: '' + plus.networkinfo.getCurrentType()
|
||||
// };
|
||||
// this.sendDate = Object.assign(deviceInfo, this.sendDate);
|
||||
},
|
||||
methods: {
|
||||
close(e) {
|
||||
this.imageList.splice(e, 1);
|
||||
},
|
||||
chooseMsg() {
|
||||
//快速输入
|
||||
uni.showActionSheet({
|
||||
itemList: this.msgContents,
|
||||
success: res => {
|
||||
this.sendDate.feedbackMessage = this.msgContents[res.tapIndex];
|
||||
}
|
||||
});
|
||||
},
|
||||
chooseImg() {
|
||||
//选择图片
|
||||
uni.chooseImage({
|
||||
sourceType: ['camera', 'album'],
|
||||
sizeType: 'compressed',
|
||||
count: 8 - this.imageList.length,
|
||||
success: res => {
|
||||
this.imageList = this.imageList.concat(res.tempFilePaths);
|
||||
}
|
||||
});
|
||||
},
|
||||
chooseStar(e) {
|
||||
//点击评星
|
||||
this.sendDate.score = e;
|
||||
},
|
||||
previewImage() {
|
||||
//预览图片
|
||||
uni.previewImage({
|
||||
urls: this.imageList
|
||||
});
|
||||
},
|
||||
send() {
|
||||
//发送反馈
|
||||
console.log(JSON.stringify(this.sendDate));
|
||||
|
||||
if (!this.sendDate.feedbackMessage) {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: '请输入反馈内容'
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (!this.sendDate.userEmail) {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: '请填写QQ或邮箱'
|
||||
});
|
||||
return;
|
||||
}
|
||||
this.$queue.showLoading('加载中...');
|
||||
this.$Request.postJson('/app/shop/userFeedback', {
|
||||
shopId:uni.getStorageSync("shopId"),
|
||||
userEmail: this.sendDate.userEmail,
|
||||
feedbackMessage: this.sendDate.feedbackMessage,
|
||||
// state: 2
|
||||
}).then(res => {
|
||||
if (res.code === 0) {
|
||||
uni.showToast({
|
||||
title: '提交成功'
|
||||
});
|
||||
setTimeout(function() {
|
||||
uni.navigateBack();
|
||||
}, 1000);
|
||||
} else {
|
||||
uni.hideLoading();
|
||||
uni.showModal({
|
||||
showCancel: false,
|
||||
title: '提交失败',
|
||||
feedbackMessage: res.msg
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style>
|
||||
@font-face {
|
||||
font-family: uniicons;
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
src: url('https://img-cdn-qiniu.dcloud.net.cn/fonts/uni.ttf') format('truetype');
|
||||
}
|
||||
page {
|
||||
background-color: #F5F5F5 !important;
|
||||
}
|
||||
view {
|
||||
font-size: 28upx;
|
||||
}
|
||||
|
||||
|
||||
/*问题反馈*/
|
||||
.feedback-title {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 20upx;
|
||||
color: #8f8f94;
|
||||
font-size: 28upx;
|
||||
}
|
||||
.feedback-star-view.feedback-title {
|
||||
justify-content: flex-start;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.feedback-body {
|
||||
font-size: 32upx;
|
||||
padding: 16upx;
|
||||
margin: 16upx;
|
||||
border-radius: 16upx;
|
||||
background: #FFFFFF;
|
||||
/* color: #FFF; */
|
||||
}
|
||||
.feedback-textare {
|
||||
height: 200upx;
|
||||
font-size: 34upx;
|
||||
line-height: 50upx;
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
padding: 20upx 30upx 0;
|
||||
|
||||
}
|
||||
.feedback-input {
|
||||
font-size: 32upx;
|
||||
height: 60upx;
|
||||
/* padding: 15upx 20upx; */
|
||||
line-height: 60upx;
|
||||
}
|
||||
|
||||
|
||||
.feedback-submit {
|
||||
background: #FFCC00;
|
||||
/* color: #ffffff; */
|
||||
margin: 20upx;
|
||||
margin-top: 32upx;
|
||||
}
|
||||
</style>
|
||||
33
my/other/about.vue
Normal file
33
my/other/about.vue
Normal file
@@ -0,0 +1,33 @@
|
||||
<template>
|
||||
<view style="font-size: 14px;line-height: 26px;padding: 32upx;" class="bg-white">
|
||||
<view style="font-size: 28upx;" v-html="content" ></view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
content:''
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.getGuize();
|
||||
},
|
||||
methods: {
|
||||
getGuize(){
|
||||
this.$Request.getT('/app/common/type/286').then(res =>{
|
||||
if(res.code === 0){
|
||||
this.content = res.data.value;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
page {
|
||||
background: #FFF;
|
||||
}
|
||||
</style>
|
||||
482
my/other/cashDetail.vue
Normal file
482
my/other/cashDetail.vue
Normal file
@@ -0,0 +1,482 @@
|
||||
<template>
|
||||
<view class="cash">
|
||||
<view
|
||||
style="background-image: url('../../static/images/my/qanbaobg.png');background-size: 100%;height: 400upx;">
|
||||
<view style="font-size: 32upx;padding-top: 100upx;">可提现总额</view>
|
||||
<view style="font-size: 40upx;padding-top: 20upx;">¥ {{money}}</view>
|
||||
|
||||
<view
|
||||
style="width: 90%;height: max-content;margin-left: 40upx;background-color: #FFFFFF;box-shadow: rgba(183, 183, 183, 0.3) 0px 1px 10px;margin-top: 50upx;border-radius: 20upx;">
|
||||
<view style="display: flex;flex-direction: row;padding: 20upx;">
|
||||
<view style="font-size: 32upx;color: #333333;">提现金额 <text style="font-size: 28upx;color: #FF2638;"
|
||||
v-if="shouxufei">(注:提现手续费为{{shouxufei * 100}}%)</text>
|
||||
</view>
|
||||
</view>
|
||||
<view style="display: flex;flex-direction: row;padding: 20upx;">
|
||||
<view style="font-size: 40upx;color: #333333;">¥</view>
|
||||
<input type="text" v-model="moneys" placeholder="请输入金额"
|
||||
style="font-size: 40upx;color: #333333;text-align: left;margin-left: 10upx;width: 100%;" />
|
||||
</view>
|
||||
<view style="background: #E6E6E6;width: 100%;height: 1upx;"></view>
|
||||
|
||||
<view style="display: flex;flex-direction: row;flex-wrap: wrap;">
|
||||
<view style="display: flex;flex-direction: row;" v-for="(item, index) in moneyList" :key="index">
|
||||
<view>
|
||||
<view style="padding: 20upx;" @click="getOut(item.money)">
|
||||
<view
|
||||
style="padding-top: 40upx;width: 180upx; height: 120upx;background-color: #FFFFFF;border:1px solid #FFCC00;border-radius: 10upx;">
|
||||
{{ item.money }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view style="margin-top:59upx" class="padding-lr margin-lr-sm">
|
||||
<view class="flex justify-between margin-bottom-xl" v-for="(item,index) in openLists" :key="index">
|
||||
<view class="flex align-center">
|
||||
<image :src="item.image" style="width:23px;height:20px"></image>
|
||||
<text class="text-lg margin-left-sm" style="color:#333333;font-weight:700;">{{item.text}}</text>
|
||||
</view>
|
||||
<view>
|
||||
<radio-group name="openWay" style="margin-left: 20upx;" @tap='selectWay(item)'>
|
||||
<label class="tui-radio">
|
||||
<radio color="#FF7F00" :checked="openWay === item.id ? true : false" />
|
||||
</label>
|
||||
</radio-group>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view @click="getOut()"
|
||||
style="margin: 32upx;font-size: 18px;background: #FFCC00;border-radius: 10px;height: 40px;line-height: 40px">
|
||||
提现
|
||||
</view>
|
||||
|
||||
<view style="display: flex;width: 100%;justify-content: center;">
|
||||
<view style="color: grey;padding-bottom: 30px;padding-top: 20upx;flex: 1;" @click="goZhifuBao">提现账号
|
||||
</view>
|
||||
<view style="color: grey;padding-bottom: 30px;padding-top: 20upx;flex: 1;" @click="goqianbao">钱包明细
|
||||
</view>
|
||||
<view style="color: grey;padding-bottom: 30px;padding-top: 20upx;flex: 1;" @click="isShow">微信收款码
|
||||
</view>
|
||||
<view style="color: grey;padding-bottom: 30px;padding-top: 20upx;flex: 1;" @click="gojilu">提现记录
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 微信收款码弹框 -->
|
||||
<u-popup v-model="show" mode="center">
|
||||
<view class="padding">
|
||||
<view class="text-center text-lg text-bold flex justify-between">
|
||||
<view></view>
|
||||
<view>添加微信收款码</view>
|
||||
<view @click="show=false">X</view>
|
||||
</view>
|
||||
<!-- <view class="text-center padding-top-sm padding-bottom-lg" style="color: #999999;">请提交微信号和微信二维码
|
||||
</view> -->
|
||||
<view style="width: 80%;margin: 0 auto;">
|
||||
<view class="margin-top" @click.stop="weixin"
|
||||
style="border: 4rpx solid #010101;border-radius: 16rpx;overflow: hidden;">
|
||||
<image v-if="!wximg" src="../../static/images/my/erweima.png"></image>
|
||||
<image v-else :src="wximg" mode=""></image>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view class="text-center margin-top-sm " @click="submit"
|
||||
style="border-radius: 10rpx;background-color: #7E59FF;color: #fff;height: 80rpx;line-height: 80rpx;">保存</view> -->
|
||||
</view>
|
||||
</u-popup>
|
||||
<!-- <view v-if="show" class="popup">
|
||||
|
||||
</view> -->
|
||||
</view>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
show: false,
|
||||
money: '',
|
||||
moneys: '',
|
||||
zhifubao: '',
|
||||
mayMoney: '0',
|
||||
zhifubaoName: '',
|
||||
shouxufei: '',
|
||||
moneyList: [{
|
||||
money: '10'
|
||||
},
|
||||
{
|
||||
money: '20'
|
||||
},
|
||||
{
|
||||
money: '50'
|
||||
},
|
||||
{
|
||||
money: '100'
|
||||
},
|
||||
{
|
||||
money: '200'
|
||||
},
|
||||
{
|
||||
money: '500'
|
||||
}
|
||||
],
|
||||
value: 0,
|
||||
min: '',
|
||||
zhifubao: '',
|
||||
zhifubaoName: '',
|
||||
openLists: [],
|
||||
openWay: 1,
|
||||
values: '',
|
||||
wximg: ''
|
||||
};
|
||||
},
|
||||
onLoad() {
|
||||
this.getUserInfo()
|
||||
this.$Request.getT('/common/type/290').then(res => { //判断微信提现方式
|
||||
if (res.code == 0) {
|
||||
if (res.data && res.data.value) {
|
||||
this.values = res.data.value
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
//提现手续费
|
||||
this.$Request.getT('/common/type/115').then(res => {
|
||||
if (res.code === 0) {
|
||||
this.shouxufei = res.data.value;
|
||||
}
|
||||
});
|
||||
|
||||
this.openLists = [{
|
||||
image: '../../static/images/img/icon_weixin.png',
|
||||
text: '微信',
|
||||
id: 1
|
||||
}, {
|
||||
image: '../../static/images/img/zhifubao.png',
|
||||
text: '支付宝',
|
||||
id: 2
|
||||
}];
|
||||
this.openWay = 1;
|
||||
|
||||
},
|
||||
onShow: function(e) {
|
||||
this.getwalletMoney();
|
||||
this.getUserInfo()
|
||||
|
||||
|
||||
},
|
||||
onNavigationBarButtonTap() {
|
||||
this.list();
|
||||
},
|
||||
methods: {
|
||||
//用户收款码弹框
|
||||
isShow() {
|
||||
this.getUserInfo()
|
||||
this.show = true
|
||||
},
|
||||
|
||||
//微信 支付宝提现选择
|
||||
selectWay: function(item) {
|
||||
this.openWay = item.id;
|
||||
},
|
||||
//获取用户信息获取用户是否上传收款码
|
||||
getUserInfo() {
|
||||
this.$Request.getA("/sys/user/info").then(res => {
|
||||
if (res.code == 0) {
|
||||
this.zhifubao = res.user.userEntity.zhiFuBao
|
||||
this.zhifubaoName = res.user.userEntity.zhiFuBaoName
|
||||
this.wximg = res.user.userEntity.cashQrCode;
|
||||
// console.log(this.zhifubao, this.zhifubaoName, '-')
|
||||
}
|
||||
});
|
||||
},
|
||||
//获取账户余额
|
||||
getwalletMoney() {
|
||||
this.$Request.getT('/shop/shopmoney/selectShopMoney').then(res => {
|
||||
if (res.code == 0) {
|
||||
this.money = res.data.money;
|
||||
}
|
||||
uni.hideLoading();
|
||||
});
|
||||
},
|
||||
gojilu() {
|
||||
uni.navigateTo({
|
||||
url: '/my/other/moneydetail'
|
||||
});
|
||||
},
|
||||
goqianbao() {
|
||||
uni.navigateTo({
|
||||
url: '/my/other/cashList'
|
||||
});
|
||||
},
|
||||
|
||||
goZhifuBao() {
|
||||
uni.navigateTo({
|
||||
url: '/my/other/zhifubao'
|
||||
});
|
||||
},
|
||||
weixin() {
|
||||
let that = this
|
||||
uni.chooseImage({
|
||||
count: 1, //默认9
|
||||
sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
|
||||
sourceType: ['album', 'camera'], //从相册选择
|
||||
success: (res) => {
|
||||
console.log('`````````````', res)
|
||||
that.$queue.showLoading("上传中...");
|
||||
for (let i = 0; i < 1; i++) {
|
||||
uni.uploadFile({ // 上传接口
|
||||
url: 'https://tcwm.xianmaxiong.com/sqx_fast/alioss/upload', //真实的接口地址
|
||||
filePath: res.tempFilePaths[i],
|
||||
name: 'file',
|
||||
success: (uploadFileRes) => {
|
||||
let img = JSON.parse(uploadFileRes.data).data
|
||||
// let userId = that.$queue.getData('userId');
|
||||
let data = {
|
||||
cashQrCode: img
|
||||
}
|
||||
that.$Request.getA('/shop/shopmoney/shopBindingQrCode',
|
||||
data).then(
|
||||
res => {
|
||||
if (res.code == 0) {
|
||||
that.getUserInfo()
|
||||
setTimeout(function() {
|
||||
that.$queue.showToast('上传成功')
|
||||
}, 1000)
|
||||
}
|
||||
});
|
||||
uni.hideLoading();
|
||||
|
||||
|
||||
|
||||
// that.show = false
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
//校验用户输入金额
|
||||
checkMobile(money) {
|
||||
return RegExp(/^1[34578]\d{9}$/).test(money);
|
||||
},
|
||||
getOut(money) {
|
||||
let that = this
|
||||
if (money) {
|
||||
that.moneys = money
|
||||
}
|
||||
|
||||
if (!/^\d+$/.test(that.moneys)) {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: '请输入正确金额,不能包含中文,英文,特殊字符和小数'
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (that.openWay == 2) { //支付宝提现
|
||||
if (that.zhifubao != null && that.zhifubaoName != null) {
|
||||
uni.showModal({
|
||||
title: "提现申请提示",
|
||||
content: '请仔细确认收款人信息\n\n收款人姓名:' + that.zhifubaoName + '\n\n收款人账号:' + that.zhifubao +
|
||||
'\n\n提现金额:' + that.moneys + '元\t\t手续费:' + (that.moneys * that.shouxufei).toFixed(
|
||||
1),
|
||||
success: (e) => {
|
||||
if (e.confirm) {
|
||||
that.$queue.showLoading("提现中...");
|
||||
let data = {
|
||||
money: that.moneys,
|
||||
classify: '1'
|
||||
}
|
||||
that.$Request.getT('/shop/shopmoney/shopCashMoney', data).then(
|
||||
res => {
|
||||
if (res.status === 0 && res.data) {
|
||||
setTimeout(function() {
|
||||
that.$queue.showToast("提现申请成功,预计三个工作日到账");
|
||||
}, 3000)
|
||||
|
||||
that.getwalletMoney();
|
||||
} else {
|
||||
that.$queue.showToast(res.msg);
|
||||
that.getwalletMoney();
|
||||
}
|
||||
uni.hideLoading();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
uni.navigateTo({
|
||||
url: '/my/other/zhifubao'
|
||||
});
|
||||
}
|
||||
} else if (that.openWay == 1) { //微信提现
|
||||
if (that.values == 2) {
|
||||
that.$Request.getA('/sys/user/info').then(res => {
|
||||
if (res.code === 0) {
|
||||
let wxImg = res.user.userEntity.cashQrCode;
|
||||
if (!wxImg) {
|
||||
uni.showModal({
|
||||
title: '提现提示',
|
||||
content: '请上传微信收款码',
|
||||
showCancel: true,
|
||||
cancelText: '取消',
|
||||
confirmText: '上传',
|
||||
success: res => {
|
||||
if (res.confirm) {
|
||||
that.show = true
|
||||
}
|
||||
},
|
||||
fail: () => {},
|
||||
complete: () => {}
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (!/^\d+$/.test(that.moneys)) {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: '请输入正确金额,不能包含中文,英文,特殊字符和小数'
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
if (that.moneys * 1 >= that.value * 1) {
|
||||
uni.showModal({
|
||||
title: '提现申请提示',
|
||||
content: '金额:' + that.moneys + '元'+','+'手续费:' + (that.moneys *that.shouxufei).toFixed(1),
|
||||
success: e => {
|
||||
if (e.confirm) {
|
||||
that.$queue.showLoading('提现中...');
|
||||
let data = {
|
||||
money: that.moneys,
|
||||
classify: 2
|
||||
}
|
||||
that.$Request.getT('/shop/shopmoney/shopCashMoney',
|
||||
data).then(
|
||||
res => {
|
||||
if (res.code === 0) {
|
||||
setTimeout(function() {
|
||||
that.$queue.showToast(
|
||||
'提现申请成功,预计三个工作日到账');
|
||||
}, 1000)
|
||||
that.getwalletMoney();
|
||||
} else {
|
||||
uni.showModal({
|
||||
title: '温馨提示',
|
||||
content: res.msg,
|
||||
showCancel: false,
|
||||
cancelText: '取消',
|
||||
confirmText: '确认'
|
||||
});
|
||||
|
||||
}
|
||||
uni.hideLoading();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
setTimeout(function() {
|
||||
that.$queue.showToast('提现金额必须大于或等于' + that.value + '元才可提现');
|
||||
}, 1000)
|
||||
|
||||
}
|
||||
} else {
|
||||
that.$queue.showToast('网络状态不好,请刷新后重试!');
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
} else {
|
||||
if (!/^\d+$/.test(that.moneys)) {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: '请输入正确金额,不能包含中文,英文,特殊字符和小数'
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (parseFloat(that.moneys).toFixed(1) >= that.value) {
|
||||
uni.showModal({
|
||||
title: '提现申请提示',
|
||||
content: '金额:' + that.moneys + '元'+','+'手续费:' + parseFloat(that.moneys *
|
||||
that.shouxufei).toFixed(1),
|
||||
success: e => {
|
||||
if (e.confirm) {
|
||||
that.$queue.showLoading('提现中...');
|
||||
let data = {
|
||||
money: that.moneys,
|
||||
classify: 2
|
||||
}
|
||||
that.$Request.getT('/shop/shopmoney/shopCashMoney', data).then(
|
||||
res => {
|
||||
if (res.code === 0) {
|
||||
setTimeout(function() {
|
||||
that.$queue.showToast('提现申请成功,预计三个工作日到账');
|
||||
}, 1000)
|
||||
that.getwalletMoney();
|
||||
} else {
|
||||
uni.showModal({
|
||||
title: '温馨提示',
|
||||
content: res.msg,
|
||||
showCancel: false,
|
||||
cancelText: '取消',
|
||||
confirmText: '确认'
|
||||
});
|
||||
that.getwalletMoney();
|
||||
}
|
||||
uni.hideLoading();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
that.$queue.showToast('提现金额必须大于或等于' + that.value + '元才可提现');
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
// @import '../../static/css/index.css';
|
||||
|
||||
.view2-view-text {
|
||||
font-size: 14px;
|
||||
color: #000000;
|
||||
margin-left: 20upx;
|
||||
width: 80%;
|
||||
}
|
||||
|
||||
.view2-view-image-right {
|
||||
width: 18upx;
|
||||
height: 30upx;
|
||||
margin-left: 50upx;
|
||||
}
|
||||
|
||||
.cash {
|
||||
text-align: center;
|
||||
background: white;
|
||||
height: 100%;
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
|
||||
.cash-top {
|
||||
padding: 32upx 32upx 50upx 32upx;
|
||||
/* border-bottom: 1px solid gainsboro; */
|
||||
background: #FF2638;
|
||||
}
|
||||
|
||||
.leiji {
|
||||
font-size: 14px;
|
||||
color: #ffffff;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
129
my/other/cashList.vue
Normal file
129
my/other/cashList.vue
Normal file
@@ -0,0 +1,129 @@
|
||||
<template>
|
||||
<view>
|
||||
<view style="text-align: left;padding-bottom: 10rpx;">
|
||||
<view v-for="(item, index) in list" :key="index" class="item">
|
||||
<view>
|
||||
<!-- <view style="margin-bottom: 8upx;text-align: right;">
|
||||
<text v-if="item.type == 1" style="margin-bottom: 8upx;color: #ecd4b4">充值</text>
|
||||
<text v-if="item.type == 2" style="margin-bottom: 8upx;color: #ecd4b4">提现</text>
|
||||
</view> -->
|
||||
<view style="color: #999999;font-size: 28upx;">
|
||||
<view style="margin-bottom: 8upx">{{item.title}}</view>
|
||||
<!-- <view v-if="item.classify === 2" style="margin-bottom: 8upx"> 返佣类型:直属返佣</view> -->
|
||||
<!-- <view v-if="item.classify === 3" style="margin-bottom: 8upx"> 返佣类型:非直属支付</view> -->
|
||||
<view style="margin-bottom: 8upx">{{item.content}}</view>
|
||||
<view style="margin-bottom: 8upx"> 创建时间:{{item.createTime}}</view>
|
||||
<view style="margin-bottom: 8upx;text-align: right;">
|
||||
<text v-if="item.type == 1" style="color: #ecd4b4;font-size: 32upx;font-weight: 600"><text
|
||||
class="text-olive">+</text>¥{{item.money}}</text>
|
||||
<text v-if="item.type == 2" style="color: #ecd4b4;font-size: 32upx;font-weight: 600"><text
|
||||
class="text-red">-</text>¥{{item.money}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 加载更多提示 -->
|
||||
<!-- <view class="s-col is-col-24" v-if="list.length > 0">
|
||||
<load-more :loadingType="loadingType" :contentText="contentText"></load-more>
|
||||
</view> -->
|
||||
<!-- 加载更多提示 -->
|
||||
<!-- <empty v-if="list.length === 0" des="暂无明细数据" show="false"></empty> -->
|
||||
<empty v-if="list.length == 0" content="暂无明细"></empty>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import empty from '@/components/empty.vue'
|
||||
export default {
|
||||
components: {
|
||||
empty
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
list: [],
|
||||
page: 1,
|
||||
limit: 10,
|
||||
tabIndex: 1,
|
||||
checkReZhiShu: '否',
|
||||
checkReTuanZhang: '否',
|
||||
checkReFeiZhiShu: '否',
|
||||
scrollTop: false,
|
||||
contentText: {
|
||||
contentdown: '上拉显示更多',
|
||||
contentrefresh: '正在加载...',
|
||||
contentnomore: '没有更多数据了'
|
||||
}
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.$queue.showLoading("加载中...");
|
||||
this.getList();
|
||||
},
|
||||
onPageScroll: function(e) {
|
||||
this.scrollTop = e.scrollTop > 200;
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
let data = {
|
||||
page: this.page,
|
||||
limit: this.limit,
|
||||
classify: 3,
|
||||
type:''
|
||||
}
|
||||
this.$Request.getT('/shop/shopmoney/selectShopMoneydetails', data).then(res => {
|
||||
if (res.code === 0) {
|
||||
if (this.page === 1) {
|
||||
this.list = res.data.records;
|
||||
} else {
|
||||
this.list = [...this.list, ...res.data.records];
|
||||
}
|
||||
}
|
||||
uni.stopPullDownRefresh();
|
||||
uni.hideLoading();
|
||||
});
|
||||
}
|
||||
},
|
||||
onReachBottom: function() {
|
||||
this.page = this.page + 1;
|
||||
this.getList();
|
||||
},
|
||||
onPullDownRefresh: function() {
|
||||
this.page = 1;
|
||||
this.getList();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
page {
|
||||
// background: #1c1b20;
|
||||
}
|
||||
|
||||
.tui-tab-item-title {
|
||||
// color: #ffffff;
|
||||
font-size: 30rpx;
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
flex-wrap: nowrap;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.tui-tab-item-title-active {
|
||||
border-bottom: 1px solid #5E81F9;
|
||||
color: #5E81F9;
|
||||
font-size: 32upx;
|
||||
font-weight: bold;
|
||||
border-bottom-width: 6upx;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.item {
|
||||
background: #FFFFFF;
|
||||
padding: 32rpx;
|
||||
margin: 32rpx;
|
||||
font-size: 28rpx;
|
||||
box-shadow: 7px 9px 34px rgba(0, 0, 0, 0.1);
|
||||
border-radius: 16upx;
|
||||
}
|
||||
</style>
|
||||
135
my/other/customer.vue
Normal file
135
my/other/customer.vue
Normal file
@@ -0,0 +1,135 @@
|
||||
<template>
|
||||
<view style="height: 100vh;margin: 32upx;">
|
||||
<view style="text-align: center;background: #FFFFFF;padding: 40upx;border-radius: 32upx;">
|
||||
<view style="font-size: 38upx;">添加客服微信咨询</view>
|
||||
<view style="font-size: 32upx;margin-top: 32upx;">微信号:{{weixin}}</view>
|
||||
<view style="font-size: 32upx;margin-top: 32upx;">手机号:{{phone}}</view>
|
||||
<view @click="copyHref"
|
||||
style="background: #557EFD;width:200upx;margin-top: 32upx;font-size: 30upx;margin-left: 36%;color: #FFFFFF;padding: 4upx 20upx;border-radius: 24upx;">
|
||||
一键复制</view>
|
||||
|
||||
<image @click="saveImg" mode="aspectFit" style="margin-top: 32upx" :src="images"></image>
|
||||
<view style="font-size: 28upx;margin-top: 32upx" v-if="isWeiXin">{{ isWeiXin ? '长按识别上方二维码' : '' }}</view>
|
||||
|
||||
<!-- <button open-type="contact">在线客服</button> -->
|
||||
<!-- <view @click="goChat"
|
||||
style="width:260upx;margin-top: 32upx;font-size: 30upx;margin-left: 28%;color: #557EFD;padding: 4upx 20upx;border-radius: 24upx;">
|
||||
联系在线客服</view>
|
||||
<view v-if="isWeiXin" style="font-size: 24upx;margin-top: 80upx" @click="rests">无法识别?</view> -->
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
images: 'https://www.gomyorder.cn/custom.jpg',
|
||||
isWeiXin: false,
|
||||
weixin: '710070994',
|
||||
phone: '',
|
||||
webviewStyles: {
|
||||
progress: {
|
||||
color: '#1A1929 '
|
||||
}
|
||||
}
|
||||
};
|
||||
},
|
||||
onLoad() {
|
||||
// #ifdef H5
|
||||
let ua = navigator.userAgent.toLowerCase();
|
||||
if (ua.indexOf('micromessenger') !== -1) {
|
||||
this.isWeiXin = true;
|
||||
}
|
||||
// #endif
|
||||
//获取客服二维码
|
||||
this.$Request.getT('/app/common/type/289').then(res => {
|
||||
if (res.code == 0) {
|
||||
if (res.data && res.data.value) {
|
||||
console.log(res.data.value)
|
||||
this.images = res.data.value;
|
||||
}
|
||||
}
|
||||
});
|
||||
this.$Request.getT('/app/common/type/288').then(res => {
|
||||
if (res.code == 0) {
|
||||
if (res.data && res.data.value) {
|
||||
this.weixin = res.data.value;
|
||||
}
|
||||
}
|
||||
});
|
||||
//获取手机号码
|
||||
this.$Request.getT('/app/common/type/287').then(res => {
|
||||
if (res.code == 0) {
|
||||
if (res.data && res.data.value) {
|
||||
this.phone = res.data.value;
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
onPullDownRefresh: function() {
|
||||
uni.stopPullDownRefresh(); // 停止刷新
|
||||
},
|
||||
methods: {
|
||||
//邀请码复制
|
||||
copyHref() {
|
||||
uni.setClipboardData({
|
||||
data: this.weixin,
|
||||
success: r => {
|
||||
this.$queue.showToast('复制成功');
|
||||
}
|
||||
});
|
||||
},
|
||||
saveImg() {
|
||||
let that = this;
|
||||
let imgArr = []
|
||||
imgArr.push(that.image);
|
||||
//预览图片
|
||||
uni.previewImage({
|
||||
urls: imgArr,
|
||||
current: imgArr[0]
|
||||
});
|
||||
// uni.saveImageToPhotosAlbum({
|
||||
// filePath: that.image,
|
||||
// success(res) {
|
||||
// that.$queue.showToast('保存成功');
|
||||
// }
|
||||
// });
|
||||
},
|
||||
rests() {
|
||||
uni.showToast({
|
||||
title: '已刷新请再次长按识别',
|
||||
mask: false,
|
||||
duration: 1500,
|
||||
icon: 'none'
|
||||
});
|
||||
window.location.reload();
|
||||
},
|
||||
// 在线客服
|
||||
goChat() {
|
||||
let token = this.$queue.getData('token');
|
||||
if (token) {
|
||||
uni.navigateTo({
|
||||
url: '/my/setting/chat'
|
||||
});
|
||||
} else {
|
||||
this.goLoginInfo();
|
||||
}
|
||||
},
|
||||
//统一登录跳转
|
||||
goLoginInfo() {
|
||||
uni.navigateTo({
|
||||
url: '/pages/public/loginphone'
|
||||
});
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style>
|
||||
/* @import '../../static/css/index.css'; */
|
||||
|
||||
page {
|
||||
background: #F5F5F5;
|
||||
}
|
||||
</style>
|
||||
194
my/other/detail.vue
Normal file
194
my/other/detail.vue
Normal file
@@ -0,0 +1,194 @@
|
||||
<template>
|
||||
<view class="content">
|
||||
<view class="online_box">
|
||||
<view class="online_title">{{datas.shopIllegal}}</view>
|
||||
<u-line color="#E6E6E6" />
|
||||
<view class="online" style="padding-top: 10rpx;">
|
||||
<view class="online_tit">违规说明</view>
|
||||
<view class="online_test">{{datas.wrongExplain}}</view>
|
||||
</view>
|
||||
<view class="online">
|
||||
<view class="online_tit">关联订单</view>
|
||||
<view class="online_text" v-if="datas.shipAddressDetail" >
|
||||
<image src="../static/black.png"></image>
|
||||
<text>{{datas.shipAddressDetail}}</text>
|
||||
</view>
|
||||
<view class="online_text" v-if="datas.deilveryAddressDetail">
|
||||
<image src="../static/orange.png"></image>
|
||||
<text>{{datas.deilveryAddressDetail}}</text>
|
||||
</view>
|
||||
|
||||
<view class="online_text" v-if="datas.shopAddressDetail">
|
||||
<image src="../static/black.png"></image>
|
||||
<text>{{datas.shopAddressDetail}}</text>
|
||||
</view>
|
||||
<view class="online_text" v-if="datas.userAddressDetail">
|
||||
<image src="../static/orange.png"></image>
|
||||
<text>{{datas.userAddressDetail}}</text>
|
||||
</view>
|
||||
<view class="online_text" v-if="datas.indentNumber" @click="copyOrder(datas.indentNumber)">
|
||||
<image src="../static/orange.png"></image>
|
||||
<text>订单号:{{datas.indentNumber}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view class="online">
|
||||
<view class="online_tit">违规说明</view>
|
||||
<view style="font-size: 24rpx;margin-top: 10rpx;">{{datas.resultHanding}}</view>
|
||||
<view class="pnline_tip">如果配送中上报异常,审核成功后违规消除,不扣款</view>
|
||||
</view> -->
|
||||
</view>
|
||||
<!-- <view class="btn" v-if="datas.complaintState=='1'" @click="bindonline">在线申诉</view>
|
||||
<view class="btn btn1" v-if="datas.complaintState=='2'" >申诉中</view>
|
||||
<view class="btn" v-if="datas.complaintState=='3'"@click="bindonline" >申诉未通过</view>
|
||||
<view class="btn" v-if="datas.complaintState=='4'" >申诉通过</view> -->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
list: [{
|
||||
id: 1,
|
||||
img: '../static/black.png',
|
||||
name: '西安智能大厦'
|
||||
}, {
|
||||
id: 2,
|
||||
img: '../static/orange.png',
|
||||
name: '用户地址隐藏',
|
||||
}],
|
||||
indentNumber:'',
|
||||
datas:{},
|
||||
complaintId: ''
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
console.log(options)
|
||||
this.indentNumber =options.indentNumber
|
||||
this.complaintId = options.complaintId
|
||||
// this.bindorder()
|
||||
},
|
||||
onShow() {
|
||||
console.log('`````````````11111111')
|
||||
if(this.indentNumber!=''){
|
||||
this.bindorder()
|
||||
}
|
||||
|
||||
},
|
||||
methods: {
|
||||
copyOrder(value) {
|
||||
uni.setClipboardData({
|
||||
data: value, //要被复制的内容
|
||||
success: () => { //复制成功的回调函数
|
||||
uni.showToast({ //提示
|
||||
title: '复制成功'
|
||||
})
|
||||
}
|
||||
});
|
||||
},
|
||||
bindonline() {
|
||||
uni.navigateTo({
|
||||
url: '/pages/riderMy/myOnline/myOnline?indentNumber='+this.indentNumber+'&complaintType='+this.datas.complaintType+'&complaintId='+this.complaintId
|
||||
})
|
||||
},
|
||||
// 获取数据
|
||||
bindorder() {
|
||||
this.$Request.getT('/app/shop/findComplaint',
|
||||
{
|
||||
complaintId: this.complaintId
|
||||
}).then(res => {
|
||||
if(res.code==0){
|
||||
this.datas = res.data
|
||||
|
||||
}else{
|
||||
console.log('失败:',res.data)
|
||||
}
|
||||
|
||||
});
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
body {
|
||||
background-color: #F5F5F5;
|
||||
}
|
||||
|
||||
.content {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.online_box {
|
||||
width: 90%;
|
||||
margin: 0 auto;
|
||||
background: #FFFFFF;
|
||||
border-radius: 20rpx;
|
||||
margin-top: 30rpx;
|
||||
}
|
||||
|
||||
.online_title {
|
||||
font-size: 28rpx;
|
||||
font-weight: bold;
|
||||
letter-spacing: 2rpx;
|
||||
width: 90%;
|
||||
margin: 0 auto;
|
||||
line-height: 80rpx;
|
||||
}
|
||||
|
||||
.online {
|
||||
width: 90%;
|
||||
margin: 0 auto;
|
||||
padding-bottom: 34rpx;
|
||||
}
|
||||
|
||||
.online_tit {
|
||||
font-size: 27rpx;
|
||||
letter-spacing: 2rpx;
|
||||
font-weight: bolder;
|
||||
line-height: 40rpx;
|
||||
|
||||
}
|
||||
|
||||
.online_test {
|
||||
color: #333333;
|
||||
font-size: 26rpx;
|
||||
letter-spacing: 2rpx;
|
||||
line-height: 38rpx;
|
||||
}
|
||||
|
||||
.online_text {}
|
||||
|
||||
.online_text image {
|
||||
width: 15rpx;
|
||||
height: 15rpx;
|
||||
}
|
||||
|
||||
.online_text text {
|
||||
font-size: 21rpx;
|
||||
color: #333333;
|
||||
margin-left: 15rpx;
|
||||
letter-spacing: 1rpx;
|
||||
}
|
||||
|
||||
.pnline_tip {
|
||||
color: #999999;
|
||||
font-size: 25rpx;
|
||||
line-height: 50rpx;
|
||||
}
|
||||
|
||||
.btn {
|
||||
width: 90%;
|
||||
margin: 0 auto;
|
||||
background: #FF7F00;
|
||||
line-height: 90rpx;
|
||||
text-align: center;
|
||||
color: white;
|
||||
border-radius: 15rpx;
|
||||
margin-top: 20rpx;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
.btn1{
|
||||
background: #ccc;
|
||||
}
|
||||
</style>
|
||||
48
my/other/help.vue
Normal file
48
my/other/help.vue
Normal file
@@ -0,0 +1,48 @@
|
||||
<template>
|
||||
<view>
|
||||
<view style="margin-top: 4upx;" class="bg-white flex justify-between align-center padding" v-for="(item,index) in dataList" :key='index' @click="goDet(item)" >
|
||||
<view class="text-lg">{{index+1}}.{{item.title}}</view>
|
||||
<image src="../../static/images/img/go.png" style="width: 20rpx;height: 34rpx;" mode="aspectFill"></image>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
page: 1,
|
||||
limit: 10,
|
||||
dataList: []
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.getDataList()
|
||||
},
|
||||
methods: {
|
||||
getDataList() {
|
||||
let data = {
|
||||
page: this.page,
|
||||
limit: this.limit,
|
||||
type:3
|
||||
}
|
||||
this.$Request.getT("/app/userinfo/trainingCenterList",data).then(res => {
|
||||
this.dataList = res.data.list
|
||||
})
|
||||
},
|
||||
goDet(e) {
|
||||
uni.navigateTo({
|
||||
url: '/my/other/helpDet?id='+e.trainingId
|
||||
})
|
||||
}
|
||||
},
|
||||
onReachBottom: function() {
|
||||
this.page = this.page + 1;
|
||||
this.getDataList();
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
77
my/other/helpDet.vue
Normal file
77
my/other/helpDet.vue
Normal file
@@ -0,0 +1,77 @@
|
||||
<template>
|
||||
<view style="line-height: 26px;padding: 32upx;" class="home1">
|
||||
<!-- <view v-html="tit"> </view> -->
|
||||
<!-- <view style="font-size: 28upx;" v-html="content"></view> -->
|
||||
<u-parse :html="content"></u-parse>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
list: [],
|
||||
content: ''
|
||||
}
|
||||
},
|
||||
onLoad(e) {
|
||||
this.taskData(e.id)
|
||||
},
|
||||
methods: {
|
||||
// 获取任务数据
|
||||
taskData(e) {
|
||||
this.$Request.getT('/app/userinfo/TrainingCenter?id='+e).then(res => {
|
||||
if(res.code==0){
|
||||
this.content = res.data.message
|
||||
}
|
||||
});
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
page {
|
||||
background: #FFFFFF;
|
||||
}
|
||||
|
||||
.content {
|
||||
width: 100%;
|
||||
background: #FFFFFF;
|
||||
margin-top: 20rpx;
|
||||
padding-bottom: 50rpx;
|
||||
padding-top: 20rpx;
|
||||
}
|
||||
|
||||
.list_box {
|
||||
width: 90%;
|
||||
margin: 0 auto;
|
||||
display: flex;
|
||||
line-height: 45rpx;
|
||||
padding-top: 20rpx;
|
||||
}
|
||||
|
||||
.list_left {
|
||||
flex: 2;
|
||||
}
|
||||
|
||||
.name {
|
||||
font-size: 26rpx;
|
||||
color: #333333;
|
||||
font-weight: bold;
|
||||
letter-spacing: 2rpx;
|
||||
}
|
||||
|
||||
.data {
|
||||
color: #999999;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
|
||||
/* .list_right {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
align-items: center;
|
||||
font-size: 31rpx;
|
||||
} */
|
||||
</style>
|
||||
44
my/other/mimi.vue
Normal file
44
my/other/mimi.vue
Normal file
@@ -0,0 +1,44 @@
|
||||
<template>
|
||||
<view style="line-height: 26px;padding: 32upx;" class="bg-white">
|
||||
<!-- <view v-html="tit"> </view> -->
|
||||
<view style="font-size: 28upx;" v-html="content"></view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
tit: '',
|
||||
content: ''
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
// this.getGuize();
|
||||
// 隐私政策
|
||||
this.$Request.getT('/app/common/type/237').then(res => { //用户完成成功
|
||||
if (res.code == 0) {
|
||||
if (res.data && res.data.value) {
|
||||
this.content = res.data.value;
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
getGuize() {
|
||||
this.$Request.getT('/app/userinfo/privacyPolicy').then(res => {
|
||||
if (res.code == 0) {
|
||||
this.content = res.data.value;
|
||||
// this.tit = res.data.min
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
page {
|
||||
background: #FFF;
|
||||
}
|
||||
</style>
|
||||
544
my/other/money.vue
Normal file
544
my/other/money.vue
Normal file
@@ -0,0 +1,544 @@
|
||||
<template>
|
||||
<view>
|
||||
<view style="width: 100%;height: 384upx;position: relative;">
|
||||
<image src="../../static/images/img/image_bg.png" style="width: 100%;height: 100%;"></image>
|
||||
<view class="box">
|
||||
<view class="margin-top padding-top">保证金(元)</view>
|
||||
<view class="margin-top-lg text-bold" style="font-size: 78upx;">{{cashDeposit?cashDeposit:0}}</view>
|
||||
<view class="mingxi" @click="bindmingxi()">保证金明细</view>
|
||||
<view class="flex justify-center padding-lr" style="margin-top: 100upx;">
|
||||
<view class="btn1" @click="Tuiprice()">退保证金</view>
|
||||
<view class="btn2" @click="submit()">缴纳保证金</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="padding" style="margin-top: 180upx;">
|
||||
<view style="color: #333333;font-size: 38upx;" class="text-bold">保证金规则</view>
|
||||
<view style="font-size: 32upx;margin-top: 58upx;" class="text-bold">保证金退款</view>
|
||||
<view style="color: #666666;margin-top: 29upx;font-size: 28upx;">
|
||||
48小时内无订单记录即可申请退保证金,保证金统一退款至账户余额,实时到账。
|
||||
</view>
|
||||
<view style="font-size: 32upx;margin-top: 58upx;" class="text-bold">保证金缴纳</view>
|
||||
<view style="color: #666666;margin-top: 29upx;font-size: 28upx;">
|
||||
所有店铺发布商品需缴纳保证金{{money}}元,没有缴纳者将无法接订单,建议您及时缴纳。
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 支付方式 -->
|
||||
<!-- <u-popup v-model="showpay" mode="bottom" :closeable="closeable">
|
||||
<view class="popup_pay">
|
||||
<view style="background-color: #fff;">
|
||||
<view style="padding: 0 20upx;margin-top: 60rpx;margin-bottom: 20rpx;">
|
||||
<view
|
||||
style="display: flex;height: 100upx;align-items: center;padding: 20upx 0;justify-content: center;"
|
||||
v-for="(item,index) in openLists" :key='index'>
|
||||
<image :src="item.image" style="width: 55upx;height: 55upx;border-radius: 50upx;">
|
||||
</image>
|
||||
<view style="font-size: 30upx;margin-left: 20upx;width: 70%;">
|
||||
{{item.text}}
|
||||
</view>
|
||||
<radio-group name="openWay" style="margin-left: 45upx;" @tap='selectWay(item)'>
|
||||
<label class="tui-radio">
|
||||
<radio color="#1777FF" :checked="openWay === item.id ? true : false" />
|
||||
</label>
|
||||
</radio-group>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="pay_btn" @click="pay()">确认支付</view>
|
||||
</view>
|
||||
</u-popup> -->
|
||||
<!-- 支付方式 -->
|
||||
<u-popup v-model="showpay" mode="center" width="640rpx" height="640rpx" border-radius="14" :closeable="true"
|
||||
close-icon="close-circle" close-icon-size="50" close-icon-color="#CCCCCC" @close="closePopup()">
|
||||
<view style="width: 100%;height: 300upx;background: #FFFFFF;">
|
||||
<view class="receipt_code">
|
||||
<view class="code_title">请输入支付金额</view>
|
||||
<u-input v-model="earnestMoney" placeholder="请输入支付金额" :border="true" />
|
||||
<view class="margin-tb padding-lr radius bg-white" style="height: 220upx;">
|
||||
<view class="flex align-center justify-between padding-tb-sm" v-for="(item,index) in openLists"
|
||||
:key='index'>
|
||||
<image :src="item.image" style="width: 80upx;height: 80upx;border-radius: 50upx;"></image>
|
||||
<view class="flex-sub text-xl text-bold margin-left">{{item.text}}</view>
|
||||
<radio-group name="openWay" style="margin-left: 20upx;" @change='selectWay(item)'>
|
||||
<label class="tui-radio">
|
||||
<radio class="red" :checked="openWay === item.id ? true : false" />
|
||||
</label>
|
||||
</radio-group>
|
||||
</view>
|
||||
</view>
|
||||
<view class="sure" @click="pay()">确定</view>
|
||||
</view>
|
||||
</view>
|
||||
</u-popup>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
money: 0,
|
||||
showpay: false,
|
||||
openLists: [],
|
||||
openWay: 1,
|
||||
closeable: true,
|
||||
renzheng: '',
|
||||
cashDeposit: '',
|
||||
earnestMoney: '',
|
||||
openId: ''
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.cashDeposit = uni.getStorageSync('cashDeposit')
|
||||
this.openId = uni.getStorageSync('openId')
|
||||
this.renzheng = uni.getStorageSync("renzheng")
|
||||
// #ifdef APP
|
||||
this.openLists = [{
|
||||
image: '../../static/images/img/icon_weixin.png',
|
||||
text: '微信',
|
||||
id: 1
|
||||
}, {
|
||||
image: '../../static/images/img/zhifubao.png',
|
||||
text: '支付宝',
|
||||
id: 2
|
||||
}],
|
||||
this.openWay = 1;
|
||||
// #endif
|
||||
|
||||
// #ifdef MP-WEIXIN
|
||||
this.openLists = [{
|
||||
image: '../../static/images/img/icon_weixin.png',
|
||||
text: '微信',
|
||||
id: 1
|
||||
}],
|
||||
this.openWay = 1;
|
||||
// #endif
|
||||
|
||||
// #ifdef H5
|
||||
this.openLists = [{
|
||||
image: '../../static/images/img/zhifubao.png',
|
||||
text: '支付宝',
|
||||
id: 2
|
||||
}]
|
||||
this.openWay = 2;
|
||||
// #endif
|
||||
|
||||
|
||||
},
|
||||
onShow() {
|
||||
this.Getmoney()
|
||||
this.getshanghuinfo()
|
||||
},
|
||||
methods: {
|
||||
selectWay: function(item) {
|
||||
this.openWay = item.id;
|
||||
},
|
||||
//保证金明细
|
||||
bindmingxi() {
|
||||
uni.navigateTo({
|
||||
url: '/my/other/moneylist'
|
||||
})
|
||||
},
|
||||
getshanghuinfo() {
|
||||
let data = {
|
||||
shopId: uni.getStorageSync('shopId')
|
||||
}
|
||||
this.$Request.get("/app/shop/selectShopMessage", data).then(res => {
|
||||
if (res.code == 0) {
|
||||
this.cashDeposit = res.data.cashDeposit
|
||||
uni.setStorageSync('cashDeposit', res.data.cashDeposit)
|
||||
}
|
||||
});
|
||||
},
|
||||
// 保证金
|
||||
Getmoney() {
|
||||
this.$Request.get("/app/common/type/270").then(res => {
|
||||
console.log(res)
|
||||
if (res.code == 0) {
|
||||
this.money = res.data.value
|
||||
}
|
||||
});
|
||||
},
|
||||
//缴纳保证金
|
||||
submit() {
|
||||
// if (this.isCashDeposit == 3) {
|
||||
// uni.showToast({
|
||||
// title: '系统审核中,请耐心等待',
|
||||
// icon: 'none',
|
||||
// duration: 1000
|
||||
// })
|
||||
// } else if (this.isCashDeposit == 1) {
|
||||
// this.showpay = true
|
||||
// }
|
||||
this.showpay = true
|
||||
// #ifdef MP-WEIXIN
|
||||
this.wxlogin()
|
||||
// #endif
|
||||
|
||||
},
|
||||
//退保证金
|
||||
Tuiprice() {
|
||||
if (this.cashDeposit == 0) {
|
||||
uni.showToast({
|
||||
title: '保证金余额0',
|
||||
icon: 'none',
|
||||
duration: 1000
|
||||
})
|
||||
} else {
|
||||
this.$Request.getT('/app/shop/shopRefundCashDeposit', {
|
||||
shopId: uni.getStorageSync('shopId')
|
||||
}).then(res => {
|
||||
if (res.code == 0) {
|
||||
uni.showToast({
|
||||
title: '申请提交成功,保证金已退还至您的钱包账户',
|
||||
icon: 'none',
|
||||
duration: 1000
|
||||
})
|
||||
uni.switchTab({
|
||||
url: '/pages/my/index'
|
||||
})
|
||||
}else{
|
||||
this.$queue.showToast(res.msg);
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
},
|
||||
// 关闭底部弹出层
|
||||
closePopup() {
|
||||
this.shows = false
|
||||
},
|
||||
wxlogin() {
|
||||
let that = this
|
||||
wx.login({
|
||||
success(res) {
|
||||
if (res.code) {
|
||||
console.log(res)
|
||||
//发起网络请求
|
||||
let data = {
|
||||
code: res.code
|
||||
}
|
||||
that.$Request.getA("/app/Login/wxShopLogin", data).then(res => {
|
||||
if (res.code == 0) {
|
||||
that.$queue.setData("openId", res.data.open_id);
|
||||
}
|
||||
})
|
||||
} else {
|
||||
console.log('登录失败!' + res.errMsg)
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
pay() {
|
||||
let that = this;
|
||||
|
||||
if (!this.earnestMoney) {
|
||||
that.$queue.showToast('请输入支付金额');
|
||||
return;
|
||||
}
|
||||
uni.showLoading({
|
||||
title: '支付中'
|
||||
});
|
||||
let userId = uni.getStorageSync('userId')
|
||||
let openId = uni.getStorageSync('openId')
|
||||
that.showpay = false
|
||||
if (that.openWay == 1) { //微信支付
|
||||
// #ifdef MP-WEIXIN
|
||||
let data = {
|
||||
money: that.earnestMoney,
|
||||
openId: openId,
|
||||
type: 3
|
||||
}
|
||||
that.$Request.post('/shop/shopmoney/shopCashDeposit', data).then(res => {
|
||||
console.log(res)
|
||||
uni.hideLoading();
|
||||
if (res.code == 0) {
|
||||
that.earnestMoney = ''
|
||||
uni.requestPayment({
|
||||
provider: 'wxpay',
|
||||
timeStamp: res.data.timestamp,
|
||||
nonceStr: res.data.noncestr,
|
||||
package: res.data.package,
|
||||
signType: res.data.signType,
|
||||
paySign: res.data.sign,
|
||||
success: function(res) {
|
||||
console.log(res)
|
||||
uni.showToast({
|
||||
title: '支付成功',
|
||||
icon: 'nones'
|
||||
});
|
||||
// this.$queue.showToast('支付成功');
|
||||
that.getshanghuinfo()
|
||||
// uni.switchTab({
|
||||
// url: '/pages/my/index'
|
||||
// })
|
||||
},
|
||||
fail: function(err) {
|
||||
that.$queue.showToast('支付失败');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
// #endif
|
||||
|
||||
|
||||
// #ifdef H5
|
||||
let data = {
|
||||
money: that.money,
|
||||
type: 2
|
||||
}
|
||||
that.$Request.post('/shop/shopmoney/shopCashDeposit', data).then(res => {
|
||||
uni.hideLoading();
|
||||
that.showpay = false
|
||||
that.callPay(res);
|
||||
});
|
||||
// #endif
|
||||
|
||||
// #ifdef APP
|
||||
let data = {
|
||||
money: that.money,
|
||||
type: 1
|
||||
}
|
||||
that.$Request.post('/shop/shopmoney/shopCashDeposit', data).then(res => {
|
||||
uni.hideLoading()
|
||||
console.log(res)
|
||||
that.showpay = false
|
||||
if (res.code == 0) {
|
||||
that.isCheckPay(res.code, 'wxpay', JSON.stringify(res.data));
|
||||
}
|
||||
});
|
||||
// #endif
|
||||
|
||||
|
||||
} else if (that.openWay == 2) { //支付宝支付
|
||||
// #ifdef H5
|
||||
let data = {
|
||||
money: that.money,
|
||||
type: 5
|
||||
}
|
||||
that.$Request.post('/shop/shopmoney/shopCashDeposit', data).then(
|
||||
res => {
|
||||
uni.hideLoading()
|
||||
that.showpay = false
|
||||
const div = document.createElement('div')
|
||||
div.innerHTML = res.data //此处form就是后台返回接收到的数据
|
||||
document.body.appendChild(div)
|
||||
document.forms[0].submit()
|
||||
});
|
||||
// #endif
|
||||
|
||||
// #ifdef APP-PLUS
|
||||
let data = {
|
||||
money: that.money,
|
||||
type: 4
|
||||
}
|
||||
that.$Request.post('/shop/shopmoney/shopCashDeposit', data).then(
|
||||
res => {
|
||||
uni.hideLoading()
|
||||
that.showpay = false
|
||||
that.setPayment('alipay', res.data);
|
||||
});
|
||||
// #endif
|
||||
|
||||
}
|
||||
},
|
||||
callPay: function(response) {
|
||||
if (typeof WeixinJSBridge === "undefined") {
|
||||
if (document.addEventListener) {
|
||||
document.addEventListener('WeixinJSBridgeReady', this.onBridgeReady(response), false);
|
||||
} else if (document.attachEvent) {
|
||||
document.attachEvent('WeixinJSBridgeReady', this.onBridgeReady(response));
|
||||
document.attachEvent('onWeixinJSBridgeReady', this.onBridgeReady(response));
|
||||
}
|
||||
} else {
|
||||
this.onBridgeReady(response);
|
||||
}
|
||||
},
|
||||
onBridgeReady: function(response) {
|
||||
let that = this;
|
||||
if (!response.package) {
|
||||
return;
|
||||
}
|
||||
WeixinJSBridge.invoke(
|
||||
'getBrandWCPayRequest', {
|
||||
"appId": response.appid, //公众号名称,由商户传入
|
||||
"timeStamp": response.timestamp, //时间戳,自1970年以来的秒数
|
||||
"nonceStr": response.noncestr, //随机串
|
||||
"package": response.package,
|
||||
"signType": response.signType, //微信签名方式:
|
||||
"paySign": response.sign //微信签名
|
||||
},
|
||||
function(res) {
|
||||
if (res.err_msg === "get_brand_wcpay_request:ok") {
|
||||
// 使用以上方式判断前端返回,微信团队郑重提示:
|
||||
//res.err_msg将在用户支付成功后返回ok,但并不保证它绝对可靠。
|
||||
uni.showLoading({
|
||||
title: '支付成功'
|
||||
});
|
||||
uni.hideLoading();
|
||||
|
||||
uni.navigateTo({
|
||||
url: '/pages/my/index'
|
||||
})
|
||||
} else {
|
||||
uni.hideLoading();
|
||||
}
|
||||
WeixinJSBridge.log(response.err_msg);
|
||||
}
|
||||
);
|
||||
},
|
||||
isCheckPay(code, name, order) {
|
||||
if (code == 0) {
|
||||
console.log('999999999999')
|
||||
this.setPayment(name, order);
|
||||
} else {
|
||||
uni.hideLoading();
|
||||
uni.showToast({
|
||||
title: '支付信息有误'
|
||||
});
|
||||
}
|
||||
},
|
||||
setPayment(name, order) {
|
||||
console.log(777777777, name, order)
|
||||
uni.requestPayment({
|
||||
provider: name,
|
||||
orderInfo: order, //微信、支付宝订单数据
|
||||
success: function(res) {
|
||||
uni.hideLoading();
|
||||
uni.showLoading({
|
||||
title: '支付成功'
|
||||
});
|
||||
uni.switchTab({
|
||||
url: '/pages/my/index'
|
||||
})
|
||||
},
|
||||
fail: function(err) {
|
||||
uni.hideLoading();
|
||||
},
|
||||
complete() {
|
||||
uni.hideLoading();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
page {
|
||||
background: #FFFfff;
|
||||
}
|
||||
|
||||
.box {
|
||||
width: 690upx;
|
||||
height: 430upx;
|
||||
background: #FFFDFC;
|
||||
box-shadow: 0upx 15upx 43upx 0upx rgba(232, 215, 199, 0.29);
|
||||
border-radius: 24upx;
|
||||
margin: 0 auto;
|
||||
position: absolute;
|
||||
top: 80upx;
|
||||
left: 0;
|
||||
right: 0;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.btn1 {
|
||||
/* width: 305upx; */
|
||||
width: 100%;
|
||||
height: 88upx;
|
||||
background: #ffffff;
|
||||
border: 2upx solid #CCCCCC;
|
||||
border-radius: 8upx;
|
||||
line-height: 88upx;
|
||||
/* color: #FFFFFF; */
|
||||
font-size: 28upx;
|
||||
margin-right: 20upx;
|
||||
}
|
||||
|
||||
.btn2 {
|
||||
/* width: 305upx; */
|
||||
width: 100%;
|
||||
height: 88upx;
|
||||
background: #FCD202;
|
||||
border-radius: 8upx;
|
||||
line-height: 88upx;
|
||||
/* color: #FFFFFF; */
|
||||
font-size: 28upx;
|
||||
}
|
||||
|
||||
.popup_pay {
|
||||
width: 100%;
|
||||
position: relative;
|
||||
padding-bottom: 45rpx;
|
||||
/* height: 160px; */
|
||||
/* #ifndef MP-WEIXIN */
|
||||
/* height: 130px; */
|
||||
/* #endif */
|
||||
|
||||
}
|
||||
|
||||
.pay_btn {
|
||||
width: 90%;
|
||||
margin: 0 auto;
|
||||
text-align: center;
|
||||
background: #2FB57A;
|
||||
height: 80rpx;
|
||||
border-radius: 16rpx;
|
||||
color: #ffffff;
|
||||
line-height: 80rpx;
|
||||
|
||||
}
|
||||
|
||||
/* 支付金额弹框 */
|
||||
.receipt_code {
|
||||
width: 90%;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.code_title {
|
||||
width: 100%;
|
||||
line-height: 100rpx;
|
||||
font-size: 31rpx;
|
||||
font-weight: bold;
|
||||
text-align: center;
|
||||
letter-spacing: 2rpx;
|
||||
margin-top: 21rpx;
|
||||
margin-bottom: 25rpx;
|
||||
}
|
||||
|
||||
.u-input--border {
|
||||
border: 1px solid #F2F2F2 !important;
|
||||
background: #F2F2F2 !important;
|
||||
color: #999999 !important;
|
||||
font-weight: 500 !important;
|
||||
letter-spacing: 2rpx !important;
|
||||
}
|
||||
|
||||
.u-input__input {
|
||||
font-size: 30rpx;
|
||||
font-weight: bold;
|
||||
flex: 1;
|
||||
color: #999999 !important;
|
||||
min-height: 85rpx !important;
|
||||
margin-top: 7rpx;
|
||||
}
|
||||
|
||||
.sure {
|
||||
width: 100%;
|
||||
height: 80rpx;
|
||||
background: #2FB57A;
|
||||
color: white;
|
||||
border-radius: 46rpx;
|
||||
text-align: center;
|
||||
line-height: 80rpx;
|
||||
margin-top: 30rpx;
|
||||
letter-spacing: 2rpx;
|
||||
}
|
||||
|
||||
.mingxi {
|
||||
position: relative;
|
||||
top: 10px;
|
||||
}
|
||||
</style>
|
||||
138
my/other/moneydetail.vue
Normal file
138
my/other/moneydetail.vue
Normal file
@@ -0,0 +1,138 @@
|
||||
<template>
|
||||
<view>
|
||||
<view style="text-align: left;padding-bottom: 10rpx;">
|
||||
<view v-for="(item, index) in list" :key="index" class="item">
|
||||
<view>
|
||||
<view style="margin-bottom: 8upx;display: flex;justify-content: space-between;">
|
||||
<view class="flex" style="color: #2FB57A">
|
||||
<view v-if="item.classify == 2"> 微信 </view>
|
||||
<view v-if="item.classify == 1"> 支付宝 </view>
|
||||
<text style="margin-bottom: 8upx;color: #2FB57A" v-if="item.state==1">提现成功</text>
|
||||
<text style="margin-bottom: 8upx;color: #2FB57A" v-if="item.state==0">提现中 </text>
|
||||
<text style="margin-bottom: 8upx;color: #e10a07" v-if="item.state==-1">提现失败,提现金额已退回钱包</text>
|
||||
</view>
|
||||
|
||||
<text style="color: #ecd4b4;font-size: 32upx;font-weight: 600"> ¥{{item.money}}</text>
|
||||
|
||||
</view>
|
||||
<view style="color: #999999;font-size: 28upx;">
|
||||
<!-- <view style="margin-bottom: 8upx" v-if="item.classify ==1">支付宝提现</view> -->
|
||||
<view style="margin-bottom: 8upx" v-if="item.classify == 1"> 支付宝账号:{{item.zhifubao}}</view>
|
||||
<view style="margin-bottom: 8upx" v-if="item.classify == 1"> 支付宝姓名:{{item.zhifubaoName}}</view>
|
||||
|
||||
<view style="margin-bottom: 8upx"> 创建时间:{{item.createAt}}</view>
|
||||
<view style="margin-bottom: 8upx;text-align: right;">
|
||||
<text v-if="item.type == -1" class="text-olive"
|
||||
style="font-size: 32upx;font-weight: 600"><text
|
||||
class="text-olive">+</text>{{item.money}}元</text>
|
||||
<text v-if="item.state == 1||item.state == 0" class="text-red" style="font-size: 32upx;font-weight: 600"><text
|
||||
class="text-red">-</text>{{item.money}}元</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 加载更多提示 -->
|
||||
<!-- <view class="s-col is-col-24" v-if="list.length > 0">
|
||||
<load-more :loadingType="loadingType" :contentText="contentText"></load-more>
|
||||
</view> -->
|
||||
<!-- 加载更多提示 -->
|
||||
<!-- <empty v-if="list.length === 0" des="暂无明细数据" show="false"></empty> -->
|
||||
<empty v-if="list.length == 0" content="暂无明细"></empty>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import empty from '@/components/empty.vue'
|
||||
export default {
|
||||
components: {
|
||||
empty
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
list: [],
|
||||
page: 1,
|
||||
limit: 10,
|
||||
tabIndex: 1,
|
||||
checkReZhiShu: '否',
|
||||
checkReTuanZhang: '否',
|
||||
checkReFeiZhiShu: '否',
|
||||
scrollTop: false,
|
||||
contentText: {
|
||||
contentdown: '上拉显示更多',
|
||||
contentrefresh: '正在加载...',
|
||||
contentnomore: '没有更多数据了'
|
||||
}
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.$queue.showLoading("加载中...");
|
||||
this.getList();
|
||||
},
|
||||
onPageScroll: function(e) {
|
||||
this.scrollTop = e.scrollTop > 200;
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
let userId = this.$queue.getData('userId');
|
||||
let data = {
|
||||
page: this.page,
|
||||
limit: this.limit,
|
||||
shopId:uni.getStorageSync('shopId')
|
||||
}
|
||||
this.$Request.getT('/shop/shopmoney/selectCashOutList', data).then(res => {
|
||||
if (res.code === 0) {
|
||||
if (this.page === 1) {
|
||||
this.list = res.data.list;
|
||||
} else {
|
||||
this.list = [...this.list, ...res.data.list];
|
||||
}
|
||||
}
|
||||
uni.stopPullDownRefresh();
|
||||
uni.hideLoading();
|
||||
});
|
||||
}
|
||||
},
|
||||
onReachBottom: function() {
|
||||
this.page = this.page + 1;
|
||||
this.getList();
|
||||
},
|
||||
onPullDownRefresh: function() {
|
||||
this.page = 1;
|
||||
this.getList();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
page {
|
||||
background: #FFFFFF;
|
||||
}
|
||||
|
||||
.tui-tab-item-title {
|
||||
// color: #ffffff;
|
||||
font-size: 30rpx;
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
flex-wrap: nowrap;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.tui-tab-item-title-active {
|
||||
border-bottom: 1px solid #557EFD;
|
||||
color: #557EFD;
|
||||
font-size: 32upx;
|
||||
font-weight: bold;
|
||||
border-bottom-width: 6upx;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.item {
|
||||
background: #FFFFFF;
|
||||
padding: 32rpx;
|
||||
margin: 32rpx;
|
||||
font-size: 28rpx;
|
||||
box-shadow: 7px 9px 34px rgba(0, 0, 0, 0.1);
|
||||
border-radius: 16upx;
|
||||
}
|
||||
</style>
|
||||
127
my/other/moneylist.vue
Normal file
127
my/other/moneylist.vue
Normal file
@@ -0,0 +1,127 @@
|
||||
<template>
|
||||
<view>
|
||||
<view style="text-align: left;padding-bottom: 10rpx;">
|
||||
<view v-for="(item, index) in list" :key="index" class="item">
|
||||
<view>
|
||||
<!-- <view style="margin-bottom: 8upx;text-align: right;">
|
||||
<text v-if="item.type == 1" style="margin-bottom: 8upx;color: #ecd4b4">充值</text>
|
||||
<text v-if="item.type == 2" style="margin-bottom: 8upx;color: #ecd4b4">提现</text>
|
||||
</view> -->
|
||||
<view style="color: #999999;font-size: 28upx;">
|
||||
<view style="margin-bottom: 8upx">{{item.title}}</view>
|
||||
<!-- <view v-if="item.classify === 2" style="margin-bottom: 8upx"> 返佣类型:直属返佣</view> -->
|
||||
<!-- <view v-if="item.classify === 3" style="margin-bottom: 8upx"> 返佣类型:非直属支付</view> -->
|
||||
<view style="margin-bottom: 8upx">{{item.content}}</view>
|
||||
<view style="margin-bottom: 8upx"> 创建时间:{{item.createTime}}</view>
|
||||
<view style="margin-bottom: 8upx;text-align: right;">
|
||||
<text v-if="item.type == 1" class="text-olive" style="font-size: 32upx;font-weight: 600"><text class="text-olive">+</text>{{item.money}}元</text>
|
||||
<text v-if="item.type == 2" class="text-red" style="font-size: 32upx;font-weight: 600"><text class="text-red">-</text>{{item.money}}元</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 加载更多提示 -->
|
||||
<!-- <view class="s-col is-col-24" v-if="list.length > 0">
|
||||
<load-more :loadingType="loadingType" :contentText="contentText"></load-more>
|
||||
</view> -->
|
||||
<!-- 加载更多提示 -->
|
||||
<!-- <empty v-if="list.length === 0" des="暂无明细数据" show="false"></empty> -->
|
||||
<empty v-if="list.length == 0" content="暂无明细" ></empty>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import empty from '@/components/empty.vue'
|
||||
export default {
|
||||
components: {
|
||||
empty
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
list: [],
|
||||
page: 1,
|
||||
limit: 10,
|
||||
tabIndex: 1,
|
||||
checkReZhiShu: '否',
|
||||
checkReTuanZhang: '否',
|
||||
checkReFeiZhiShu: '否',
|
||||
scrollTop: false,
|
||||
contentText: {
|
||||
contentdown: '上拉显示更多',
|
||||
contentrefresh: '正在加载...',
|
||||
contentnomore: '没有更多数据了'
|
||||
}
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.$queue.showLoading("加载中...");
|
||||
this.getList();
|
||||
},
|
||||
onPageScroll: function(e) {
|
||||
this.scrollTop = e.scrollTop > 200;
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
let userId = this.$queue.getData('userId');
|
||||
let data = {
|
||||
page: this.page,
|
||||
limit: this.limit,
|
||||
classify:2
|
||||
}
|
||||
this.$Request.getT('/shop/shopmoney/selectShopCashDeposit',data ).then(res => {
|
||||
if (res.code === 0) {
|
||||
if (this.page === 1) {
|
||||
this.list = res.data.list;
|
||||
} else {
|
||||
this.list = [...this.list, ...res.data.list];
|
||||
}
|
||||
}
|
||||
uni.stopPullDownRefresh();
|
||||
uni.hideLoading();
|
||||
});
|
||||
}
|
||||
},
|
||||
onReachBottom: function() {
|
||||
this.page = this.page + 1;
|
||||
this.getList();
|
||||
},
|
||||
onPullDownRefresh: function() {
|
||||
this.page = 1;
|
||||
this.getList();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
page {
|
||||
background: #FFFFFF;
|
||||
}
|
||||
|
||||
.tui-tab-item-title {
|
||||
// color: #ffffff;
|
||||
font-size: 30rpx;
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
flex-wrap: nowrap;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.tui-tab-item-title-active {
|
||||
border-bottom: 1px solid #557EFD;
|
||||
color: #557EFD;
|
||||
font-size: 32upx;
|
||||
font-weight: bold;
|
||||
border-bottom-width: 6upx;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.item {
|
||||
background: #FFFFFF;
|
||||
padding: 32rpx;
|
||||
margin: 32rpx;
|
||||
font-size: 28rpx;
|
||||
box-shadow: 7px 9px 34px rgba(0, 0, 0, 0.1);
|
||||
border-radius: 16upx;
|
||||
}
|
||||
</style>
|
||||
345
my/other/myComplain.vue
Normal file
345
my/other/myComplain.vue
Normal file
@@ -0,0 +1,345 @@
|
||||
<template>
|
||||
<view class="content">
|
||||
<view class="complain_cont">
|
||||
<view class="complain_tabs" v-show="!isShow">
|
||||
<u-tabs :list="list" :is-scroll="true" name="illegal" :current="current" active-color="#FF7F00"
|
||||
@change="change"></u-tabs>
|
||||
</view>
|
||||
</view>
|
||||
<u-tabs :list="listTab" :is-scroll="false" inactive-color="#333333" active-color="#FF7F00" :current="currentIndex" @change="changeTab">
|
||||
</u-tabs>
|
||||
<view class="tabs_box dis">
|
||||
<!-- 全部 -->
|
||||
<view class="complain_box" v-for="(item,index) in orderlist" :key="index" @click="bindonline(item)">
|
||||
<view class="complain_part1">
|
||||
<view class="part1_left">{{item.illegal}}</view>
|
||||
<!-- <view class="part1_left" v-if="item.complaintType=='2'">拒绝系统推单</view> -->
|
||||
<!-- <view class="part1_left" v-if="item.complaintType=='3'">残损违规</view> -->
|
||||
<view class="part1_right">扣款{{item.deductMoney}}元</view>
|
||||
</view>
|
||||
<view class="complain_part2" v-if="item.shipAddressDetail">
|
||||
<image src="../../../static/image/black.png"></image>
|
||||
<text>{{item.shipAddressDetail}}</text>
|
||||
</view>
|
||||
<view class="complain_part2" v-if="item.deilveryAddressDetail">
|
||||
<image src="../../../static/image/orange.png"></image>
|
||||
<text>{{item.deilveryAddressDetail}}</text>
|
||||
</view>
|
||||
<u-line color="#E6E6E6" />
|
||||
<view class="complain_title">
|
||||
<span v-if="item.complaintState=='1'">可申诉</span>
|
||||
<span v-if="item.complaintState=='2'">申诉中</span>
|
||||
<span v-if="item.complaintState=='3'">申诉未通过</span>
|
||||
<span v-if="item.complaintState=='4'">申诉通过</span>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="empty" v-if="orderlist.length == 0">
|
||||
<view
|
||||
style="display: block; width: 90%; margin: 0 auto; position: fixed;top: 35%;left: 0rpx;right: 0rpx;text-align: center;">
|
||||
<image src="../../../static/image/empty.png" style="width: 300rpx;height: 300rpx;"></image>
|
||||
<view style="color: #CCCCCC;">暂无内容</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
isShow: false,
|
||||
page: 1,
|
||||
limit: 10,
|
||||
complaintType: null,
|
||||
complaintState: '',
|
||||
listTab: [{
|
||||
name: '全部'
|
||||
}, {
|
||||
name: '可申诉'
|
||||
}, {
|
||||
name: '申诉中'
|
||||
}, {
|
||||
name: '申诉未通过'
|
||||
}, {
|
||||
name: '申诉通过'
|
||||
}],
|
||||
currentIndex: 0,
|
||||
list: [{
|
||||
id: '',
|
||||
illegal: '全部'
|
||||
}],
|
||||
current: 0,
|
||||
orderlist: [],
|
||||
totalCount: 0,
|
||||
illegalId: ''
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
||||
},
|
||||
onLoad() {
|
||||
this.getTypeList()
|
||||
this.bindorder()
|
||||
},
|
||||
methods: {
|
||||
getTypeList() {
|
||||
this.$Request.getT('/app/illegalType/selectIllegalTypeList').then(res => {
|
||||
if (res.code == 0) {
|
||||
this.list = [...this.list, ...res.data]
|
||||
}
|
||||
});
|
||||
},
|
||||
bindlist(index) {
|
||||
console.log(index)
|
||||
|
||||
this.current = index;
|
||||
this.isShow = !this.isShow
|
||||
},
|
||||
// 获取全部数据
|
||||
bindorder() {
|
||||
this.$Request.getT('/app/indent/findAllComplaint', {
|
||||
page: this.page,
|
||||
limit: this.limit,
|
||||
complaintState: this.complaintState,
|
||||
illegalId: this.illegalId
|
||||
}).then(res => {
|
||||
if (res.code == 0) {
|
||||
this.totalCount = res.data.totalCount
|
||||
if (this.page == 1) {
|
||||
this.orderlist = res.data.list
|
||||
} else {
|
||||
this.orderlist = this.list_box.concat(res.data.list)
|
||||
}
|
||||
} else {
|
||||
console.log('失败:', res.data)
|
||||
}
|
||||
|
||||
});
|
||||
},
|
||||
change(index) {
|
||||
console.log(index)
|
||||
this.illegalId = this.list[index].id
|
||||
this.orderlist = []
|
||||
this.current = index;
|
||||
this.currentIndex = 0
|
||||
this.page = 1
|
||||
|
||||
this.complaintState = ''
|
||||
this.bindorder()
|
||||
},
|
||||
changeTab(index) {
|
||||
this.orderlist = []
|
||||
this.currentIndex = index
|
||||
this.page = 1
|
||||
if (index == 0) {
|
||||
this.complaintState = ''
|
||||
} else {
|
||||
this.complaintState = index
|
||||
}
|
||||
this.bindorder()
|
||||
},
|
||||
bindonline(item) {
|
||||
// if(item.complaintState == 1 || item.complaintState == 4) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/riderMy/myComplain/online_complain/online_complain?indentNumber=' + item
|
||||
.indentNumber + '&complaintId=' + item.complaintId
|
||||
})
|
||||
// }
|
||||
},
|
||||
bindshow() {
|
||||
this.isShow = !this.isShow
|
||||
},
|
||||
},
|
||||
// 上拉加载
|
||||
onReachBottom: function() {
|
||||
if (this.page < this.totalCount) {
|
||||
this.page = this.page + 1;
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: '已经最后一页啦',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
this.bindorder();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
body {
|
||||
background-color: #F5F5F5;
|
||||
}
|
||||
|
||||
.empty {
|
||||
width: 100%;
|
||||
background: #ffffff;
|
||||
/* #ifdef MP-WEIXIN */
|
||||
height: 93vh;
|
||||
/* #endif */
|
||||
/* #ifndef MP-WEIXIN */
|
||||
height: 80vh;
|
||||
/* #endif */
|
||||
}
|
||||
|
||||
.u-tab-item {
|
||||
font-weight: 400 !important;
|
||||
color: #000000 !important;
|
||||
font-size: 24rpx !important;
|
||||
}
|
||||
|
||||
.tabs_box {
|
||||
/* display: none; */
|
||||
/* position: absolute; */
|
||||
/* top: 144rpx; */
|
||||
}
|
||||
|
||||
.dis {
|
||||
/* display: block; */
|
||||
/* width: 100%; */
|
||||
/* position: absolute; */
|
||||
/* top: 100rpx; */
|
||||
}
|
||||
|
||||
.content {
|
||||
width: 100%;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.complain_cont {
|
||||
width: 100%;
|
||||
position: relative;
|
||||
/* display: flex; */
|
||||
}
|
||||
|
||||
.complain_tabs {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.complain_btn {
|
||||
width: 15%;
|
||||
background: #FFFFFF;
|
||||
box-shadow: -2rpx 1rpx 3rpx 0rpx rgba(39, 39, 39, 0.11);
|
||||
height: 88rpx;
|
||||
position: absolute;
|
||||
top: 0rpx;
|
||||
right: 0rpx;
|
||||
z-index: 10075;
|
||||
}
|
||||
|
||||
.btn {
|
||||
color: #999999;
|
||||
font-size: 25rpx;
|
||||
letter-spacing: 2rpx;
|
||||
text-align: center;
|
||||
line-height: 88rpx;
|
||||
}
|
||||
|
||||
.complain_none {
|
||||
width: 15%;
|
||||
background: #FFFFFF;
|
||||
box-shadow: -2rpx 1rpx 3rpx 0rpx rgba(39, 39, 39, 0.11);
|
||||
height: 88rpx;
|
||||
position: absolute;
|
||||
top: 88rpx;
|
||||
right: 0rpx;
|
||||
|
||||
}
|
||||
|
||||
.popup_list {
|
||||
width: 97%;
|
||||
margin: 0 auto;
|
||||
position: relative;
|
||||
top: 90rpx;
|
||||
}
|
||||
|
||||
.list_tabs {
|
||||
width: 90%;
|
||||
height: auto;
|
||||
display: flex;
|
||||
justify-content: start;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.tabs {
|
||||
border: 1rpx solid #cccccc;
|
||||
padding: 0rpx 25rpx;
|
||||
line-height: 50rpx;
|
||||
margin: 10rpx 10rpx;
|
||||
}
|
||||
|
||||
/* 全部 */
|
||||
.complain_box {
|
||||
width: 90%;
|
||||
margin: 0 auto;
|
||||
/* height: 300rpx; */
|
||||
background: #ffffff;
|
||||
margin-top: 30rpx;
|
||||
border-radius: 17rpx;
|
||||
}
|
||||
|
||||
.complain_part1 {
|
||||
width: 90%;
|
||||
margin: 0 auto;
|
||||
display: flex;
|
||||
/* padding-top: 20rpx; */
|
||||
}
|
||||
|
||||
.part1_left {
|
||||
flex: 1;
|
||||
font-size: 26rpx;
|
||||
font-weight: bold;
|
||||
letter-spacing: 2rpx;
|
||||
height: 80rpx;
|
||||
justify-content: left;
|
||||
align-items: center;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.part1_right {
|
||||
flex: 1;
|
||||
color: #FF1B1B;
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.complain_part2 {
|
||||
width: 90%;
|
||||
margin: 0 auto;
|
||||
height: 50rpx;
|
||||
display: flex;
|
||||
justify-content: left;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.complain_part2 image {
|
||||
width: 15rpx;
|
||||
height: 15rpx;
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
|
||||
.complain_part2 text {
|
||||
color: #999999;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
|
||||
.u-line {
|
||||
border-bottom-width: 3px !important;
|
||||
margin-top: 20rpx !important;
|
||||
}
|
||||
|
||||
.complain_title {
|
||||
width: 90%;
|
||||
margin: 0 auto;
|
||||
height: 80rpx;
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
align-items: center;
|
||||
color: #FF2727;
|
||||
font-size: 27rpx;
|
||||
font-weight: bold;
|
||||
letter-spacing: 2rpx;
|
||||
}
|
||||
</style>
|
||||
129
my/other/set.vue
Normal file
129
my/other/set.vue
Normal file
@@ -0,0 +1,129 @@
|
||||
<template>
|
||||
<view class=" padding-lr">
|
||||
<view class="flex padding-tb" v-if="userId" @click="goNav('/pages/my/pwd')">
|
||||
<view class="flex-sub text-df" style="line-height: 50upx;">修改密码</view>
|
||||
<image src="../../static/images/my/right.png" style="line-height: 50upx;width: 18rpx;height: 30rpx;">
|
||||
</image>
|
||||
</view>
|
||||
<view class="flex padding-tb" @click="goNav('/my/other/help')">
|
||||
<view class="flex-sub text-df" style="line-height: 50upx;">帮助中心</view>
|
||||
<image src="../../static/images/my/right.png" style="line-height: 50upx;width: 18rpx;height: 30rpx;">
|
||||
</image>
|
||||
</view>
|
||||
<view class="flex padding-tb" @click="goNav('/my/other/xieyi')">
|
||||
<view class="flex-sub text-df" style="line-height: 50upx;">用户协议</view>
|
||||
<image src="../../static/images/my/right.png" style="line-height: 50upx;width: 18rpx;height: 30rpx;">
|
||||
</image>
|
||||
</view>
|
||||
<view class="flex padding-tb" @click="goNav('/my/other/mimi')">
|
||||
<view class="flex-sub text-df" style="line-height: 50upx;">隐私政策</view>
|
||||
<image src="../../static/images/my/right.png" style="line-height: 50upx;width: 18rpx;height: 30rpx;">
|
||||
</image>
|
||||
</view>
|
||||
<view class="flex padding-tb" @click="goNav('/my/other/about')">
|
||||
<view class="flex-sub text-df" style="line-height: 50upx;">关于我们</view>
|
||||
<image src="../../static/images/my/right.png" style="line-height: 50upx;width: 18rpx;height: 30rpx;">
|
||||
</image>
|
||||
</view>
|
||||
<view class="btn" v-if="userId" @click="TuiLogin">退出登录</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
userId: ""
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.userId = uni.getStorageSync('userId')
|
||||
},
|
||||
methods: {
|
||||
goNav(e) {
|
||||
uni.navigateTo({
|
||||
url: e
|
||||
})
|
||||
},
|
||||
//退出登录
|
||||
TuiLogin() {
|
||||
let that = this
|
||||
|
||||
if (that.userId) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '确定退出登录吗?',
|
||||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
console.log('用户点击确定');
|
||||
uni.removeStorageSync('shopUserName')
|
||||
uni.removeStorageSync('shopCover')
|
||||
uni.removeStorageSync('userId')
|
||||
uni.removeStorageSync('token')
|
||||
uni.removeStorageSync('mobile')
|
||||
uni.removeStorageSync('zhiFuBaoName')
|
||||
uni.removeStorageSync('zhiFuBao')
|
||||
uni.removeStorageSync('invitationCode')
|
||||
uni.removeStorageSync('unionId')
|
||||
uni.removeStorageSync('openId')
|
||||
uni.removeStorageSync('shopToken')
|
||||
uni.removeStorageSync('shopId')
|
||||
uni.showToast({
|
||||
title: '退出成功!',
|
||||
icon: 'none'
|
||||
})
|
||||
uni.navigateBack()
|
||||
// that.isLogin = true
|
||||
// that.shopName = '匿名'
|
||||
// this.sumMoney = 0 //累计余额
|
||||
// this.dayMoney = 0 //今日收益
|
||||
// this.monthMoney = 0 //本月收益
|
||||
// this.cashMoney = 0 //本月提现
|
||||
// that.shopCover = '../../static/logo.png'
|
||||
// that.userId = uni.getStorageSync('userId')
|
||||
} else if (res.cancel) {
|
||||
console.log('用户点击取消');
|
||||
}
|
||||
}
|
||||
})
|
||||
} else {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '您还未登录,请先登录',
|
||||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
console.log('用户点击确定');
|
||||
uni.navigateTo({
|
||||
url: '/pages/my/loginphone'
|
||||
})
|
||||
} else if (res.cancel) {
|
||||
console.log('用户点击取消');
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
page {
|
||||
background: #FFFFFF;
|
||||
}
|
||||
|
||||
.btn {
|
||||
width: 100%;
|
||||
height: 80upx;
|
||||
background: #FCD202;
|
||||
border-radius: 6upx;
|
||||
text-align: center;
|
||||
line-height: 80upx;
|
||||
margin-top: 40upx;
|
||||
font-size: 34upx;
|
||||
/* color: #fff; */
|
||||
}
|
||||
</style>
|
||||
363
my/other/tousu.vue
Normal file
363
my/other/tousu.vue
Normal file
@@ -0,0 +1,363 @@
|
||||
<template>
|
||||
<view class="content">
|
||||
<!-- <view class="complain_cont">
|
||||
<view class="complain_tabs" v-show="!isShow">
|
||||
<u-tabs :list="list" :is-scroll="true" name="illegal" :current="current" active-color="#FF7F00"
|
||||
@change="change"></u-tabs>
|
||||
</view>
|
||||
</view> -->
|
||||
<!-- <u-tabs :list="listTab" :is-scroll="false" inactive-color="#333333" active-color="#FF7F00" :current="currentIndex" @change="changeTab">
|
||||
</u-tabs> -->
|
||||
<view class="tabs_box dis">
|
||||
<!-- 全部 -->
|
||||
<view class="complain_box padding-bottom-xs" v-for="(item,index) in orderlist" :key="index" @click="bindonline(item)">
|
||||
<view class="complain_part1 ">
|
||||
<view class="part1_left">{{item.shopIllegal}}</view>
|
||||
<!-- <view class="part1_left" v-if="item.complaintType=='2'">拒绝系统推单</view> -->
|
||||
<!-- <view class="part1_left" v-if="item.complaintType=='3'">残损违规</view> -->
|
||||
<!-- <view class="part1_right">扣款{{item.deductMoney}}元</view> -->
|
||||
<view class="complain_title">
|
||||
<span v-if="item.complaintState=='1'">投诉成功</span>
|
||||
<!-- <span v-if="item.complaintState=='2'">申诉中</span> -->
|
||||
<!-- <span v-if="item.complaintState=='3'">申诉未通过</span> -->
|
||||
<!-- <span v-if="item.complaintState=='4'">申诉通过</span> -->
|
||||
<span v-if="item.complaintState=='5'">投诉审核中</span>
|
||||
<span v-if="item.complaintState=='6'">投诉未通过</span>
|
||||
</view>
|
||||
</view>
|
||||
<view class="complain_part2" v-if="item.shopAddressDetail">
|
||||
<image src="../static/black.png"></image>
|
||||
<text>{{item.shopAddressDetail}}</text>
|
||||
</view>
|
||||
<view class="complain_part2" v-if="item.userAddressDetail">
|
||||
<image src="../static/orange.png"></image>
|
||||
<text>{{item.userAddressDetail}}</text>
|
||||
</view>
|
||||
<view class="complain_part2" v-if="item.complaintTime">
|
||||
<image src="../static/black.png"></image>
|
||||
<text>投诉时间:{{item.complaintTime}}</text>
|
||||
</view>
|
||||
<view class="complain_part2" v-if="item.indentNumber">
|
||||
<image src="../static/orange.png"></image>
|
||||
<text>订单号:{{item.indentNumber}}</text>
|
||||
</view>
|
||||
<!-- <u-line color="#E6E6E6" /> -->
|
||||
|
||||
</view>
|
||||
|
||||
<!-- <view class="empty" v-if="orderlist.length == 0">
|
||||
<view
|
||||
style="display: block; width: 90%; margin: 0 auto; position: fixed;top: 35%;left: 0rpx;right: 0rpx;text-align: center;">
|
||||
<image src="../../../static/image/empty.png" style="width: 300rpx;height: 300rpx;"></image>
|
||||
<view style="color: #CCCCCC;">暂无内容</view>
|
||||
</view>
|
||||
</view> -->
|
||||
<empty v-if="!orderlist.length" style="z-index:0;position: relative;top: -20px;"></empty>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import empty from '@/components/empty.vue'
|
||||
export default {
|
||||
components: {
|
||||
empty
|
||||
},
|
||||
data() {
|
||||
|
||||
return {
|
||||
isShow: false,
|
||||
page: 1,
|
||||
limit: 10,
|
||||
complaintType: null,
|
||||
complaintState: '',
|
||||
listTab: [{
|
||||
name: '全部'
|
||||
}, {
|
||||
name: '可申诉'
|
||||
}, {
|
||||
name: '申诉中'
|
||||
}, {
|
||||
name: '申诉未通过'
|
||||
}, {
|
||||
name: '申诉通过'
|
||||
}],
|
||||
currentIndex: 0,
|
||||
list: [{
|
||||
id: '',
|
||||
illegal: '全部'
|
||||
}],
|
||||
current: 0,
|
||||
orderlist: [],
|
||||
totalCount: 0,
|
||||
illegalId: ''
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
||||
},
|
||||
onLoad() {
|
||||
this.getTypeList()
|
||||
this.bindorder()
|
||||
},
|
||||
methods: {
|
||||
getTypeList() {
|
||||
this.$Request.getT('/app/illegalType/selectIllegalTypeList').then(res => {
|
||||
if (res.code == 0) {
|
||||
this.list = [...this.list, ...res.data]
|
||||
}
|
||||
});
|
||||
},
|
||||
bindlist(index) {
|
||||
console.log(index)
|
||||
|
||||
this.current = index;
|
||||
this.isShow = !this.isShow
|
||||
},
|
||||
// 获取全部数据
|
||||
bindorder() {
|
||||
this.$Request.getT('/app/shop/selectComplaint', {
|
||||
page: this.page,
|
||||
limit: this.limit,
|
||||
shopId:uni.getStorageSync('shopId')
|
||||
// complaintState: this.complaintState,
|
||||
// illegalId: this.illegalId
|
||||
}).then(res => {
|
||||
if (res.code == 0) {
|
||||
this.totalCount = res.data.totalCount
|
||||
if (this.page == 1) {
|
||||
this.orderlist = res.data.list
|
||||
} else {
|
||||
this.orderlist = this.list_box.concat(res.data.list)
|
||||
}
|
||||
} else {
|
||||
console.log('失败:', res.data)
|
||||
}
|
||||
});
|
||||
},
|
||||
change(index) {
|
||||
console.log(index)
|
||||
this.illegalId = this.list[index].id
|
||||
this.orderlist = []
|
||||
this.current = index;
|
||||
this.currentIndex = 0
|
||||
this.page = 1
|
||||
|
||||
this.complaintState = ''
|
||||
this.bindorder()
|
||||
},
|
||||
changeTab(index) {
|
||||
this.orderlist = []
|
||||
this.currentIndex = index
|
||||
this.page = 1
|
||||
if (index == 0) {
|
||||
this.complaintState = ''
|
||||
} else {
|
||||
this.complaintState = index
|
||||
}
|
||||
this.bindorder()
|
||||
},
|
||||
bindonline(item) {
|
||||
// if(item.complaintState == 1 || item.complaintState == 4) {
|
||||
uni.navigateTo({
|
||||
url: '/my/other/detail?indentNumber=' + item
|
||||
.indentNumber + '&complaintId=' + item.complaintId
|
||||
})
|
||||
// }
|
||||
},
|
||||
bindshow() {
|
||||
this.isShow = !this.isShow
|
||||
},
|
||||
},
|
||||
// 上拉加载
|
||||
onReachBottom: function() {
|
||||
if (this.page < this.totalCount) {
|
||||
this.page = this.page + 1;
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: '已经最后一页啦',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
this.bindorder();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
body {
|
||||
background-color: #F5F5F5;
|
||||
}
|
||||
|
||||
.empty {
|
||||
width: 100%;
|
||||
background: #ffffff;
|
||||
/* #ifdef MP-WEIXIN */
|
||||
height: 93vh;
|
||||
/* #endif */
|
||||
/* #ifndef MP-WEIXIN */
|
||||
height: 80vh;
|
||||
/* #endif */
|
||||
}
|
||||
|
||||
.u-tab-item {
|
||||
font-weight: 400 !important;
|
||||
color: #000000 !important;
|
||||
font-size: 24rpx !important;
|
||||
}
|
||||
|
||||
.tabs_box {
|
||||
/* display: none; */
|
||||
/* position: absolute; */
|
||||
/* top: 144rpx; */
|
||||
}
|
||||
|
||||
.dis {
|
||||
/* display: block; */
|
||||
/* width: 100%; */
|
||||
/* position: absolute; */
|
||||
/* top: 100rpx; */
|
||||
}
|
||||
|
||||
.content {
|
||||
width: 100%;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.complain_cont {
|
||||
width: 100%;
|
||||
position: relative;
|
||||
/* display: flex; */
|
||||
}
|
||||
|
||||
.complain_tabs {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.complain_btn {
|
||||
width: 15%;
|
||||
background: #FFFFFF;
|
||||
box-shadow: -2rpx 1rpx 3rpx 0rpx rgba(39, 39, 39, 0.11);
|
||||
height: 88rpx;
|
||||
position: absolute;
|
||||
top: 0rpx;
|
||||
right: 0rpx;
|
||||
z-index: 10075;
|
||||
}
|
||||
|
||||
.btn {
|
||||
color: #999999;
|
||||
font-size: 25rpx;
|
||||
letter-spacing: 2rpx;
|
||||
text-align: center;
|
||||
line-height: 88rpx;
|
||||
}
|
||||
|
||||
.complain_none {
|
||||
width: 15%;
|
||||
background: #FFFFFF;
|
||||
box-shadow: -2rpx 1rpx 3rpx 0rpx rgba(39, 39, 39, 0.11);
|
||||
height: 88rpx;
|
||||
position: absolute;
|
||||
top: 88rpx;
|
||||
right: 0rpx;
|
||||
|
||||
}
|
||||
|
||||
.popup_list {
|
||||
width: 97%;
|
||||
margin: 0 auto;
|
||||
position: relative;
|
||||
top: 90rpx;
|
||||
}
|
||||
|
||||
.list_tabs {
|
||||
width: 90%;
|
||||
height: auto;
|
||||
display: flex;
|
||||
justify-content: start;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.tabs {
|
||||
border: 1rpx solid #cccccc;
|
||||
padding: 0rpx 25rpx;
|
||||
line-height: 50rpx;
|
||||
margin: 10rpx 10rpx;
|
||||
}
|
||||
|
||||
/* 全部 */
|
||||
.complain_box {
|
||||
width: 90%;
|
||||
margin: 0 auto;
|
||||
/* height: 300rpx; */
|
||||
background: #ffffff;
|
||||
margin-top: 30rpx;
|
||||
border-radius: 17rpx;
|
||||
}
|
||||
|
||||
.complain_part1 {
|
||||
width: 90%;
|
||||
margin: 0 auto;
|
||||
display: flex;
|
||||
/* padding-top: 20rpx; */
|
||||
}
|
||||
|
||||
.part1_left {
|
||||
flex: 1;
|
||||
font-size: 26rpx;
|
||||
font-weight: bold;
|
||||
letter-spacing: 2rpx;
|
||||
height: 80rpx;
|
||||
justify-content: left;
|
||||
align-items: center;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.part1_right {
|
||||
flex: 1;
|
||||
color: #FF1B1B;
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.complain_part2 {
|
||||
width: 90%;
|
||||
margin: 0 auto;
|
||||
height: 50rpx;
|
||||
display: flex;
|
||||
justify-content: left;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.complain_part2 image {
|
||||
width: 15rpx;
|
||||
height: 15rpx;
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
|
||||
.complain_part2 text {
|
||||
color: #999999;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
|
||||
.u-line {
|
||||
border-bottom-width: 3px !important;
|
||||
margin-top: 20rpx !important;
|
||||
}
|
||||
|
||||
.complain_title {
|
||||
/* width: 90%; */
|
||||
margin: 0 auto;
|
||||
height: 80rpx;
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
align-items: center;
|
||||
color: #FF2727;
|
||||
font-size: 27rpx;
|
||||
font-weight: bold;
|
||||
letter-spacing: 2rpx;
|
||||
}
|
||||
</style>
|
||||
253
my/other/wallet.vue
Normal file
253
my/other/wallet.vue
Normal file
@@ -0,0 +1,253 @@
|
||||
<template>
|
||||
<view class="content">
|
||||
<view style="background: #FFFFFF;">
|
||||
<view class="view1" style="text-align: center;">
|
||||
<view class="view_top">
|
||||
<view class="view_name">总资产(元)</view>
|
||||
<view style="font-size: 29px;">{{ money }}<text
|
||||
style="font-size: 31rpx;margin-left: 15rpx;">元</text></view>
|
||||
<!-- <view class="margin-top padding-top">累计提现金额:{{ totalMoney }}元</view> -->
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="view2-views">
|
||||
<view class="view2_box">
|
||||
<view class="name">账户余额(元)</view>
|
||||
<view class="money">{{money}}</view>
|
||||
</view>
|
||||
<view class="btn" @tap="getOut">提现</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="view2">
|
||||
<view class="view2-view" @tap="moneyList">
|
||||
<image src="https://api.shengqianxiong.com.cn/img/20201118/22f17a68dc7446d6bef8e0a7a6cbac55.png"
|
||||
class="view2-view-image"></image>
|
||||
<view class="view2-view1">
|
||||
<view class="view2-view-text">钱包明细</view>
|
||||
<image
|
||||
src="https://api.shengqianxiong.com.cn/file/uploadPath/2021/10/08/9a7ea5f18fae76c2f9c9d5b3e8323f4e.png"
|
||||
class="view2-view-image-right"></image>
|
||||
</view>
|
||||
</view>
|
||||
<view class="view2-view" @click="goZhifuBao">
|
||||
<image src="https://api.shengqianxiong.com.cn/img/20201118/86efb280c3d2416e86e7b1900bbe17ff.png"
|
||||
class="view2-view-image"></image>
|
||||
<view class="view2-view1">
|
||||
<view class="view2-view-text">提现账号</view>
|
||||
<image
|
||||
src="https://api.shengqianxiong.com.cn/file/uploadPath/2021/10/08/9a7ea5f18fae76c2f9c9d5b3e8323f4e.png"
|
||||
class="view2-view-image-right"></image>
|
||||
</view>
|
||||
</view>
|
||||
<view class="view2-view" @tap="list">
|
||||
<image src="https://api.shengqianxiong.com.cn/img/20201118/5ce91ac860334fc9ac09c977467607cd.png"
|
||||
class="view2-view-image"></image>
|
||||
<view class="view2-view1">
|
||||
<view class="view2-view-text">提现记录</view>
|
||||
<image
|
||||
src="https://api.shengqianxiong.com.cn/file/uploadPath/2021/10/08/9a7ea5f18fae76c2f9c9d5b3e8323f4e.png"
|
||||
class="view2-view-image-right"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
money: '0.00',
|
||||
zhifubao: '',
|
||||
walletmoney: '0.00',
|
||||
totalMoney: '0.00',
|
||||
zhifubaoName: '',
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.getwalletMoney();
|
||||
},
|
||||
onShow: function(e) {
|
||||
// this.getMoney();
|
||||
this.getwalletMoney();
|
||||
},
|
||||
methods: {
|
||||
ketixian() {
|
||||
uni.showModal({
|
||||
showCancel: false,
|
||||
confirmColor: '#e10a07',
|
||||
title: '可提现金额说明',
|
||||
content: '可提现金额是我们通过在商城中购买商品后返利的佣金,这个金额是可提现的'
|
||||
});
|
||||
},
|
||||
leijitixian() {
|
||||
uni.showModal({
|
||||
showCancel: false,
|
||||
confirmColor: '#e10a07',
|
||||
title: '累计提现金额说明',
|
||||
content: '累计提现金额是我们过往提现成功金额的总计'
|
||||
});
|
||||
},
|
||||
moneyList() {
|
||||
uni.navigateTo({
|
||||
url: '/my/other/cashList'
|
||||
})
|
||||
},
|
||||
list() {
|
||||
uni.navigateTo({
|
||||
url: '/my/other/moneydetail'
|
||||
})
|
||||
},
|
||||
goZhifuBao() {
|
||||
uni.navigateTo({
|
||||
url: "/my/other/zhifubao"
|
||||
})
|
||||
},
|
||||
//获取账户余额
|
||||
getwalletMoney() {
|
||||
this.$Request.getT('/shop/shopmoney/selectShopMoney').then(res => {
|
||||
if (res.code == 0) {
|
||||
this.money = res.data.money;
|
||||
}
|
||||
uni.hideLoading();
|
||||
});
|
||||
},
|
||||
// getMoney() {
|
||||
// let that = this;
|
||||
// let token = this.$queue.getData("token");
|
||||
// let userId = this.$queue.getData("userId");
|
||||
// if (token) {
|
||||
// //this.$queue.showLoading("加载中...");
|
||||
// //可以提现金额查询预估收入查询
|
||||
// this.$Request.getT("/cash/money/" + userId).then(res => {
|
||||
// if (res.status === 0 && res.data) {
|
||||
// // that.money = parseFloat(res.data).toFixed(2);
|
||||
// } else if (res.status === -102) {
|
||||
// this.$queue.showToast(res.msg);
|
||||
// this.$queue.logout();
|
||||
// uni.navigateTo({
|
||||
// url: '/pages/member/register'
|
||||
// });
|
||||
// } else {
|
||||
// // that.money = '0.00';
|
||||
// //this.$queue.showToast(res.msg);
|
||||
// }
|
||||
// });
|
||||
// this.$Request.getT("/cash/userinfo/" + userId).then(res => {
|
||||
// if (res.status === 0 && res.data) {
|
||||
// that.zhifubao = res.data.zhifubao;
|
||||
// that.zhifubaoName = res.data.zhifubaoName;
|
||||
// }
|
||||
// uni.hideLoading();
|
||||
// });
|
||||
// //总的提现记录
|
||||
// this.$Request.getT("/cash/countByRelationId/" + this.$queue.getData("relation_id")).then(res => {
|
||||
// if (res.status === 0 && res.data) {
|
||||
// that.totalMoney = parseFloat(res.data).toFixed(2);
|
||||
// } else {
|
||||
// that.totalMoney = '0.00';
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
|
||||
// },
|
||||
getOut() {
|
||||
uni.navigateTo({
|
||||
url: '/my/other/cashDetail'
|
||||
});
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang='less'>
|
||||
/* @import "../../static/css/index.css"; */
|
||||
|
||||
.view_top {
|
||||
padding: 35rpx 55rpx;
|
||||
}
|
||||
|
||||
.view_name {
|
||||
font-size: 32rpx;
|
||||
letter-spacing: 2rpx;
|
||||
font-family: serif;
|
||||
margin-bottom: 10rpx;
|
||||
}
|
||||
|
||||
.view1 {
|
||||
width: 90%;
|
||||
margin: 0 auto;
|
||||
height: 320rpx;
|
||||
border-radius: 16upx;
|
||||
/* color: #FFFFFF; */
|
||||
background: linear-gradient(to right, #FCB202 0, #FCD202 100%);
|
||||
}
|
||||
|
||||
.view2 {
|
||||
background-color: #ffffff;
|
||||
margin-top: 15rpx;
|
||||
|
||||
}
|
||||
|
||||
.name {
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
.money {
|
||||
margin-top: 12rpx;
|
||||
font-size: 48rpx;
|
||||
}
|
||||
|
||||
.btn {
|
||||
background: #FCD202;
|
||||
/* color: white; */
|
||||
text-align: center;
|
||||
width: 24%;
|
||||
padding: 16rpx 0rpx;
|
||||
border-radius: 6rpx;
|
||||
}
|
||||
|
||||
.view2-view {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
height: 110rpx;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.view2-views {
|
||||
display: flex;
|
||||
width: 90%;
|
||||
margin: 0 auto;
|
||||
height: 140rpx;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
margin-top: 30rpx;
|
||||
}
|
||||
|
||||
.view2-view1 {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
width: 90%;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.view2-view-image {
|
||||
margin-left: 40upx;
|
||||
width: 50upx;
|
||||
height: 50upx;
|
||||
}
|
||||
|
||||
.view2-view-text {
|
||||
font-size: 14px;
|
||||
color: #000000;
|
||||
margin-left: 40upx;
|
||||
width: 80%;
|
||||
}
|
||||
|
||||
.view2-view-image-right {
|
||||
width: 19rpx;
|
||||
height: 31rpx;
|
||||
margin-left: 30rpx;
|
||||
}
|
||||
</style>
|
||||
44
my/other/xieyi.vue
Normal file
44
my/other/xieyi.vue
Normal file
@@ -0,0 +1,44 @@
|
||||
<template>
|
||||
<view style="line-height: 26px;padding: 32upx;" class="bg-white">
|
||||
<!-- <view v-html="tit"> </view> -->
|
||||
<view style="font-size: 28upx;" v-html="content"></view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
tit: '',
|
||||
content: ''
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
// this.getGuize();
|
||||
// 用户协议
|
||||
this.$Request.getT('/app/common/type/236').then(res => { //用户完成成功
|
||||
if (res.code == 0) {
|
||||
if (res.data && res.data.value) {
|
||||
this.content = res.data.value;
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
getGuize() {
|
||||
this.$Request.getT('/app/userinfo/userAgreement').then(res => {
|
||||
if (res.code == 0) {
|
||||
this.content = res.data.value;
|
||||
// this.tit = res.data.min
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
page {
|
||||
background: #FFFFFF;
|
||||
}
|
||||
</style>
|
||||
151
my/other/zhifubao.vue
Normal file
151
my/other/zhifubao.vue
Normal file
@@ -0,0 +1,151 @@
|
||||
<template>
|
||||
<view class="container" v-if="XCXIsSelect=='是'">
|
||||
<list-cell title="收款人姓名" type="text" placeholder="请输入支付宝收款人姓名" v-model="zhiFuBaoName"></list-cell>
|
||||
|
||||
<list-cell title="支付宝账号" type="text" placeholder="请输入要绑定的支付宝账号" v-model="zhiFuBao"></list-cell>
|
||||
|
||||
<wButton text="绑定账户" :rotate="logining" @click.native="toLogin()"></wButton>
|
||||
<view style="padding: 32upx 64upx;font-size: 24upx;color: #999999;">提示:请正确填写收款人的支付宝账户和真实的收款人姓名,否则将无法正常收款</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import listCell from '../components/com-input';
|
||||
import wButton from '../components/watch-login/watch-button.vue'; //button
|
||||
export default {
|
||||
components: {
|
||||
listCell,
|
||||
wButton
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
zhiFuBao: '',
|
||||
zhiFuBaoName: '',
|
||||
logining: false,
|
||||
XCXIsSelect: '否'
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
// #ifdef MP-WEIXIN
|
||||
this.XCXIsSelect = this.$queue.getData('XCXIsSelect');
|
||||
// #endif
|
||||
// #ifndef MP-WEIXIN
|
||||
this.XCXIsSelect = '是'
|
||||
// #endif
|
||||
if (this.XCXIsSelect == '否') {
|
||||
uni.setNavigationBarTitle({
|
||||
title: '隐私政策'
|
||||
});
|
||||
} else {
|
||||
uni.setNavigationBarTitle({
|
||||
title: '提现账号'
|
||||
});
|
||||
}
|
||||
this.getUserInfo()
|
||||
let userId = this.$queue.getData("userId");
|
||||
if (userId) {
|
||||
|
||||
this.$Request.get("/sys/user/info").then(res => {
|
||||
if (res.code == 0) {
|
||||
if (res.user.userEntity.zhiFuBao) {
|
||||
this.zhiFuBao = res.user.userEntity.zhiFuBao;
|
||||
}
|
||||
if (res.user.userEntity.zhiFuBaoName) {
|
||||
this.zhiFuBaoName = res.user.userEntity.zhiFuBaoName;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
methods: {
|
||||
inputChange(e) {
|
||||
const key = e.currentTarget.dataset.key;
|
||||
this[key] = e.detail.value;
|
||||
},
|
||||
navBack() {
|
||||
uni.navigateBack();
|
||||
},
|
||||
|
||||
toLogin() {
|
||||
let userId = this.$queue.getData("userId");
|
||||
let token = uni.getStorageSync("token");
|
||||
const {
|
||||
zhiFuBao,
|
||||
zhiFuBaoName
|
||||
} = this;
|
||||
if (!zhiFuBao) {
|
||||
this.$queue.showToast("请设置收款人支付宝账号");
|
||||
} else if (!zhiFuBaoName) {
|
||||
this.$queue.showToast("请设置收款人姓名");
|
||||
} else {
|
||||
this.$queue.showLoading("修改中...");
|
||||
let data = {
|
||||
zhiFuBao: this.zhiFuBao,
|
||||
zhiFuBaoName: this.zhiFuBaoName
|
||||
}
|
||||
this.$Request.postJson('/shop/shopmoney/updateUser', data).then(res => {
|
||||
if (res.code === 0) {
|
||||
// uni.setStorageSync('zhiFuBao',zhiFuBao)
|
||||
// uni.setStorageSync('zhiFuBaoName',zhiFuBaoName)
|
||||
uni.showToast({
|
||||
title: '修改成功',
|
||||
icon: 'none',
|
||||
complete() {
|
||||
setTimeout(function() {
|
||||
uni.navigateBack();
|
||||
}, 1000)
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$queue.showToast(res.msg)
|
||||
}
|
||||
uni.hideLoading();
|
||||
});
|
||||
}
|
||||
},
|
||||
getUserInfo() {
|
||||
this.$Request.getA("/sys/user/info").then(res => {
|
||||
if (res.code == 0) {
|
||||
this.$queue.setData("zhiFuBao", res.user.userEntity.zhiFuBao);
|
||||
this.$queue.setData("zhiFuBaoName", res.user.userEntity.zhiFuBaoName);
|
||||
}
|
||||
});
|
||||
},
|
||||
},
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang='scss'>
|
||||
page {
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
|
||||
.container {
|
||||
padding-top: 32upx;
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
background: #FFFFFF;
|
||||
}
|
||||
|
||||
.confirm-btn {
|
||||
width: 300px;
|
||||
height: 42px;
|
||||
line-height: 42px;
|
||||
border-radius: 30px;
|
||||
margin-top: 70upx;
|
||||
background: #e10a07;
|
||||
color: #fff;
|
||||
font-size: 32rpx;
|
||||
|
||||
&:after {
|
||||
border-radius: 60px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
957
my/publish/goods.vue
Normal file
957
my/publish/goods.vue
Normal 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
229
my/publish/guigeitem.vue
Normal 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
821
my/publish/index.vue
Normal file
@@ -0,0 +1,821 @@
|
||||
<template>
|
||||
<view class="padding" v-if="XCXIsSelect!='否'">
|
||||
<view style="padding-bottom: 20upx;color: red;" v-if="auditReason && shop.status == 2">拒绝原因:{{auditReason}}</view>
|
||||
<view class="text-white padding bg radius">
|
||||
<u-form :model="shop" label-position="top">
|
||||
<!-- <u-form-item label="入驻学校">
|
||||
<u-input v-model="schoolName" placeholder="请输入入驻学校(选填)" disabled @click="show1 = true" />
|
||||
</u-form-item>
|
||||
<u-form-item label="入驻学区">
|
||||
<u-input v-model="shop.schoolName" placeholder="请输入入驻学区(选填)" disabled @click="show2 = true" />
|
||||
</u-form-item> -->
|
||||
<u-form-item label="商铺主营类型">
|
||||
<u-input v-model="shop.shopTypeName" placeholder="请输入商铺主营类型" disabled @click="show = true" />
|
||||
</u-form-item>
|
||||
<u-form-item label="商铺名称">
|
||||
<u-input v-model="shop.name" placeholder="请填写 (必填)" />
|
||||
</u-form-item>
|
||||
<u-form-item label="省市区">
|
||||
<u-input v-model="shop.address" disabled placeholder="请填写" @click="bindOpen" />
|
||||
</u-form-item>
|
||||
|
||||
<u-form-item label="商铺详细地址">
|
||||
<!-- <u-input v-model="shop.detailedAddress" placeholder="请填写" /> -->
|
||||
<textarea v-model="shop.detailedAddress" placeholder-style="color: #aaaaaa;font-size: 28rpx;"
|
||||
placeholder="请填写商铺详细地址" style="height: 120rpx;width: 100%;font-size: 28rpx;" />
|
||||
</u-form-item>
|
||||
</u-form>
|
||||
</view>
|
||||
|
||||
<view class="text-white padding bg radius margin-top">
|
||||
<u-form :model="shop" label-position="top">
|
||||
<u-form-item label="联系人姓名">
|
||||
<u-input v-model="shop.userName" placeholder="请输入真实姓名" />
|
||||
</u-form-item>
|
||||
<u-form-item label="身份证号">
|
||||
<u-input v-model="shop.isNumber" maxlength="20" placeholder="请填写 (必填)" />
|
||||
</u-form-item>
|
||||
<u-form-item label="联系电话">
|
||||
<u-input v-model="shop.phone" type="number" placeholder="请填写 (必填)" />
|
||||
</u-form-item>
|
||||
<u-form-item label="验证码" v-if="shop.status == null||shop.status == 2">
|
||||
<!-- #ifndef MP-WEIXIN -->
|
||||
<u-input v-model="shop.verCode" type="number" placeholder="请填写 (必填)"
|
||||
style="width: 50%;" />
|
||||
<!-- #endif -->
|
||||
<!-- #ifdef MP-WEIXIN -->
|
||||
<u-input v-model="shop.verCode" type="number" placeholder="请填写 (必填)"
|
||||
style="width: 50%;display: inline-block;" />
|
||||
<!-- #endif -->
|
||||
<button class="send-msg" @click="sendMsg">{{sendTime}}</button>
|
||||
</u-form-item>
|
||||
</u-form>
|
||||
</view>
|
||||
|
||||
<view class="text-white padding bg radius margin-tb">
|
||||
<view>
|
||||
<view class="text-lg margin-top-sm text-black">店铺logo</view>
|
||||
<view class="flex" style="overflow: hidden;flex-wrap: wrap;">
|
||||
<view v-if="detailsImg.length">
|
||||
<view class="margin-top flex margin-right-sm flex-wrap">
|
||||
<view class="flex"
|
||||
style="width: 200rpx;height: 200rpx;margin-right: 2rpx;position: relative;">
|
||||
<image :src="detailsImg" style="width: 100%;height: 100%;"></image>
|
||||
<view style="z-index: 9;position: absolute;top: -15rpx;right: -15rpx;"
|
||||
@click="removeImg(1)">
|
||||
<u-icon name="close-circle-fill" color="#2979ff" size="50rpx"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="margin-top" @click="addImages(2)" v-if="detailsImg.length<=0">
|
||||
<view style="width: 200rpx;height: 200rpx;background: #f4f5f6;"
|
||||
class="flex justify-center align-center">
|
||||
<view>
|
||||
<view class="text-center">
|
||||
<image src="../static/addimg.png" style="width: 65rpx;height: 55rpx;">
|
||||
</image>
|
||||
</view>
|
||||
<view class="text-center text-black">添加图片</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view>
|
||||
<view class="text-lg margin-top-sm text-black">营业执照</view>
|
||||
<view class="flex" style="overflow: hidden;flex-wrap: wrap;">
|
||||
<view v-if="shop.business.length">
|
||||
<view class="margin-top flex margin-right-sm flex-wrap">
|
||||
<view class="flex"
|
||||
style="width: 200rpx;height: 200rpx;margin-right: 2rpx;position: relative;">
|
||||
<image :src="shop.business" style="width: 100%;height: 100%;"></image>
|
||||
<view style="z-index: 9;position: absolute;top: -15rpx;right: -15rpx;"
|
||||
@click="removeImgs(1)">
|
||||
<u-icon name="close-circle-fill" color="#2979ff" size="50rpx"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="margin-top" @click="addImage(1)" v-if="shop.business.length<=0">
|
||||
<view style="width: 200rpx;height: 200rpx;background: #f4f5f6;"
|
||||
class="flex justify-center align-center">
|
||||
<view>
|
||||
<view class="text-center">
|
||||
<image src="../static/addimg.png" style="width: 65rpx;height: 55rpx;">
|
||||
</image>
|
||||
</view>
|
||||
<view class="text-center text-black">添加图片</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view>
|
||||
<view class="text-lg margin-top-sm text-black">身份证正面</view>
|
||||
<view class="flex" style="overflow: hidden;flex-wrap: wrap;">
|
||||
<view v-if="shop.front.length">
|
||||
<view class="margin-top flex margin-right-sm flex-wrap">
|
||||
<view class="flex"
|
||||
style="width: 200rpx;height: 200rpx;margin-right: 2rpx;position: relative;">
|
||||
<image :src="shop.front" style="width: 100%;height: 100%;"></image>
|
||||
<view style="z-index: 9;position: absolute;top: -15rpx;right: -15rpx;"
|
||||
@click="removeImgs(2)">
|
||||
<u-icon name="close-circle-fill" color="#2979ff" size="50rpx"></u-icon>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="margin-top" @click="addImage(2)" v-if="shop.front.length<=0">
|
||||
<view style="width: 200rpx;height: 200rpx;background: #f4f5f6;"
|
||||
class="flex justify-center align-center">
|
||||
<view>
|
||||
<view class="text-center">
|
||||
<image src="../static/addimg.png" style="width: 65rpx;height: 55rpx;">
|
||||
</image>
|
||||
</view>
|
||||
<view class="text-center text-black">添加图片</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view>
|
||||
<view class="text-lg margin-top-sm text-black">身份证反面片</view>
|
||||
<view class="flex" style="overflow: hidden;flex-wrap: wrap;">
|
||||
<view v-if="shop.back.length">
|
||||
<view class="margin-top flex margin-right-sm flex-wrap">
|
||||
<view class="flex"
|
||||
style="width: 200rpx;height: 200rpx;margin-right: 2rpx;position: relative;">
|
||||
<image :src="shop.back" style="width: 100%;height: 100%;"></image>
|
||||
<view style="z-index: 9;position: absolute;top: -15rpx;right: -15rpx;"
|
||||
@click="removeImgs(3)">
|
||||
<u-icon name="close-circle-fill" color="#2979ff" size="50rpx"></u-icon>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="margin-top" @click="addImage(3)" v-if="shop.back.length<=0">
|
||||
<view style="width: 200rpx;height: 200rpx;background: #f4f5f6;"
|
||||
class="flex justify-center align-center">
|
||||
<view>
|
||||
<view class="text-center">
|
||||
<image src="../static/addimg.png" style="width: 65rpx;height: 55rpx;">
|
||||
</image>
|
||||
</view>
|
||||
<view class="text-center text-black">添加图片</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<u-button v-if="shop.status == null || shop.status == 2" @click="submit" class="margin-top"
|
||||
:custom-style="customStyle" shape="square" :hair-line="false">提交审核
|
||||
</u-button>
|
||||
<u-button v-if="shop.status == 0" class="margin-top" disabled :custom-style="customStyle" shape="square"
|
||||
:hair-line="false">审核中
|
||||
</u-button>
|
||||
<!-- 分类列表 -->
|
||||
<u-select v-model="show" :list="shopList" valueName='id' labelName="shopTypeName" @confirm="confirm"></u-select>
|
||||
|
||||
<!-- 学校列表 -->
|
||||
<u-select v-model="show1" :list="shopList1" valueName='schoolId' labelName="schoolName" @confirm="confirms">
|
||||
</u-select>
|
||||
<!-- 校区列表 -->
|
||||
<u-select v-model="show2" :list="shopList2" valueName='schoolId' labelName="schoolName" @confirm="confirm1">
|
||||
</u-select>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import configdata from '@/common/config.js';
|
||||
export default {
|
||||
|
||||
data() {
|
||||
return {
|
||||
shop: {
|
||||
schoolName: '',
|
||||
schoolId: '',
|
||||
|
||||
type: '',
|
||||
typeid: '',
|
||||
name: '',
|
||||
address: '',
|
||||
shopTypeName: '',
|
||||
detailedAddress: '',
|
||||
userName: '',
|
||||
isNumber: '',
|
||||
phone: '',
|
||||
verCode: '',
|
||||
latitude: '',
|
||||
longitude: '',
|
||||
//详情图
|
||||
detailsImg: [],
|
||||
business: '',
|
||||
front: '',
|
||||
back: ""
|
||||
},
|
||||
customStyle: {
|
||||
backgroundColor: '#FFCC00',
|
||||
color: '#000000',
|
||||
border: 0
|
||||
},
|
||||
status: 1,
|
||||
//详情图
|
||||
detailsImg: [],
|
||||
shopId: '',
|
||||
page: 1,
|
||||
limit: 100,
|
||||
show: false,
|
||||
show1: false,
|
||||
show2: false,
|
||||
shopList: [],
|
||||
city: '',
|
||||
province: '',
|
||||
district: '',
|
||||
auditReason: '',
|
||||
Settedlist: [],
|
||||
sending: false,
|
||||
sendTime: '获取验证码',
|
||||
count: 60,
|
||||
XCXIsSelect: '是',
|
||||
platform: "h5",
|
||||
shopList1: [],
|
||||
shopList2: [],
|
||||
schoolName: '',
|
||||
schoolId: '',
|
||||
}
|
||||
},
|
||||
onLoad(option) {
|
||||
this.XCXIsSelect = this.$queue.getData('XCXIsSelect');
|
||||
if (this.XCXIsSelect == '否') {
|
||||
uni.setNavigationBarTitle({
|
||||
title: '隐私政策'
|
||||
});
|
||||
} else {
|
||||
uni.setNavigationBarTitle({
|
||||
title: '商家入驻'
|
||||
});
|
||||
}
|
||||
// uni.getLocation({
|
||||
// type: 'gcj02',
|
||||
// success: (res) => {
|
||||
// console.log(res.latitude);
|
||||
// console.log(res.longitude);
|
||||
// console.log("res___:" + JSON.stringify(res));
|
||||
// },
|
||||
// fail(e) {
|
||||
// console.log(e);
|
||||
// }
|
||||
// });
|
||||
|
||||
this.Settedlist = uni.getStorageSync("Settedlist")
|
||||
if (this.Settedlist) {
|
||||
this.shopId = this.Settedlist.shopId
|
||||
this.auditReason = this.Settedlist.auditReason
|
||||
this.shop.name = this.Settedlist.shopName
|
||||
this.shop.typeid = this.Settedlist.shopTypeId
|
||||
this.shop.shopTypeName = this.Settedlist.shopTypeName
|
||||
this.shop.address = this.Settedlist.province + this.Settedlist.city + this.Settedlist.district
|
||||
this.shop.detailedAddress = this.Settedlist.detailedAddress
|
||||
this.shop.latitude = this.Settedlist.shopLat
|
||||
this.shop.longitude = this.Settedlist.shopLng
|
||||
this.province = this.Settedlist.province
|
||||
this.city = this.Settedlist.city
|
||||
this.district = this.Settedlist.district
|
||||
this.shop.status = this.Settedlist.status
|
||||
this.shop.userName = this.Settedlist.realName
|
||||
this.shop.isNumber = this.Settedlist.identitycardNumber
|
||||
this.shop.phone = this.Settedlist.phone
|
||||
this.shop.business = this.Settedlist.businessLicense
|
||||
this.shop.front = this.Settedlist.identitycardPro
|
||||
this.shop.back = this.Settedlist.identitycardCon
|
||||
this.shop.detailsImg = this.Settedlist.shopCover
|
||||
this.detailsImg = this.Settedlist.shopCover.split(',')
|
||||
uni.removeStorageSync("Settedlist")
|
||||
}
|
||||
this.getShopList()
|
||||
let token = this.$queue.getData('XCXIsSelect');
|
||||
if (token) {
|
||||
this.getData()
|
||||
}
|
||||
|
||||
},
|
||||
onShow() {
|
||||
|
||||
},
|
||||
onHide() {
|
||||
|
||||
},
|
||||
methods: {
|
||||
getData() {
|
||||
this.$Request.get("/app/shop/selectShopByUserId").then(res => {
|
||||
if (res.code == 0 && res.data) {
|
||||
this.auditReason = res.data.auditReason
|
||||
|
||||
this.shop.shopTypeName = res.data.shopTypeName
|
||||
this.shop.name = res.data.shopName
|
||||
this.shop.address = res.data.province + res.data.city + res.data.district
|
||||
this.shop.detailedAddress = res.data.detailedAddress
|
||||
this.shop.userName = res.data.realName
|
||||
this.shop.isNumber = res.data.identitycardNumber
|
||||
this.shop.phone = res.data.phone
|
||||
|
||||
this.shop.detailsImg = res.data.shopCover //商铺图片
|
||||
this.detailsImg = res.data.shopCover.split(',')
|
||||
this.shop.business = res.data.businessLicense //营业执照
|
||||
this.shop.front = res.data.identitycardPro //身份证正面
|
||||
this.shop.back = res.data.identitycardCon //身份证反面
|
||||
|
||||
this.shop.latitude = res.data.shopLat
|
||||
this.shop.longitude = res.data.shopLng
|
||||
this.province = res.data.province
|
||||
this.city = res.data.city
|
||||
this.district = res.data.district
|
||||
this.shop.status = res.data.status
|
||||
}
|
||||
});
|
||||
},
|
||||
confirm(e) {
|
||||
console.log(e)
|
||||
this.shop.shopTypeName = e[0].label
|
||||
this.shop.typeid = e[0].value
|
||||
},
|
||||
confirms(e) {
|
||||
console.log(e)
|
||||
this.schoolName = e[0].label
|
||||
this.schoolId = e[0].value
|
||||
this.getShopList2()
|
||||
},
|
||||
confirm1(e) {
|
||||
console.log(e)
|
||||
this.shop.schoolName = e[0].label
|
||||
this.shop.schoolId = e[0].value
|
||||
},
|
||||
// 店铺列表
|
||||
getShopList() {
|
||||
let data = {
|
||||
page: this.page,
|
||||
limit: this.limit,
|
||||
}
|
||||
this.$Request.get("/app/shoptype/selectShopTypeList", data).then(res => {
|
||||
if (res.code == 0) {
|
||||
this.shopList = res.data.list
|
||||
|
||||
}
|
||||
});
|
||||
},
|
||||
// 学校列表
|
||||
getShopList1() {
|
||||
let data = {
|
||||
page: this.page,
|
||||
limit: this.limit,
|
||||
}
|
||||
this.$Request.get("/app/school/getSchoolList", data).then(res => {
|
||||
if (res.code == 0) {
|
||||
this.shopList1 = res.data.records
|
||||
}
|
||||
});
|
||||
},
|
||||
// 校区列表
|
||||
getShopList2() {
|
||||
let data = {
|
||||
schoolId: this.schoolId,
|
||||
}
|
||||
this.$Request.get("/app/school/getChildrenByParentId", data).then(res => {
|
||||
if (res.code == 0) {
|
||||
this.shopList2 = res.data
|
||||
|
||||
}
|
||||
});
|
||||
},
|
||||
// 详情图删除
|
||||
removeImg(index) {
|
||||
this.detailsImg = ''
|
||||
},
|
||||
// 身份证 资格证删除
|
||||
removeImgs(index) {
|
||||
if (index == 1) {
|
||||
this.shop.business = ''
|
||||
} else if (index == 2) {
|
||||
this.shop.front = ''
|
||||
} else if (index == 3) {
|
||||
this.shop.back = ''
|
||||
}
|
||||
},
|
||||
bindOpen() {
|
||||
const that = this;
|
||||
uni.chooseLocation({
|
||||
success: function(res) {
|
||||
console.log('位置名称:' + res.name);
|
||||
console.log('详细地址:' + res.address);
|
||||
console.log('纬度:' + res.latitude);
|
||||
console.log('经度:' + res.longitude);
|
||||
that.shop.detailedAddress = res.address
|
||||
that.shop.latitude = res.latitude
|
||||
that.shop.longitude = res.longitude
|
||||
that.getcity(res.latitude, res.longitude)
|
||||
}
|
||||
});
|
||||
},
|
||||
getcity(latitude, longitude) {
|
||||
let data = {
|
||||
lat: latitude,
|
||||
lng: longitude,
|
||||
}
|
||||
this.$Request.get("/app/address/selectCity", data).then(res => {
|
||||
if (res.code == 0) {
|
||||
this.city = res.data.city
|
||||
this.province = res.data.province
|
||||
this.district = res.data.district
|
||||
this.shop.address = res.data.province + res.data.city + res.data.district
|
||||
|
||||
}
|
||||
});
|
||||
},
|
||||
// 图片上传
|
||||
addImages(e) {
|
||||
let that = this
|
||||
uni.chooseImage({
|
||||
count: 1,
|
||||
sourceType: ['album', 'camera'],
|
||||
success: res => {
|
||||
for (let i = 0; i < res.tempFilePaths.length; i++) {
|
||||
that.$queue.showLoading("上传中...");
|
||||
uni.uploadFile({ // 上传接口
|
||||
url: that.config("APIHOST1") + '/alioss/upload', //真实的接口地址
|
||||
filePath: res.tempFilePaths[i],
|
||||
name: 'file',
|
||||
success: (uploadFileRes) => {
|
||||
// if (that.detailsImg.length < 6) {
|
||||
that.detailsImg = JSON.parse(uploadFileRes.data).data
|
||||
// }
|
||||
|
||||
console.log(that.detailsImg)
|
||||
uni.hideLoading();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
// 图片上传
|
||||
addImage(e) {
|
||||
let that = this
|
||||
uni.chooseImage({
|
||||
count: 1,
|
||||
sourceType: ['album', 'camera'],
|
||||
success: res => {
|
||||
for (let i = 0; i < res.tempFilePaths.length; i++) {
|
||||
that.$queue.showLoading("上传中...");
|
||||
uni.uploadFile({ // 上传接口
|
||||
url: that.config("APIHOST1") + '/alioss/upload', //真实的接口地址
|
||||
filePath: res.tempFilePaths[i],
|
||||
name: 'file',
|
||||
success: (uploadFileRes) => {
|
||||
if (e == 1) {
|
||||
that.shop.business = JSON.parse(uploadFileRes.data).data
|
||||
} else if (e == 2) {
|
||||
that.shop.front = JSON.parse(uploadFileRes.data).data
|
||||
} else if (e == 3) {
|
||||
that.shop.back = JSON.parse(uploadFileRes.data).data
|
||||
}
|
||||
|
||||
console.log(that.detailsImg)
|
||||
uni.hideLoading();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
config: function(name) {
|
||||
var info = null;
|
||||
if (name) {
|
||||
var name2 = name.split("."); //字符分割
|
||||
if (name2.length > 1) {
|
||||
info = configdata[name2[0]][name2[1]] || null;
|
||||
} else {
|
||||
info = configdata[name] || null;
|
||||
}
|
||||
if (info == null) {
|
||||
let web_config = cache.get("web_config");
|
||||
if (web_config) {
|
||||
if (name2.length > 1) {
|
||||
info = web_config[name2[0]][name2[1]] || null;
|
||||
} else {
|
||||
info = web_config[name] || null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return info;
|
||||
},
|
||||
// 发布
|
||||
submit() {
|
||||
let that = this;
|
||||
console.log(this.detailsImg)
|
||||
this.shop.detailsImg = this.detailsImg
|
||||
this.shop.detailsImg = this.shop.detailsImg.toString();
|
||||
uni.getSystemInfo({
|
||||
success: function(res) {
|
||||
console.log(res.model);
|
||||
if (res.model == 'iPhone') {
|
||||
that.sysphone = 2
|
||||
} else if (res.model != 'iPhone') {
|
||||
that.sysphone = 1
|
||||
}
|
||||
}
|
||||
});
|
||||
if (!this.shop.shopTypeName) {
|
||||
uni.showToast({
|
||||
title: '请填写商铺主营类型',
|
||||
icon: 'none',
|
||||
duration: 1000
|
||||
})
|
||||
return
|
||||
}
|
||||
if (!this.shop.name) {
|
||||
uni.showToast({
|
||||
title: '请填写商铺名称',
|
||||
icon: 'none',
|
||||
duration: 1000
|
||||
})
|
||||
return
|
||||
}
|
||||
if (!this.shop.address) {
|
||||
uni.showToast({
|
||||
title: '请填写商铺地址',
|
||||
icon: 'none',
|
||||
duration: 1000
|
||||
})
|
||||
return
|
||||
}
|
||||
if (!this.shop.detailedAddress) {
|
||||
uni.showToast({
|
||||
title: '请填写店铺详细地址',
|
||||
icon: 'none',
|
||||
duration: 1000
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
if (!this.shop.userName) {
|
||||
uni.showToast({
|
||||
title: '请填写真实姓名',
|
||||
icon: 'none',
|
||||
duration: 1000
|
||||
})
|
||||
return
|
||||
}
|
||||
if (!this.shop.isNumber) {
|
||||
uni.showToast({
|
||||
title: '请填写身份证号',
|
||||
icon: 'none',
|
||||
duration: 1000
|
||||
})
|
||||
return
|
||||
}
|
||||
let regX = /^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/;
|
||||
if (!regX.test(this.shop.isNumber)) {
|
||||
uni.showToast({
|
||||
title: '请输入正确的身份证号',
|
||||
icon: 'none',
|
||||
duration: 1000
|
||||
})
|
||||
return;
|
||||
}
|
||||
if (!this.shop.phone) {
|
||||
uni.showToast({
|
||||
title: '请填写联系电话',
|
||||
icon: 'none',
|
||||
duration: 1000
|
||||
})
|
||||
return
|
||||
}
|
||||
if (!this.shop.verCode) {
|
||||
uni.showToast({
|
||||
title: '请填写验证码',
|
||||
icon: 'none',
|
||||
duration: 1000
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
if (!this.shop.detailsImg) {
|
||||
uni.showToast({
|
||||
title: '请上传商铺图片',
|
||||
icon: 'none',
|
||||
duration: 1000
|
||||
})
|
||||
return
|
||||
}
|
||||
if (!this.shop.business) {
|
||||
uni.showToast({
|
||||
title: '请上传营业执照',
|
||||
icon: 'none',
|
||||
duration: 1000
|
||||
})
|
||||
return
|
||||
}
|
||||
if (!this.shop.front) {
|
||||
uni.showToast({
|
||||
title: '请上传身份证正面',
|
||||
icon: 'none',
|
||||
duration: 1000
|
||||
})
|
||||
return
|
||||
}
|
||||
if (!this.shop.back) {
|
||||
uni.showToast({
|
||||
title: '请上传身份证反面',
|
||||
icon: 'none',
|
||||
duration: 1000
|
||||
})
|
||||
return
|
||||
}
|
||||
var openId = this.$queue.getData("openid") ? this.$queue.getData("openid") : '';
|
||||
let data = {
|
||||
msg: this.shop.verCode,
|
||||
phone: this.shop.phone,
|
||||
userType: 1,
|
||||
openId: openId,
|
||||
platform: this.platform,
|
||||
sysPhone: this.sysphone,
|
||||
|
||||
shopName: this.shop.name,
|
||||
shopTypeId: this.shop.typeid,
|
||||
shopTypeName: this.shop.shopTypeName,
|
||||
detailedAddress: this.shop.address,
|
||||
detailedAddress: this.shop.detailedAddress,
|
||||
shopLat: this.shop.latitude,
|
||||
shopLng: this.shop.longitude,
|
||||
province: this.province,
|
||||
city: this.city,
|
||||
district: this.district,
|
||||
realName: this.shop.userName,
|
||||
identitycardNumber: this.shop.isNumber,
|
||||
// phone: this.shop.phone,
|
||||
// code: this.shop.verCode,
|
||||
businessLicense: this.shop.business,
|
||||
identitycardPro: this.shop.front,
|
||||
identitycardCon: this.shop.back,
|
||||
shopCover: this.shop.detailsImg,
|
||||
// schoolId:this.shop.schoolId
|
||||
|
||||
}
|
||||
// uni.setStorageSync('updataShopId', this.shop.shopId)
|
||||
if (this.Settedlist) {
|
||||
data.shopId = this.shopId;
|
||||
this.$Request.postJson("/admin/goodsShop/updateGoodsShop", data).then(res => {
|
||||
if (res.code == 0) {
|
||||
uni.showToast({
|
||||
title: '提交成功,等待审核通过',
|
||||
icon: 'none'
|
||||
})
|
||||
setTimeout(function() {
|
||||
uni.navigateBack()
|
||||
}, 1000)
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
});
|
||||
}else{
|
||||
this.$Request.postJson("/admin/goodsShop/quickGoodsShop", data).then(res => {
|
||||
if (res.code == 0) {
|
||||
uni.showToast({
|
||||
title: '提交成功,等待审核通过',
|
||||
icon: 'none'
|
||||
})
|
||||
setTimeout(function() {
|
||||
uni.navigateBack()
|
||||
}, 1000)
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
sendMsg() {
|
||||
// const {
|
||||
// phone
|
||||
// } = this.shop;
|
||||
if(this.sendTime != '获取验证码'){
|
||||
return;
|
||||
}
|
||||
console.log('this.shop.phone', this.shop.phone)
|
||||
if (!this.shop.phone) {
|
||||
this.$queue.showToast("请输入手机号");
|
||||
} else if (this.shop.phone.length !== 11) {
|
||||
this.$queue.showToast("请输入正确的手机号");
|
||||
} else {
|
||||
this.$queue.showLoading("正在发送验证码...");
|
||||
this.$Request.getT("/app/Login/sendMsg/" + this.shop.phone + "/ruzhu").then(res => {
|
||||
if (res.code === 0) {
|
||||
this.sending = true;
|
||||
this.$queue.showToast('验证码发送成功请注意查收');
|
||||
this.countDown();
|
||||
uni.hideLoading();
|
||||
} else {
|
||||
uni.hideLoading();
|
||||
uni.showModal({
|
||||
showCancel: false,
|
||||
title: '短信发送失败',
|
||||
content: res.msg ? res.msg : '请一分钟后再获取验证码'
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
countDown() {
|
||||
const {
|
||||
count
|
||||
} = this;
|
||||
if (count === 1) {
|
||||
this.count = 60;
|
||||
this.sending = false;
|
||||
this.sendTime = '获取验证码'
|
||||
} else {
|
||||
this.count = count - 1;
|
||||
this.sending = true;
|
||||
this.sendTime = count - 1 + '秒后重新获取';
|
||||
setTimeout(this.countDown.bind(this), 1000);
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
page {
|
||||
background-color: #F5F5F5;
|
||||
}
|
||||
|
||||
.bg {
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
|
||||
textarea::-webkit-input-placeholder {
|
||||
color: #303133;
|
||||
font-size: 20rpx;
|
||||
}
|
||||
|
||||
textarea:-moz-placeholder {
|
||||
color: #303133;
|
||||
font-size: 20rpx;
|
||||
}
|
||||
|
||||
textarea::-moz-placeholder {
|
||||
color: #303133;
|
||||
font-size: 20rpx;
|
||||
}
|
||||
|
||||
textarea::-ms-input-placeholder {
|
||||
color: #303133;
|
||||
font-size: 20rpx;
|
||||
}
|
||||
|
||||
|
||||
.tabBox {
|
||||
border: 1rpx solid #999999;
|
||||
padding: 15rpx 20rpx;
|
||||
border-radius: 15rpx;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
.btnnum {
|
||||
color: #005DFF;
|
||||
border: 1rpx solid #005DFF;
|
||||
}
|
||||
|
||||
.send-msg {
|
||||
border-radius: 30px;
|
||||
color: #FFFFFF;
|
||||
/*#FCD202 */
|
||||
background: #FCD202;
|
||||
height: 60rpx;
|
||||
font-size: 28rpx;
|
||||
line-height: 60rpx;
|
||||
display: inline-block;
|
||||
width: 45%;
|
||||
margin-left: 4%;
|
||||
position: relative;
|
||||
/* #ifndef MP-WEIXIN */
|
||||
top: 0;
|
||||
/* #endif */
|
||||
/* #ifdef MP-WEIXIN */
|
||||
top: 20rpx;
|
||||
/* #endif */
|
||||
}
|
||||
</style>
|
||||
BIN
my/static/addimg.png
Normal file
BIN
my/static/addimg.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.9 KiB |
BIN
my/static/black.png
Normal file
BIN
my/static/black.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 375 B |
BIN
my/static/orange.png
Normal file
BIN
my/static/orange.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 343 B |
813
my/store/addgood.vue
Normal file
813
my/store/addgood.vue
Normal file
@@ -0,0 +1,813 @@
|
||||
<template>
|
||||
<view style="padding-bottom: 130rpx;">
|
||||
<view>
|
||||
<!-- #ifndef H5 -->
|
||||
<view style="position: fixed;top: 0;left: 0;right: 0;z-index: 9999;background: #fff;">
|
||||
<!-- #endif -->
|
||||
<!-- #ifdef H5 -->
|
||||
<view style="position: fixed;top: 44px;left: 0;right: 0;z-index: 99;background: #fff;">
|
||||
<!-- #endif -->
|
||||
<view class="bg padding-lr padding-tb-sm flex align-center">
|
||||
<u-search @change="search" v-model="goodsName" placeholder="搜索商品标题 " bg-color="#F7F7F7"
|
||||
style="width: 100%;" shape="square" :show-action="false"></u-search>
|
||||
</view>
|
||||
<view class="flex bg">
|
||||
<view v-for="(item,index) in tab" :key="index" class="flex-sub boxIndex"
|
||||
:class="tabIndex == index?'tans':''"
|
||||
:style="index==1?'text-align:center':(index==2?'text-align:right;margin-right:40rpx':'')"
|
||||
style="position: relative;padding-left: 40rpx;" @click="bindindex(index)">
|
||||
{{item.name}}
|
||||
<view :class="index==0?'tabse':(index==1?'tabse1':'tabse2')" v-show="tabIndex == index">
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<scroll-view scroll-x="true" class="flex align-center padding-sm"
|
||||
style="height: 100rpx;width: 100%;white-space: nowrap">
|
||||
<view v-for="(item,index) in list" :key="index" class="boxs"
|
||||
:class="counts == index?'actives':''" @click="bindTabs(index,item)">{{item.classifyName}}
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
<!-- #ifdef H5 -->
|
||||
<view style="margin-top: 155px;" v-if="goodsList.length>0">
|
||||
<!-- #endif -->
|
||||
<!-- #ifndef H5 -->
|
||||
<view style="margin-top: 290upx;padding-bottom: 170px;" v-if="goodsList.length>0">
|
||||
<!-- #endif -->
|
||||
<u-checkbox-group class="flex justify-center flex-wrap">
|
||||
<view class="bg radius" style="width: 686rpx;margin-top: 20rpx;" v-for="(item,index) in goodsList" :key='index'>
|
||||
<view class="padding-sm" style="position: relative;">
|
||||
<u-checkbox @change="checkboxChange(item)" v-model="item.checkeds">
|
||||
</u-checkbox>
|
||||
创建时间:{{item.createTime}}
|
||||
<span style="position: absolute;right: 20rpx;">
|
||||
<u-switch v-model="item.checked" active-color="#17cd8a" inactive-color="#eee" size="40"
|
||||
@change="changeKg(index,item)"></u-switch>
|
||||
</span>
|
||||
</view>
|
||||
<view style="width:100%;border-top: 1upx solid #E6E6E6;"></view>
|
||||
<view class="flex padding" @click="goDet(item)">
|
||||
<view>
|
||||
<image :src="item.goodsCover?item.goodsCover:'../../static/logo.png'" class="radius"
|
||||
style="width:210upx;height:170upx;"></image>
|
||||
</view>
|
||||
<view class="margin-left flex flex-direction justify-between">
|
||||
<view class="text-lg text-bold">{{item.goodsName}}</view>
|
||||
<view class="margin-tb-xs u-line-2" style="color:#999999;">
|
||||
{{item.goodsDescribe}}
|
||||
</view>
|
||||
<view style="width: 414rpx;" class="text-lg flex justify-between align-center">
|
||||
<view class="">
|
||||
<text class="text-sm">¥</text>{{item.goodsMoney}}
|
||||
</view>
|
||||
<view style="margin-right: 10rpx;">库存:{{item.inventory?item.inventory:'0'}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view style="width: 686upx;height: 1upx;border: 1upx solid #E6E6E6;margin:0 auto;"></view>
|
||||
<view class="flex justify-between padding align-center" >
|
||||
<!-- <view>库存:{{item.inventory?item.inventory:'0'}}</view> -->
|
||||
<view class="flex align-center justify-end" style="width: 100%;">
|
||||
<view @click="goodsSort(item)" class="btn margin-right-sm">排序</view>
|
||||
<view @click="goodupdete(item)" class="btn margin-right-sm">删除</view>
|
||||
<view @click="deitor(item)" class="btn margin-right-sm">库存</view>
|
||||
<view @click="goUpdate(item)" class="btn">修改</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</u-checkbox-group>
|
||||
</view>
|
||||
<!-- <view class="addguige text-bold" @click="goAdd()">添加商品</view> -->
|
||||
<empty v-if="goodsList.length == 0"></empty>
|
||||
</view>
|
||||
<view class="selectcz flex align-center">
|
||||
<u-checkbox @change="checkboxChanges()" style="margin-left: 40rpx;" v-model="checkedz">全选</u-checkbox>
|
||||
<view class="addguige text-bold addguigezz" @click="selectczan">操作</view>
|
||||
<view class="addguige text-bold addguigezzs" @click="goAdd()">添加商品</view>
|
||||
</view>
|
||||
<!-- 排序 -->
|
||||
<u-popup v-model="shows3" mode="center" border-radius="14" width="500rpx" height="300rpx"
|
||||
:closeable="true">
|
||||
<view>
|
||||
<view class="padding">
|
||||
<view>排序</view>
|
||||
<view style="margin-top: 20rpx;" class="flex justify-center">
|
||||
<u-number-box :input-width="300" :input-height="60" v-model="paixu" :min="0" placeholder="请填写"></u-number-box>
|
||||
</view>
|
||||
</view>
|
||||
<view class="addguiges" @click="bindclose3()">确定</view>
|
||||
</view>
|
||||
</u-popup>
|
||||
<u-popup v-model="shows" mode="center" border-radius="14" width="500rpx" height="300rpx"
|
||||
:closeable="closeable">
|
||||
<view>
|
||||
<view class="padding">
|
||||
<view>添加库存</view>
|
||||
<view>
|
||||
<u-input v-model="typeperature" placeholder="请填写" type="number" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="addguiges" @click="bindclose()">确定</view>
|
||||
</view>
|
||||
</u-popup>
|
||||
<!-- 批量修改库存 -->
|
||||
<u-popup v-model="shows2" mode="center" border-radius="14" width="500rpx" height="300rpx"
|
||||
:closeable="true">
|
||||
<view>
|
||||
<view class="padding">
|
||||
<view>修改库存</view>
|
||||
<view>
|
||||
<u-input v-model="typeperature2" placeholder="请填写" type="number" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="addguiges" @click="bindclose2()">确定</view>
|
||||
</view>
|
||||
</u-popup>
|
||||
<!-- 多选操作菜单 -->
|
||||
<u-action-sheet :list="tabIndex==2?lists1:lists" @click="click" v-model="show"></u-action-sheet>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import empty from '@/components/empty.vue'
|
||||
export default {
|
||||
components: {
|
||||
empty
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
goodsIds:[],
|
||||
shows3:false,
|
||||
paixu:0,
|
||||
shows2:false,
|
||||
typeperature2:'',
|
||||
checkedz:false,
|
||||
show: false,
|
||||
lists: [{
|
||||
text: '批量下架'
|
||||
}, {
|
||||
text: '修改库存'
|
||||
}, {
|
||||
text: '批量删除'
|
||||
}],
|
||||
lists1: [{
|
||||
text: '批量上架',
|
||||
}, {
|
||||
text: '修改库存'
|
||||
}, {
|
||||
text: '批量删除'
|
||||
}],
|
||||
tab: [{
|
||||
name: '出售中',
|
||||
}, {
|
||||
name: '已售完',
|
||||
}, {
|
||||
name: '已下架'
|
||||
}],
|
||||
tabIndex: 0,
|
||||
list: [{
|
||||
name: '奶茶热饮'
|
||||
}, {
|
||||
name: '鲜榨果汁'
|
||||
}, {
|
||||
name: '牛奶系列'
|
||||
}, {
|
||||
name: '超低折扣'
|
||||
}],
|
||||
counts: '',
|
||||
classifyId: '',
|
||||
page: 1,
|
||||
limit: 10,
|
||||
shopId: '',
|
||||
goodsName: '',
|
||||
goodsList: [],
|
||||
totalCount: 0,
|
||||
shows: false,
|
||||
typeperature: '',
|
||||
goodsId: '',
|
||||
checked: false,
|
||||
pageList: [],
|
||||
closeable: true
|
||||
}
|
||||
},
|
||||
onLoad(option) {
|
||||
uni.showLoading({
|
||||
title: '加载中......',
|
||||
icon: 'loading'
|
||||
})
|
||||
|
||||
// this.shopId = option.shopId
|
||||
this.shopId = this.$queue.getData("shopId")
|
||||
this.getClassifyList()
|
||||
|
||||
},
|
||||
onShow() {
|
||||
this.getGoodsList()
|
||||
},
|
||||
methods: {
|
||||
// 批量库存
|
||||
bindclose2(index){
|
||||
if (!this.typeperature2) {
|
||||
uni.showToast({
|
||||
title: '请填写规格数量',
|
||||
icon: 'none',
|
||||
duration: 1000
|
||||
})
|
||||
return
|
||||
}
|
||||
if(this.typeperature2<0){
|
||||
uni.showToast({
|
||||
title: '库存数量不得小于0',
|
||||
icon: 'none',
|
||||
duration: 1000
|
||||
})
|
||||
return
|
||||
}
|
||||
let data = {
|
||||
goodsIds: this.goodsIds.join(),
|
||||
inventory: this.typeperature2
|
||||
}
|
||||
let that = this
|
||||
that.shows2 = false
|
||||
uni.showModal({
|
||||
title:'提示',
|
||||
content:'确认已选中的商品批量修改库存?',
|
||||
complete:function(ret){
|
||||
if(ret.confirm){
|
||||
that.$Request.getA("/admin/goods/updateBatchInventory", data).then(res => {
|
||||
if (res.code == 0) {
|
||||
that.shows2 = false
|
||||
uni.showToast({
|
||||
title: '修改成功',
|
||||
icon: 'none'
|
||||
})
|
||||
that.typeperature2 = ''
|
||||
that.checkedz = false
|
||||
that.goodsIds = []
|
||||
that.page = 1
|
||||
that.getGoodsList()
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
},
|
||||
bindclose3(){
|
||||
let data = {
|
||||
sort:this.paixu,
|
||||
goodsId:this.goodsId
|
||||
}
|
||||
this.$Request.getA('/admin/goods/updateSort', data).then(res => {
|
||||
if(res.code==0){
|
||||
uni.showToast({
|
||||
title:'修改成功'
|
||||
})
|
||||
this.goodsId = ''
|
||||
this.shows3 = false
|
||||
this.page = 1
|
||||
this.getGoodsList();
|
||||
}else{
|
||||
uni.showToast({
|
||||
title:res.msg,
|
||||
icon:'none'
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
//排序
|
||||
goodsSort(item){
|
||||
if(item.sort){
|
||||
this.paixu = item.sort
|
||||
}else{
|
||||
this.paixu = 0
|
||||
}
|
||||
|
||||
this.shows3 = true
|
||||
this.goodsId = item.goodsId
|
||||
},
|
||||
selectczan(){
|
||||
if(this.goodsIds.length==0){
|
||||
uni.showToast({
|
||||
title:'请选择商品后操作',
|
||||
icon:'none'
|
||||
})
|
||||
}else{
|
||||
this.show = true
|
||||
}
|
||||
},
|
||||
//全选
|
||||
checkboxChanges(){
|
||||
this.goodsIds = []
|
||||
if(this.checkedz==false){//全选(把总复选框选中并把goodsid赋给数组)
|
||||
this.goodsList.map(item=>{
|
||||
item.checkeds = true
|
||||
this.goodsIds.push(item.goodsId)
|
||||
})
|
||||
console.log(this.goodsList)
|
||||
}else{//全不选
|
||||
this.goodsList.map(item=>{
|
||||
item.checkeds = false
|
||||
})
|
||||
}
|
||||
},
|
||||
//批量操作
|
||||
caozuos(url,datas,data){
|
||||
let that = this
|
||||
uni.showModal({
|
||||
title:'提示',
|
||||
content:'确认'+data+'已选中的商品?',
|
||||
complete:function(ret){
|
||||
if(ret.confirm){
|
||||
that.$Request.getA(url, datas).then(res => {
|
||||
if(res.code==0){
|
||||
uni.showToast({
|
||||
title:data+'成功'
|
||||
})
|
||||
that.checkedz=false
|
||||
that.goodsIds = []
|
||||
that.page = 1
|
||||
that.getGoodsList();
|
||||
}else{
|
||||
uni.showToast({
|
||||
title:res.msg,
|
||||
icon:'none'
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
},
|
||||
//选择的操作
|
||||
click(e) {
|
||||
let data = this.lists[e].text
|
||||
if(this.tabIndex==2){
|
||||
if(data == '批量下架'){
|
||||
data = '批量上架'
|
||||
}
|
||||
}
|
||||
switch (data) {
|
||||
case '批量下架':
|
||||
let datas = {
|
||||
goodsIds:this.goodsIds.join(','),
|
||||
status:1
|
||||
}
|
||||
this.caozuos('/admin/goods/updateBatchStatus',datas,data)
|
||||
break;
|
||||
case '修改库存':
|
||||
this.shows2 = true
|
||||
break;
|
||||
case '批量删除':
|
||||
let datas2 = {
|
||||
goodsIds:this.goodsIds.join(','),
|
||||
}
|
||||
this.caozuos('/admin/goods/deleteBatchIds',datas2,data)
|
||||
break;
|
||||
case '批量上架':
|
||||
let datas1 = {
|
||||
goodsIds:this.goodsIds.join(','),
|
||||
status:0
|
||||
}
|
||||
this.caozuos('/admin/goods/updateBatchStatus',datas1,data)
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
},
|
||||
// 选中某个复选框时,由checkbox时触发
|
||||
checkboxChange(e) {
|
||||
if(this.goodsIds.indexOf(e.goodsId)==-1){//如果没有选中则把goodsid增加到数组中
|
||||
this.goodsIds.push(e.goodsId)
|
||||
}else{//如果找到了则把goodsid删除
|
||||
this.goodsIds.splice(this.goodsIds.indexOf(e.goodsId),1)
|
||||
}
|
||||
if(this.goodsIds.length==this.goodsList.length){ //判断是否全部选中
|
||||
this.checkedz = true
|
||||
}else{
|
||||
this.checkedz = false
|
||||
}
|
||||
},
|
||||
//修改商品
|
||||
goUpdate(item) {
|
||||
uni.navigateTo({
|
||||
url: '/my/publish/goods?goodsId=' + item.goodsId
|
||||
})
|
||||
},
|
||||
goAdd() {
|
||||
uni.navigateTo({
|
||||
url: '/my/publish/goods'
|
||||
})
|
||||
},
|
||||
//搜索
|
||||
search() {
|
||||
this.getGoodsList()
|
||||
},
|
||||
bindindex(index) {
|
||||
console.log(index)
|
||||
uni.showLoading({
|
||||
title: '加载中......',
|
||||
icon: 'loading'
|
||||
})
|
||||
this.page = 1
|
||||
this.tabIndex = index
|
||||
this.getGoodsList()
|
||||
},
|
||||
getGoodsList() {
|
||||
let data = {
|
||||
page: this.page,
|
||||
limit: this.limit,
|
||||
goodsName: this.goodsName,
|
||||
// shopId: this.shopId,
|
||||
classifyId: this.classifyId,
|
||||
shopId: uni.getStorageSync('shopId'),
|
||||
status: this.tabIndex == 1 ? 2 : (this.tabIndex == 2 ? 1 : this.tabIndex)
|
||||
}
|
||||
this.$Request.getA("/admin/goodsShop/selectGoodsByShopId", data).then(res => {
|
||||
if (res.code == 0) {
|
||||
uni.hideLoading()
|
||||
if (res.data.list.length > 0) {
|
||||
for (var i in res.data.list) {
|
||||
if (res.data.list[i].status == 1) {
|
||||
res.data.list[i].checked = false
|
||||
} else {
|
||||
res.data.list[i].checked = true
|
||||
}
|
||||
|
||||
}
|
||||
console.log('res.data.list', res.data.list)
|
||||
if (this.page == 1) {
|
||||
this.goodsList = res.data.list
|
||||
} else {
|
||||
this.goodsList = [...this.goodsList, ...res.data.list]
|
||||
}
|
||||
this.totalCount = res.data.totalCount
|
||||
} else {
|
||||
if (this.page == 1) {
|
||||
this.goodsList = []
|
||||
} else {
|
||||
this.goodsList = this.goodsList
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
uni.stopPullDownRefresh();
|
||||
uni.hideLoading()
|
||||
});
|
||||
},
|
||||
//删除商品
|
||||
goodupdete(e) {
|
||||
console.log(e)
|
||||
let that = this
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '确定要删除当前商品吗?刪除后无法恢复',
|
||||
cancelText: "取消", // 取消按钮的文字
|
||||
confirmText: "确定", // 确认按钮文字
|
||||
showCancel: true, // 是否显示取消按钮,默认为 true
|
||||
confirmColor: '#f55850',
|
||||
cancelColor: '#39B54A',
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
let data = {
|
||||
shopId: uni.getStorageSync('shopId'),
|
||||
goodsId: e.goodsId,
|
||||
}
|
||||
that.$Request.postA("/admin/goodsShop/deleteGoodsByShopId", data).then(res => {
|
||||
if (res.code == 0) {
|
||||
uni.showToast({
|
||||
title: "删除成功",
|
||||
icon: 'none'
|
||||
})
|
||||
that.page = 1
|
||||
that.getGoodsList();
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
});
|
||||
} else {
|
||||
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
},
|
||||
// 商品类型
|
||||
getClassifyList() {
|
||||
this.$Request.getA("/admin/goods/selectAllClassify?shopId=" + this.shopId).then(res => {
|
||||
if (res.code == 0) {
|
||||
let data = [{
|
||||
classifyName: '全部',
|
||||
classifyId: ''
|
||||
}]
|
||||
this.list = [...data, ...res.data]
|
||||
this.classifyId = this.list[0].classifyId
|
||||
this.getGoodsList()
|
||||
}
|
||||
});
|
||||
},
|
||||
//库存弹框
|
||||
bindclose(index) {
|
||||
if (!this.typeperature) {
|
||||
uni.showToast({
|
||||
title: '请填写规格数量',
|
||||
icon: 'none',
|
||||
duration: 1000
|
||||
})
|
||||
return
|
||||
}
|
||||
let data = {
|
||||
shopId: uni.getStorageSync('shopId'),
|
||||
goodsId: this.goodsId,
|
||||
inventory: this.typeperature
|
||||
}
|
||||
this.$Request.postJson("/admin/goodsShop/updateGoodsByShopId", data).then(res => {
|
||||
if (res.code == 0) {
|
||||
this.shows = false
|
||||
this.typeperature = ''
|
||||
uni.showToast({
|
||||
title: '修改成功',
|
||||
icon: 'none'
|
||||
})
|
||||
this.getGoodsList()
|
||||
}
|
||||
});
|
||||
},
|
||||
//编辑库存
|
||||
deitor(e) {
|
||||
this.shows = true
|
||||
this.goodsId = e.goodsId
|
||||
},
|
||||
add(item) {
|
||||
let that = this
|
||||
let data = [{
|
||||
goodsId: item.goodsId,
|
||||
shopId: this.shopId
|
||||
}]
|
||||
this.$Request.postJsonA("/admin/goodsShop/addGoodsByShopId", data).then(res => {
|
||||
if (res.code == 0) {
|
||||
this.page = 1
|
||||
this.getGoodsList()
|
||||
uni.showToast({
|
||||
title: '添加成功',
|
||||
icon: 'none'
|
||||
})
|
||||
this.getGoodsList()
|
||||
}
|
||||
});
|
||||
},
|
||||
goDet(e) {
|
||||
uni.navigateTo({
|
||||
url: '/my/store/goodDetail?goodsId=' + e.goodsId + "&shopId=" + this.shopId + '&type=2'
|
||||
})
|
||||
},
|
||||
bindDetail() {
|
||||
uni.navigateTo({
|
||||
url: './goodDetail'
|
||||
})
|
||||
},
|
||||
bindTabs(index, e) {
|
||||
console.log(e)
|
||||
uni.showLoading({
|
||||
title: '加载中......',
|
||||
icon: 'loading'
|
||||
})
|
||||
this.counts = index
|
||||
this.classifyId = e.classifyId
|
||||
this.page = 1
|
||||
this.getGoodsList()
|
||||
},
|
||||
bindAddgood() {
|
||||
uni.navigateTo({
|
||||
url: './addgood'
|
||||
})
|
||||
},
|
||||
// 上下架商品
|
||||
changeKg(index, row) {
|
||||
console.log(row.status)
|
||||
var datas = {}
|
||||
datas.goodsIds = row.goodsId
|
||||
if (row.status == 0) {
|
||||
datas.status = 1
|
||||
}
|
||||
if (row.status == 1) {
|
||||
datas.status = 0
|
||||
}
|
||||
// datas.status = row.status
|
||||
|
||||
// this.$Request.postJsonA("/admin/goods/update", datas).then(res => {
|
||||
this.$Request.getT("/admin/goods/updateBatchStatus", datas).then(res => {
|
||||
if (res.code == 0) {
|
||||
this.page = 1
|
||||
uni.showToast({
|
||||
title: '操作成功',
|
||||
icon: 'none'
|
||||
})
|
||||
this.getGoodsList()
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
onReachBottom: function() {
|
||||
this.page = this.page + 1;
|
||||
this.getGoodsList();
|
||||
if (this.totalCount == this.goodsList.length) {
|
||||
uni.showToast({
|
||||
title: '已经到底了~',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
},
|
||||
onPullDownRefresh: function() {
|
||||
this.page = 1;
|
||||
this.getGoodsList();
|
||||
},
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
page {
|
||||
background: #EDF1F7;
|
||||
}
|
||||
.selectcz {
|
||||
width: 100%;
|
||||
background-color: #FFFFFF;
|
||||
position: fixed;
|
||||
bottom: 0upx;
|
||||
left: 0;
|
||||
right: 0;
|
||||
z-index: 9;
|
||||
}
|
||||
|
||||
.tabse {
|
||||
width: 50rpx;
|
||||
height: 10rpx;
|
||||
background-color: #FCD202;
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 45%;
|
||||
transform: translate(-100%, -100%);
|
||||
}
|
||||
|
||||
.tabse1 {
|
||||
width: 50rpx;
|
||||
height: 10rpx;
|
||||
background-color: #FCD202;
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 70%;
|
||||
transform: translate(-100%, -100%);
|
||||
}
|
||||
|
||||
.tabse2 {
|
||||
width: 50rpx;
|
||||
height: 10rpx;
|
||||
background-color: #FCD202;
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 95%;
|
||||
transform: translate(-100%, -100%);
|
||||
}
|
||||
.bg {
|
||||
background: #FFFFFF;
|
||||
}
|
||||
|
||||
.boxs {
|
||||
width: 150upx;
|
||||
height: 55upx;
|
||||
border: 2upx solid #CCCCCC;
|
||||
border-radius: 28upx;
|
||||
text-align: center;
|
||||
line-height: 55upx;
|
||||
color: #999999;
|
||||
margin-right: 30rpx;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.actives {
|
||||
width: 150upx;
|
||||
height: 55upx;
|
||||
border: 2upx solid #FFCC00;
|
||||
border-radius: 28upx;
|
||||
text-align: center;
|
||||
line-height: 55upx;
|
||||
color: #000000;
|
||||
margin-right: 30rpx;
|
||||
}
|
||||
|
||||
.btn {
|
||||
width: 120upx;
|
||||
height: 64upx;
|
||||
border: 2upx solid #999999;
|
||||
border-radius: 8upx;
|
||||
text-align: center;
|
||||
line-height: 64rpx;
|
||||
color: #000000;
|
||||
}
|
||||
|
||||
.box {
|
||||
width: 131upx;
|
||||
height: 45rpx;
|
||||
background: #FFEAF0;
|
||||
border-radius: 4upx;
|
||||
text-align: center;
|
||||
line-height: 45rpx;
|
||||
font-size: 24upx;
|
||||
font-weight: 500;
|
||||
color: #FE215B;
|
||||
}
|
||||
|
||||
.page-box {
|
||||
position: relative;
|
||||
// left: 0;
|
||||
height: 100vh;
|
||||
z-index: 0;
|
||||
top: -20px;
|
||||
}
|
||||
|
||||
.centre {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
margin: auto;
|
||||
height: 400rpx;
|
||||
text-align: center;
|
||||
// padding: 200rpx auto;
|
||||
font-size: 32rpx;
|
||||
|
||||
image {
|
||||
width: 387rpx;
|
||||
height: 341rpx;
|
||||
// margin-bottom: 20rpx;
|
||||
margin: 0 auto 20rpx;
|
||||
// border: 1px dotted #000000;
|
||||
}
|
||||
|
||||
.tips {
|
||||
font-size: 32rpx;
|
||||
color: #2F3044;
|
||||
margin-top: 20rpx;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.btn {
|
||||
margin: 80rpx auto;
|
||||
width: 600rpx;
|
||||
border-radius: 32rpx;
|
||||
line-height: 90rpx;
|
||||
color: #ffffff;
|
||||
font-size: 34rpx;
|
||||
background: #5074FF;
|
||||
}
|
||||
}
|
||||
|
||||
.boxIndex {
|
||||
height: 78upx;
|
||||
line-height: 78upx;
|
||||
}
|
||||
|
||||
.tans {
|
||||
background: #fff;
|
||||
}
|
||||
.addguige {
|
||||
width: 38%;
|
||||
color: #ffffff;
|
||||
text-align: center;
|
||||
height: 88upx;
|
||||
line-height: 88upx;
|
||||
}
|
||||
.addguigezz{
|
||||
border-radius: 16upx 0 0 0;
|
||||
background-color: #999999;
|
||||
box-shadow: 0px 10upx 20upx 0px #999999;
|
||||
}
|
||||
.addguigezzs{
|
||||
border-radius: 0 16upx 0 0;
|
||||
background: #FCD202;
|
||||
box-shadow: 0px 10upx 20upx 0px #FCD202;
|
||||
}
|
||||
.addguiges {
|
||||
width: 90%;
|
||||
margin: 0 auto;
|
||||
background: #FCD202;
|
||||
box-shadow: 0px 10upx 20upx 0px #FFD9B3;
|
||||
border-radius: 16upx;
|
||||
text-align: center;
|
||||
height: 88upx;
|
||||
line-height: 88upx;
|
||||
/* position: fixed;
|
||||
bottom: 25upx;
|
||||
left: 0;
|
||||
right: 0; */
|
||||
|
||||
}
|
||||
</style>
|
||||
311
my/store/editor.vue
Normal file
311
my/store/editor.vue
Normal file
@@ -0,0 +1,311 @@
|
||||
<template>
|
||||
<view class="padding">
|
||||
<view class="padding bg radius">
|
||||
<view class="">
|
||||
<view class="text-df text-bold">规格标题</view>
|
||||
<view>
|
||||
<u-input v-model="shopName" placeholder="请输入规格标题" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="bg margin-tb padding-sm radius" v-for="(item,index) in shopList" :key='index'>
|
||||
<view class="">
|
||||
<view style="display: flex;width: 100%;">
|
||||
<view style="width: 70%;" class="text-df text-bold">规格</view>
|
||||
<view style="width: 30%;text-align: right;" class="text-df text-bold" v-if="index != 0" @tap="delteItem(index)">删除</view>
|
||||
</view>
|
||||
<view>
|
||||
<u-input v-model="item.value" placeholder="请填写" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="">
|
||||
<view class="text-df text-bold">规格值</view>
|
||||
<!-- <view>
|
||||
<u-input v-model="detailName" placeholder="请填写" />
|
||||
</view> -->
|
||||
</view>
|
||||
<view class="flex align-center flex-wrap margin-bottom-sm">
|
||||
<view v-for="(item1,index1) in item.detail" :key="index1" class="btn flex align-center margin-top"
|
||||
:class="listIndex1 == index1&&listIndex==index?'active':''" @click="bindqie(index1,item1,index)">
|
||||
<view>{{item1}}</view>
|
||||
<view class="margin-left-sm" @tap.stop="bindupdata(index1,item1,index)">x</view>
|
||||
</view>
|
||||
<view class="btns margin-top" @click="addtype(1,item1,index)">+添加</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
||||
|
||||
<u-button class="margin-top addguiges" :custom-style="customStyle" shape="square" :hair-line="false"
|
||||
@click="addguige()">添加规格
|
||||
</u-button>
|
||||
|
||||
<view class="margin-top">
|
||||
<u-button @click="submit" class=" addguige" :custom-style="customStyle" shape="square" :hair-line="false">确认
|
||||
</u-button>
|
||||
</view>
|
||||
|
||||
<!-- 添加规格弹框 -->
|
||||
<u-popup v-model="show" mode="center" border-radius="14" width="500rpx" height="300rpx">
|
||||
<view>
|
||||
<view class="padding">
|
||||
<view>添加规格类型</view>
|
||||
<view>
|
||||
<u-input v-model="typeName" placeholder="请填写" clearable="false" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="addguiges" @click="bindclose(aa)">确定</view>
|
||||
</view>
|
||||
</u-popup>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import configdata from '@/common/config.js';
|
||||
export default {
|
||||
|
||||
data() {
|
||||
return {
|
||||
shopName: '',
|
||||
customStyle: {
|
||||
backgroundColor: '#FFCC00',
|
||||
color: '#000000',
|
||||
border: 0
|
||||
},
|
||||
shopList: [{
|
||||
value: '',
|
||||
detail: [],
|
||||
}],
|
||||
listIndex1: 0,
|
||||
listIndex: 0,
|
||||
show: false,
|
||||
typeName: '',
|
||||
ruleValues: [],
|
||||
id: '',
|
||||
guigeLIst: {},
|
||||
detailName: '',
|
||||
guigeIndex: 0,
|
||||
guigezhiIndex: 0,
|
||||
aa: '',
|
||||
shopId: '',
|
||||
}
|
||||
},
|
||||
onLoad(option) {
|
||||
this.id = option.id
|
||||
this.shopId = this.$queue.getData("shopId")
|
||||
if (option.id) {
|
||||
this.guigeLIst = uni.getStorageSync('guige')
|
||||
this.shopName = this.guigeLIst.ruleName
|
||||
this.shopList = this.guigeLIst.ruleValue
|
||||
|
||||
for (var i = 0; i < this.shopList.length; i++) {
|
||||
// #ifdef APP
|
||||
this.shopList[i].detail = this.shopList[i].detail.split(',')
|
||||
// #endif
|
||||
// #ifndef APP
|
||||
this.shopList[i].detail = this.shopList[i].detail.split('/')
|
||||
// #endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
onShow() {
|
||||
|
||||
},
|
||||
methods: {
|
||||
delteItem(index){
|
||||
this.shopList.splice(index, 1)
|
||||
},
|
||||
//删除规格
|
||||
bindupdata(index1, item1, index) {
|
||||
|
||||
this.shopList[index].detail.splice(index1, 1)
|
||||
},
|
||||
bindqie(index1, item1, index) {
|
||||
this.listIndex = index
|
||||
this.listIndex1 = index1
|
||||
this.shopList[index].detail[index1] = item1
|
||||
this.typeName = item1
|
||||
this.aa = index1
|
||||
this.show = true
|
||||
|
||||
},
|
||||
addtype(index1, item, index) {
|
||||
this.guigeIndex = index
|
||||
this.guigezhiIndex = index1
|
||||
|
||||
if (index1 == 1) {
|
||||
this.typeName = ''
|
||||
this.aa = ''
|
||||
this.show = true
|
||||
|
||||
}
|
||||
},
|
||||
bindclose(index) {
|
||||
if (!this.typeName) {
|
||||
uni.showToast({
|
||||
title: '请填写规格',
|
||||
icon: 'none',
|
||||
duration: 1000
|
||||
})
|
||||
return
|
||||
}
|
||||
console.log('aaaaaaa', index)
|
||||
if (index === '') {
|
||||
this.show = false
|
||||
// this.list.push(this.typeName)
|
||||
this.shopList[this.guigeIndex].detail.push(this.typeName)
|
||||
} else {
|
||||
this.show = false
|
||||
this.shopList[this.guigeIndex].detail[this.aa] = this.typeName
|
||||
}
|
||||
},
|
||||
// 发布
|
||||
submit() {
|
||||
if (!this.shopName) {
|
||||
uni.showToast({
|
||||
title: '请填写规格标题',
|
||||
icon: 'none',
|
||||
duration: 1000
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
if(this.shopList.length == 0){
|
||||
uni.showToast({
|
||||
title: '请选择规格',
|
||||
icon: 'none',
|
||||
duration: 1000
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
var arrLength = this.shopList[this.shopList.length - 1]
|
||||
if (arrLength.value == '' || arrLength.detail.length == 0) {
|
||||
uni.showToast({
|
||||
title: '请填写规格或是规格值',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
let guigeList = {}
|
||||
|
||||
let shopList = JSON.parse(JSON.stringify(this.shopList))
|
||||
for (var i in shopList) {
|
||||
shopList[i].detail = shopList[i].detail.toString()
|
||||
}
|
||||
console.log(shopList)
|
||||
guigeList.ruleName = this.shopName
|
||||
guigeList.ruleValue = shopList
|
||||
guigeList.shopId = this.shopId
|
||||
if (this.id) {
|
||||
guigeList.id = this.id
|
||||
this.$Request.postJson("/selfGoodsRule/update", guigeList).then(res => {
|
||||
if (res.code == 0) {
|
||||
uni.showToast({
|
||||
title: '修改成功',
|
||||
icon: 'none'
|
||||
})
|
||||
uni.navigateBack()
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: 'none'
|
||||
})
|
||||
|
||||
// this.shopList = this.shopList[this.guigeIndex].detail.split(',')
|
||||
// console.log(this.shopList,2222)
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$Request.postJson("/selfGoodsRule/save", guigeList).then(res => {
|
||||
if (res.code == 0) {
|
||||
uni.navigateBack()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
},
|
||||
// 添加规格
|
||||
addguige() {
|
||||
var arrLength = this.shopList[this.shopList.length - 1]
|
||||
if (arrLength.value == '' || arrLength.detail.length == 0) {
|
||||
uni.showToast({
|
||||
title: '请填写规格或是规格值',
|
||||
icon: 'none'
|
||||
})
|
||||
} else {
|
||||
var data = {
|
||||
value: '',
|
||||
detail: [],
|
||||
}
|
||||
this.shopList.push(data)
|
||||
console.log(this.shopList, 11111)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
page {
|
||||
background-color: #F5F5F5;
|
||||
}
|
||||
|
||||
.bg {
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
|
||||
|
||||
.btn {
|
||||
border: 1upx solid #CCCCCC;
|
||||
border-radius: 28px;
|
||||
padding: 15rpx 30rpx;
|
||||
margin-right: 25rpx;
|
||||
}
|
||||
|
||||
.btns {
|
||||
border: 1upx dashed #333333;
|
||||
border-radius: 28px;
|
||||
padding: 10rpx 30rpx;
|
||||
margin-right: 25rpx;
|
||||
}
|
||||
|
||||
.active {
|
||||
/* background: #FCD202; */
|
||||
/* border: none; */
|
||||
}
|
||||
|
||||
.addguige {
|
||||
width: 90%;
|
||||
margin: 0 auto;
|
||||
background: #FCD202;
|
||||
box-shadow: 0px 10upx 20upx 0px #FFD9B3;
|
||||
border-radius: 16upx;
|
||||
text-align: center;
|
||||
height: 88upx;
|
||||
line-height: 88upx;
|
||||
/* position: fixed;
|
||||
bottom: 25upx;
|
||||
left: 0;
|
||||
right: 0; */
|
||||
}
|
||||
|
||||
.addguiges {
|
||||
width: 90%;
|
||||
margin: 0 auto;
|
||||
background: #FCD202;
|
||||
box-shadow: 0px 10upx 20upx 0px #FFD9B3;
|
||||
border-radius: 16upx;
|
||||
text-align: center;
|
||||
height: 88upx;
|
||||
line-height: 88upx;
|
||||
/* position: fixed;
|
||||
bottom: 25upx;
|
||||
left: 0;
|
||||
right: 0; */
|
||||
}
|
||||
</style>
|
||||
232
my/store/fenlei.vue
Normal file
232
my/store/fenlei.vue
Normal file
@@ -0,0 +1,232 @@
|
||||
<template>
|
||||
<view>
|
||||
<view v-for="(item,index) in list" :key="index" class="flex padding justify-between">
|
||||
<view class="flex align-center">
|
||||
<view class="text-bold text-xl">{{index+1}}.</view>
|
||||
<view class="margin-left-xs">{{item.classifyName}}</view>
|
||||
</view>
|
||||
<view class="flex align-center">
|
||||
<view class="btn margin-right-sm" @click="addtype(2,item)">修改</view>
|
||||
<view class="btn" @click="bindupdata(item)">删除</view>
|
||||
</view>
|
||||
</view>
|
||||
<empty v-if="list.length == 0" content="暂无数据"></empty>
|
||||
<view class="addguige text-bold" @click="addtype(1)">添加</view>
|
||||
|
||||
<!-- 添加规格弹框 -->
|
||||
<u-popup v-model="show" mode="center" border-radius="14" width="500rpx" height="400rpx">
|
||||
<view>
|
||||
<view class="padding" style="margin-bottom: 20rpx;">
|
||||
<view>商品分类</view>
|
||||
<view class="flex align-center" style="margin-top: 15rpx;">
|
||||
<label style="margin-right: 10rpx;">分类名称</label><u-input v-model="typeName" placeholder="请填写分类名称" clearable="false" />
|
||||
</view>
|
||||
<view class="flex align-center" style="margin-top: 15rpx;">
|
||||
<label style="margin-right: 10rpx;">分类排序</label><u-number-box v-model="sort" placeholder="请填写分类排序"></u-number-box>
|
||||
</view>
|
||||
</view>
|
||||
<view class="addguiges" @click="bindAdd()">确定</view>
|
||||
</view>
|
||||
</u-popup>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import empty from '@/components/empty.vue'
|
||||
export default {
|
||||
components: {
|
||||
empty
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
list: [{
|
||||
id: 1,
|
||||
name: '清爽夏日',
|
||||
}, {
|
||||
id: 2,
|
||||
name: '牛奶系列',
|
||||
}, {
|
||||
id: 3,
|
||||
name: '鲜榨果汁',
|
||||
}],
|
||||
show: false,
|
||||
typeName: '',
|
||||
sort:0,
|
||||
classifyId: '',
|
||||
shopId: '',
|
||||
shopName: '',
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
uni.showLoading({
|
||||
title: '数据加载中...',
|
||||
mask: false
|
||||
})
|
||||
this.shopId = this.$queue.getData("shopId")
|
||||
this.shopName = this.$queue.getData("shopUserName")
|
||||
this.getlist()
|
||||
},
|
||||
methods: {
|
||||
addtype(index, item) {
|
||||
console.log(index, item)
|
||||
if (index == 1) {
|
||||
this.show = true
|
||||
this.typeName = ''
|
||||
this.classifyId = ''
|
||||
this.sort = 0
|
||||
} else if (index == 2) {
|
||||
this.show = true
|
||||
this.typeName = item.classifyName
|
||||
this.classifyId = item.classifyId
|
||||
if(item.sort){
|
||||
this.sort = item.sort
|
||||
}else{
|
||||
this.sort = 0
|
||||
}
|
||||
}
|
||||
},
|
||||
//添加商品类型
|
||||
bindAdd() {
|
||||
if (!this.typeName) {
|
||||
uni.showToast({
|
||||
title: '请填写商品类型',
|
||||
icon: 'none',
|
||||
duration: 1000
|
||||
})
|
||||
return
|
||||
}
|
||||
console.log(this.classifyId)
|
||||
if (this.classifyId) {
|
||||
let data = {
|
||||
classifyId: this.classifyId,
|
||||
classifyName: this.typeName,
|
||||
shopId: this.shopId,
|
||||
shopName: this.shopName,
|
||||
sort:this.sort,
|
||||
}
|
||||
this.$Request.postJson("/admin/goods/updateClassify", data).then(res => {
|
||||
if (res.code == 0) {
|
||||
// this.list = res.data
|
||||
this.show = false
|
||||
this.typeName = ''
|
||||
this.classifyId = ''
|
||||
this.sort = 0
|
||||
this.getlist()
|
||||
}
|
||||
})
|
||||
} else {
|
||||
let data = {
|
||||
classifyName: this.typeName,
|
||||
shopId: this.shopId,
|
||||
shopName: this.shopName,
|
||||
sort:this.sort
|
||||
}
|
||||
this.$Request.postJson("/admin/goods/insertClassify", data).then(res => {
|
||||
if (res.code == 0) {
|
||||
// this.list = res.data
|
||||
this.show = false
|
||||
this.typeName = ''
|
||||
this.classifyId = ''
|
||||
this.sort = 0
|
||||
this.getlist()
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
//获取分类列表
|
||||
getlist() {
|
||||
let data = {
|
||||
shopId: this.shopId
|
||||
}
|
||||
this.$Request.getA("/admin/goods/selectAllClassify", data).then(res => {
|
||||
uni.hideLoading()
|
||||
if (res.code == 0) {
|
||||
this.list = res.data
|
||||
}
|
||||
})
|
||||
},
|
||||
//删除商品类型
|
||||
bindupdata(e) {
|
||||
|
||||
console.log(e)
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '确定要删除当前类型吗?',
|
||||
cancelText: "取消", // 取消按钮的文字
|
||||
confirmText: "确定", // 确认按钮文字
|
||||
showCancel: true, // 是否显示取消按钮,默认为 true
|
||||
confirmColor: '#f55850',
|
||||
cancelColor: '#39B54A',
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
let data = {
|
||||
classifyId: e.classifyId
|
||||
}
|
||||
this.$Request.getA("/admin/goods/deleteClassify", data).then(res => {
|
||||
if (res.code == 0) {
|
||||
uni.showToast({
|
||||
title: "删除成功",
|
||||
icon: 'none'
|
||||
})
|
||||
this.getlist();
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
page {
|
||||
background: #FFFFFF;
|
||||
}
|
||||
|
||||
.btn {
|
||||
border: 2upx solid #999999;
|
||||
border-radius: 24px;
|
||||
color: #333333;
|
||||
padding: 5rpx 30rpx;
|
||||
}
|
||||
|
||||
.addguige {
|
||||
width: 90%;
|
||||
margin: 0 auto;
|
||||
background: #FCD202;
|
||||
box-shadow: 0px 10upx 20upx 0px #FFD9B3;
|
||||
border-radius: 16upx;
|
||||
text-align: center;
|
||||
height: 88upx;
|
||||
line-height: 88upx;
|
||||
position: fixed;
|
||||
bottom: 25upx;
|
||||
left: 0;
|
||||
right: 0;
|
||||
|
||||
}
|
||||
|
||||
.addguiges {
|
||||
width: 90%;
|
||||
margin: 0 auto;
|
||||
background: #FCD202;
|
||||
box-shadow: 0px 10upx 20upx 0px #FFD9B3;
|
||||
border-radius: 16upx;
|
||||
text-align: center;
|
||||
height: 88upx;
|
||||
line-height: 88upx;
|
||||
/* position: fixed;
|
||||
bottom: 25upx;
|
||||
left: 0;
|
||||
right: 0; */
|
||||
}
|
||||
</style>
|
||||
473
my/store/goodDetail.vue
Normal file
473
my/store/goodDetail.vue
Normal file
@@ -0,0 +1,473 @@
|
||||
<template>
|
||||
<view>
|
||||
<!-- <view class="detail-banner ">
|
||||
<swiper class="swiper" :autoplay="true" interval="2000" duration="500" :circular="true" style="width: 100%;height: 410rpx;">
|
||||
<swiper-item v-for="(item,index) in dataCentre.goodsPicture" :key='index' >
|
||||
<image :src="item" mode="scaleToFill" style="width: 100%;"></image>
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
</view> -->
|
||||
<view class="flex padding bg-white">
|
||||
<image :src="dataCentre.goodsCover" style="width:200rpx;height:200rpx;border-radius: 10rpx;"></image>
|
||||
<view class="flex flex-direction justify-between margin-left">
|
||||
<view class="text-black text-bold text-lg">{{dataCentre.goodsName}}</view>
|
||||
<view class="flex">
|
||||
<view v-if="dataCentre.goodsLabel1.length>0" class="btn margin-right-xs"
|
||||
v-for="(item,index) in dataCentre.goodsLabel1" :key='index'>{{item}}</view>
|
||||
</view>
|
||||
<view v-if="type==1">库存:{{dataCentre.inventory?dataCentre.inventory:0}}</view>
|
||||
<view class="text-lg text-red"><text class="text-sm">¥</text>{{dataCentre.goodsMoney}}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- <view class="detail">
|
||||
<view class="detail_text">{{dataCentre.goodsName}}</view>
|
||||
<view class="detail_biao" v-if="dataCentre.goodsLabel.length">
|
||||
<view class="detail_biao_sty" v-for="(ite, ind) in dataCentre.goodsLabel" :key='ind'>{{ite}}</view>
|
||||
</view>
|
||||
<view class="margin-top" v-for="(item,index) in attrList" :key="index" >
|
||||
<view class="text-bold text-black">{{item.value}}</view>
|
||||
<view class="flex margin-tb-sm flex-wrap">
|
||||
<view v-for="(ite, ind) in item.detail" :key="ind" @click="skuSel(ite,index,ind)"
|
||||
class="margin-bottom-sm">
|
||||
<view class="btn" :class="item.goodsId == index && item.attrId == ind?'active': ''">
|
||||
{{ite.name}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view> -->
|
||||
<view class="padding bg-white">
|
||||
<text class="text-bold text-black text-lg ">商品介绍</text>
|
||||
<u-parse class='margin-top' :html="dataCentre.goodsDescribe"></u-parse>
|
||||
</view>
|
||||
|
||||
<view class="padding margin-top-sm bg-white">
|
||||
<view class="text-bold text-black text-lg ">其他信息</view>
|
||||
<view class="flex justify-between align-center margin-tb-sm">
|
||||
<view style="font-size:30upx;color:#999999;">商品售价</view>
|
||||
<view class="text-black">{{dataCentre.goodsMoney?dataCentre.goodsMoney:'暂无'}}</view>
|
||||
</view>
|
||||
<view class="flex justify-between align-center margin-tb-sm">
|
||||
<view style="font-size:30upx;color:#999999;">打包费</view>
|
||||
<view class="text-black">{{dataCentre.packMoney?dataCentre.packMoney:'0'}}</view>
|
||||
</view>
|
||||
<view class="flex justify-between align-center margin-tb-sm">
|
||||
<view style="font-size:30upx;color:#999999;">标签</view>
|
||||
<view class="text-black">{{dataCentre.goodsLabel?dataCentre.goodsLabel:'暂无'}}</view>
|
||||
</view>
|
||||
<view class="flex justify-between align-center margin-tb-sm">
|
||||
<view style="font-size:30upx;color:#999999;">创建时间</view>
|
||||
<view class="text-black">{{dataCentre.createTime}}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="padding margin-top-sm bg-white" v-if="type==1">
|
||||
<view class="text-bold text-black text-lg ">其他设置</view>
|
||||
<view class="flex justify-between align-center margin-tb-sm">
|
||||
<view>商品状态</view>
|
||||
<u-switch @change="change" active-color="#FFCC00" v-model="checked"></u-switch>
|
||||
</view>
|
||||
<view class="flex justify-between align-center margin-tb-sm">
|
||||
<view>库存编辑</view>
|
||||
<input type="number" placeholder="请输入修改库存数" style="text-align: right;" v-model="inventory" />
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
<!-- <view class="bg padding">
|
||||
<view class="flex justify-between ">
|
||||
<view style="font-size:40upx;"><text class="text-sm">¥</text>12.00</view>
|
||||
<view style="color:#999999;" class="text-sm">库存236</view>
|
||||
</view>
|
||||
<view class="text-lg text-bold padding-tb-xs">草莓沫沫酸奶奶昔</view>
|
||||
<view class="flex">
|
||||
<view class="btn">人气爆款</view>
|
||||
<view class="btn">福利必点系列</view>
|
||||
</view>
|
||||
<view class="text-sm padding-tb-sm">规格</view>
|
||||
<view class="flex">
|
||||
<view class="box" v-for="(item,index) in list" :key="index" @click="bindge(index)"
|
||||
:class="count == index?'boxs':''">{{item.name}}</view>
|
||||
</view>
|
||||
<view class="text-sm padding-tb-sm">甜度</view>
|
||||
<view class="flex">
|
||||
<view class="box" v-for="(item,index) in lists" :key="index" @click="bindtd(index)"
|
||||
:class="counts == index?'boxs':''">{{item.name}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="margin-top-sm padding-lr bg">
|
||||
<view class="text-sm padding-top-sm">规格</view>
|
||||
<view class="text-sm padding-tb-sm">蜂蜜黄油,辣辣海苔2款口味可选。精选优质新鲜马铃薯,使用低
|
||||
温真空油炸VF技术锁鲜,香甜不腻,咖哧酥脆,净含量:50</view>
|
||||
</view> -->
|
||||
<!-- <view class="bg padding margin-top-sm">
|
||||
<view class="flex justify-between padding-tb-sm">
|
||||
<view>打包费</view>
|
||||
<view>¥5</view>
|
||||
</view>
|
||||
<view class="flex justify-between padding-tb-sm">
|
||||
<view>折扣价</view>
|
||||
<view>¥9.9</view>
|
||||
</view>
|
||||
</view> -->
|
||||
<view v-if="type==1" class="addgood" @click="save()">保存</view>
|
||||
<view v-if="type==2" class="addgood" @click="goAdd(dataCentre.goodsId)">修改商品</view>
|
||||
<view v-if="type==1" class="addgood" @click="del()">删除</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
list: [{
|
||||
name: '标准'
|
||||
}],
|
||||
count: 0,
|
||||
lists: [{
|
||||
name: '无糖'
|
||||
}, {
|
||||
name: '少糖'
|
||||
}, {
|
||||
name: '半糖'
|
||||
}],
|
||||
counts: 0,
|
||||
goodsId: '',
|
||||
good: {},
|
||||
dataCentre: {},
|
||||
checked: false,
|
||||
shopId: '',
|
||||
inventory: '',
|
||||
type: 1,
|
||||
status: 1,
|
||||
attrList: [],
|
||||
skuList: [],
|
||||
}
|
||||
},
|
||||
onLoad(option) {
|
||||
uni.showLoading({
|
||||
title: '加载中......',
|
||||
icon: 'loading'
|
||||
})
|
||||
console.log(option)
|
||||
this.goodsId = option.goodsId
|
||||
this.shopId = uni.getStorageSync('shopId')
|
||||
this.type = option.type
|
||||
this.getGoodDet()
|
||||
},
|
||||
onShow() {
|
||||
this.getGoodDet()
|
||||
},
|
||||
methods: {
|
||||
goAdd(goodsId) {
|
||||
uni.navigateTo({
|
||||
url: '/my/publish/goods?goodsId='+goodsId
|
||||
})
|
||||
},
|
||||
change(e) {
|
||||
console.log()
|
||||
let that = this
|
||||
let data = {
|
||||
shopId: that.shopId,
|
||||
goodsId: that.goodsId,
|
||||
status: e ? 0 : 1
|
||||
}
|
||||
that.$Request.postA("/admin/goodsShop/soldOutOrPutaway", data).then(res => {
|
||||
if (res.code == 0) {
|
||||
// that.getGoodsList()
|
||||
uni.showToast({
|
||||
title: e ? '上架成功' : '下架成功',
|
||||
icon: 'none'
|
||||
})
|
||||
uni.setStorageSync('updata', true)
|
||||
setTimeout(function() {
|
||||
let pages = getCurrentPages(); // 当前页面
|
||||
let beforePage = pages[pages.length - 2]; // 上一页
|
||||
uni.navigateBack();
|
||||
}, 1000)
|
||||
|
||||
}
|
||||
});
|
||||
},
|
||||
getGoodDet() {
|
||||
if (this.type == 1) {
|
||||
let data = {
|
||||
goodsId: this.goodsId,
|
||||
shopId: this.shopId
|
||||
}
|
||||
this.$Request.getA("/admin/goodsShop/selectGoodsByShopIdAndGoodsId", data).then(res => {
|
||||
if (res.code == 0) {
|
||||
uni.hideLoading()
|
||||
this.dataCentre = res.data
|
||||
|
||||
this.attrList.forEach(res => {
|
||||
let data = {
|
||||
name: ''
|
||||
}
|
||||
// this.checkStateList.push(data);
|
||||
let detail = [];
|
||||
res.detail.split(',').forEach(d => {
|
||||
let data = {
|
||||
name: '',
|
||||
state: ''
|
||||
}
|
||||
data.name = d;
|
||||
detail.push(data);
|
||||
});
|
||||
res.detail = detail;
|
||||
})
|
||||
console.log(this.attrList)
|
||||
}
|
||||
});
|
||||
} else {
|
||||
let data = {
|
||||
goodsId: this.goodsId
|
||||
}
|
||||
this.$Request.getA("/admin/goods/selectGoodsById", data).then(res => {
|
||||
if (res.code == 0) {
|
||||
uni.hideLoading()
|
||||
this.dataCentre = res.data
|
||||
this.attrList.forEach(res => {
|
||||
let data = {
|
||||
name: ''
|
||||
}
|
||||
// this.checkStateList.push(data);
|
||||
let detail = [];
|
||||
res.detail.split(',').forEach(d => {
|
||||
let data = {
|
||||
name: '',
|
||||
state: ''
|
||||
}
|
||||
data.name = d;
|
||||
detail.push(data);
|
||||
});
|
||||
res.detail = detail;
|
||||
})
|
||||
console.log(this.attrList)
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
},
|
||||
// 修改库存
|
||||
save() {
|
||||
let data = {
|
||||
goodsId: this.goodsId,
|
||||
shopId: this.shopId,
|
||||
inventory: this.inventory
|
||||
}
|
||||
this.$Request.postJsonA("/admin/goodsShop/updateGoodsByShopId", data).then(res => {
|
||||
if (res.code == 0) {
|
||||
uni.showToast({
|
||||
title: '保存成功',
|
||||
icon: 'none'
|
||||
})
|
||||
uni.setStorageSync('updata', true)
|
||||
setTimeout(function() {
|
||||
uni.navigateBack({
|
||||
delta: 1
|
||||
})
|
||||
}, 1000)
|
||||
}
|
||||
});
|
||||
},
|
||||
// 添加
|
||||
add(e) {
|
||||
let data = [{
|
||||
goodsId: this.goodsId,
|
||||
shopId: this.shopId
|
||||
}]
|
||||
this.$Request.postJsonA("/admin/goodsShop/addGoodsByShopId", data).then(res => {
|
||||
if (res.code == 0) {
|
||||
// this.page = 1
|
||||
// this.getGoodsList()
|
||||
uni.showToast({
|
||||
title: '添加成功',
|
||||
icon: 'none'
|
||||
})
|
||||
uni.setStorageSync('updata', true)
|
||||
setTimeout(function() {
|
||||
uni.navigateBack({
|
||||
delta: 2
|
||||
})
|
||||
}, 1000)
|
||||
}
|
||||
});
|
||||
},
|
||||
// 删除
|
||||
del(e) {
|
||||
let that = this
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '确认删除商品吗',
|
||||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
console.log('用户点击确定');
|
||||
let data = {
|
||||
shopId: that.shopId,
|
||||
goodsId: this.goodsId,
|
||||
}
|
||||
that.$Request.postA("/admin/goodsShop/deleteGoodsByShopId", data).then(res => {
|
||||
if (res.code == 0) {
|
||||
// that.getGoodsList()
|
||||
uni.showToast({
|
||||
title: '删除成功',
|
||||
icon: 'none'
|
||||
})
|
||||
setTimeout(function() {
|
||||
let pages = getCurrentPages(); // 当前页面
|
||||
let beforePage = pages[pages.length - 2]; // 上一页
|
||||
uni.navigateBack({
|
||||
success: function() {
|
||||
beforePage
|
||||
.onLoad(); // 执行上一页的onLoad方法
|
||||
}
|
||||
});
|
||||
}, 1000)
|
||||
}
|
||||
});
|
||||
} else if (res.cancel) {
|
||||
console.log('用户点击取消');
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
page {
|
||||
background: #EDF1F7;
|
||||
}
|
||||
|
||||
.bg {
|
||||
background: #FFFFFF;
|
||||
}
|
||||
|
||||
.btn {
|
||||
background: rgba(216, 2, 4, 0.2);
|
||||
opacity: 0.6;
|
||||
border-radius: 4upx;
|
||||
color: #D80204;
|
||||
padding: 8rpx 13rpx;
|
||||
font-size: 23rpx;
|
||||
margin-right: 16rpx;
|
||||
}
|
||||
|
||||
.box {
|
||||
border: 2upx solid #CCCCCC;
|
||||
/* opacity: 0.6; */
|
||||
border-radius: 8upx;
|
||||
color: #999999;
|
||||
font-size: 30upx;
|
||||
padding: 13rpx 44rpx;
|
||||
margin-right: 35rpx;
|
||||
}
|
||||
|
||||
.boxs {
|
||||
background: rgba(252, 210, 2, 0.2);
|
||||
border: 2upx solid #FCD202;
|
||||
/* opacity: 0.6; */
|
||||
border-radius: 8upx;
|
||||
color: #333333 !important;
|
||||
font-size: 30upx;
|
||||
padding: 13rpx 44rpx;
|
||||
}
|
||||
|
||||
.addgood {
|
||||
width: 685upx;
|
||||
height: 88upx;
|
||||
background: #FFCC00;
|
||||
border-radius: 8upx;
|
||||
text-align: center;
|
||||
line-height: 88rpx;
|
||||
margin: 40rpx auto;
|
||||
/* position: fixed;
|
||||
bottom: 35rpx;
|
||||
left: 0;
|
||||
right: 0; */
|
||||
font-size: 32rpx;
|
||||
font-weight: bold;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
.detail-banner {
|
||||
width: 100%;
|
||||
height: 410rpx;
|
||||
}
|
||||
|
||||
.detail-banner image {
|
||||
width: 100%;
|
||||
height: 410rpx;
|
||||
}
|
||||
|
||||
.detail {
|
||||
width: 100%;
|
||||
padding: 3%;
|
||||
overflow: hidden;
|
||||
/* position: relative; */
|
||||
/* top: -20rpx; */
|
||||
background-color: #FFFFFF;
|
||||
border-radius: 32rpx 0 0 0;
|
||||
}
|
||||
|
||||
.detail_text {
|
||||
font-size: 36rpx;
|
||||
font-weight: 800;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.detail_biao {
|
||||
display: flex;
|
||||
padding: 2% 0;
|
||||
}
|
||||
|
||||
.detail_biao_sty {
|
||||
/* padding: 1% 1.5%; */
|
||||
padding: 10rpx 20rpx;
|
||||
background: rgba(216, 2, 4, 0.2);
|
||||
opacity: 0.6;
|
||||
color: #D80204;
|
||||
border-radius: 8rpx;
|
||||
font-size: 24rpx;
|
||||
margin-right: 2%;
|
||||
}
|
||||
|
||||
.detail_text2 {
|
||||
font-size: 24rpx;
|
||||
font-family: PingFang SC;
|
||||
color: #333333;
|
||||
margin-top: 1%;
|
||||
}
|
||||
|
||||
.detail_biao2 {
|
||||
display: flex;
|
||||
padding: 1% 0;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
|
||||
.detail_biao2_sty {
|
||||
padding: 1% 2.5%;
|
||||
/* width: 13%; */
|
||||
text-align: center;
|
||||
background: rgba(252, 210, 2, 0.2);
|
||||
border: 2rpx solid #FCD202;
|
||||
opacity: 0.6;
|
||||
border-radius: 8rpx;
|
||||
margin-right: 2%;
|
||||
}
|
||||
|
||||
.detail_biao2_sty2 {
|
||||
padding: 1% 2.5%;
|
||||
/* width: 13%; */
|
||||
text-align: center;
|
||||
border: 2rpx solid #999999;
|
||||
opacity: 0.6;
|
||||
color: #999999;
|
||||
border-radius: 8rpx;
|
||||
margin-right: 3%;
|
||||
}
|
||||
</style>
|
||||
194
my/store/guige.vue
Normal file
194
my/store/guige.vue
Normal file
@@ -0,0 +1,194 @@
|
||||
<template>
|
||||
<view style="padding-bottom: 70px;">
|
||||
<view>
|
||||
<view class="" >
|
||||
<view class="bg btnbox" v-for="(item,index) in list" :key="index" v-if="list.length>0">
|
||||
<view class="padding-sm" style="color:#666666;">创建时间: {{item.createTime}}</view>
|
||||
<view style="width:100%;border-top: 1upx solid #E6E6E6;"></view>
|
||||
<view class="padding-sm">
|
||||
<view class="text-lg text-bold" style="color:#333333;">{{item.ruleName}}</view>
|
||||
<view v-for="(name,index) in item.ruleValue">
|
||||
<view class="flex align-center padding-top">
|
||||
<view style="color:#999999;">{{name.value}}:</view>
|
||||
<view v-for="(ite,index) in name.detail" :key="index">{{ite}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex justify-end padding-tb">
|
||||
<view class="btn " @click="bindupdete(item)">删除</view>
|
||||
<view class="btn1" @click="bindeditor(item)">重新编辑</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="addguige text-bold" @click="goEditor()">添加</view>
|
||||
</view>
|
||||
<empty v-if="!list.length" style="z-index:0"></empty>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import empty from '@/components/empty.vue'
|
||||
export default {
|
||||
components: {
|
||||
empty
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
list: [],
|
||||
shopId:'',
|
||||
shopName:'',
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
uni.showLoading({
|
||||
title: '加载中...'
|
||||
})
|
||||
this.shopId = this.$queue.getData("shopId")
|
||||
this.shopName = this.$queue.getData("shopUserName")
|
||||
this.getlist()
|
||||
},
|
||||
onShow() {
|
||||
this.getlist()
|
||||
},
|
||||
methods: {
|
||||
goEditor() {
|
||||
uni.navigateTo({
|
||||
url: '/my/store/editor'
|
||||
})
|
||||
},
|
||||
getlist() {
|
||||
let data = {
|
||||
shopId: this.shopId
|
||||
}
|
||||
this.$Request.getA("/selfGoodsRule/list", data).then(res => {
|
||||
uni.hideLoading()
|
||||
if (res.code == 0) {
|
||||
this.list = res.data
|
||||
for (var i = 0; i < this.list.length; i++) {
|
||||
for (var a = 0; a < this.list[i].ruleValue.length; a++) {
|
||||
// this.list[i].ruleValue[a].detail = this.list[i].ruleValue[a].detail.split(',')
|
||||
this.list[i].ruleValue[a].detail = this.list[i].ruleValue[a].detail.replaceAll(',','/')
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
},
|
||||
//重新编辑
|
||||
bindeditor(e) {
|
||||
console.log(e)
|
||||
uni.setStorageSync('guige', e)
|
||||
uni.navigateTo({
|
||||
url: '/my/store/editor?id=' + e.id
|
||||
})
|
||||
},
|
||||
//删除
|
||||
bindupdete(e) {
|
||||
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '确定要删除当前规格吗?',
|
||||
cancelText: "取消", // 取消按钮的文字
|
||||
confirmText: "确定", // 确认按钮文字
|
||||
showCancel: true, // 是否显示取消按钮,默认为 true
|
||||
confirmColor: '#f55850',
|
||||
cancelColor: '#39B54A',
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
let data = {
|
||||
id: e.id
|
||||
}
|
||||
this.$Request.getA("/selfGoodsRule/delete", data).then(res => {
|
||||
if (res.code == 0) {
|
||||
uni.showToast({
|
||||
title: "删除成功",
|
||||
icon: 'none'
|
||||
})
|
||||
this.getlist();
|
||||
}else{
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
|
||||
});
|
||||
} else {
|
||||
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
|
||||
console.log(e)
|
||||
|
||||
},
|
||||
},
|
||||
onReachBottom: function() {
|
||||
// this.page = this.page + 1;
|
||||
// this.getlist();
|
||||
|
||||
// if (this.totalCount == this.getlist.length) {
|
||||
// uni.showToast({
|
||||
// title: '已经到底了~',
|
||||
// icon: 'none'
|
||||
// })
|
||||
// }
|
||||
},
|
||||
onPullDownRefresh: function() {
|
||||
// this.page = 1;
|
||||
// this.getlist();
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
page {
|
||||
background: #F2F2F2;
|
||||
}
|
||||
|
||||
.bg {
|
||||
background: #FFFFFF;
|
||||
}
|
||||
|
||||
.btnbox {
|
||||
margin: 20rpx 30rpx;
|
||||
border-radius: 20rpx;
|
||||
}
|
||||
|
||||
.btn {
|
||||
border-radius: 25px;
|
||||
padding: 6rpx 30rpx;
|
||||
border: 1px solid #686868;
|
||||
color: #686868;
|
||||
margin-right: 30rpx;
|
||||
}
|
||||
|
||||
.btn1 {
|
||||
border-radius: 25px;
|
||||
padding: 6rpx 30rpx;
|
||||
background: #FCD202;
|
||||
/* color: #686868; */
|
||||
margin-right: 30rpx;
|
||||
}
|
||||
|
||||
.addguige {
|
||||
width: 90%;
|
||||
margin: 0 auto;
|
||||
background: #FCD202;
|
||||
box-shadow: 0px 10upx 20upx 0px #FFD9B3;
|
||||
border-radius: 16upx;
|
||||
text-align: center;
|
||||
height: 88upx;
|
||||
line-height: 88upx;
|
||||
position: fixed;
|
||||
bottom: 25upx;
|
||||
left: 0;
|
||||
right: 0;
|
||||
z-index: 99;
|
||||
}
|
||||
</style>
|
||||
147
my/store/hdInfo.vue
Normal file
147
my/store/hdInfo.vue
Normal file
@@ -0,0 +1,147 @@
|
||||
<template>
|
||||
<view>
|
||||
<!-- swiper -->
|
||||
<view class="sw">
|
||||
<swiper :indicator-dots="false" style="width: 100%;height: 100%;" :autoplay="true" :interval="3000"
|
||||
:duration="300">
|
||||
<swiper-item v-for="(item,index) in imgs">
|
||||
<image :src="item" style="width: 100%;height: 100%;" mode="aspectFill"></image>
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
</view>
|
||||
<!-- 活动标题 -->
|
||||
<view class="title flex justify-center align-center">
|
||||
<view class="title-box flex align-center">
|
||||
{{info.activityTitle}}
|
||||
</view>
|
||||
</view>
|
||||
<!-- 活动内容 -->
|
||||
<view class="info flex justify-center">
|
||||
<view class="info-box" v-html="content">
|
||||
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 加入按钮 -->
|
||||
<view class="submit flex justify-center align-center">
|
||||
<view class="submit-box flex justify-center align-center" @click="joinHd()">
|
||||
加入活动
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
activityId: '',
|
||||
info: {},
|
||||
content: '',
|
||||
imgs: [],
|
||||
};
|
||||
},
|
||||
onLoad(option) {
|
||||
console.log()
|
||||
this.activityId = option.activityId
|
||||
this.getInfo()
|
||||
},
|
||||
methods: {
|
||||
//加入活动
|
||||
joinHd() {
|
||||
let data = {
|
||||
activityId: this.activityId,
|
||||
shopId: uni.getStorageSync('shopId')
|
||||
}
|
||||
this.$Request.get("/app/activityManage/shopJoinActivity", data).then(res => {
|
||||
if (res.code == 0) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '确定加入该活动?',
|
||||
complete(ret) {
|
||||
if (ret.confirm) {
|
||||
uni.showToast({
|
||||
title: '加入成功'
|
||||
})
|
||||
setTimeout(() => {
|
||||
uni.navigateBack()
|
||||
}, 1000)
|
||||
}
|
||||
|
||||
}
|
||||
})
|
||||
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
});
|
||||
},
|
||||
//活动详情
|
||||
getInfo() {
|
||||
let data = {
|
||||
activityId: this.activityId
|
||||
}
|
||||
this.$Request.get("/app/activityManage/getActivityInfo", data).then(res => {
|
||||
if (res.code == 0) {
|
||||
this.content = res.data.activityContent.replace(new RegExp("img", "g"),
|
||||
'img style="width:100%;height:auto;"')
|
||||
this.info = res.data
|
||||
this.imgs = res.data.activityImage.split(',')
|
||||
}
|
||||
});
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
background-color: #ffffff;
|
||||
}
|
||||
|
||||
.sw {
|
||||
width: 100%;
|
||||
height: 300rpx;
|
||||
}
|
||||
|
||||
.title {
|
||||
width: 100%;
|
||||
height: 100rpx;
|
||||
background-color: #ffffff;
|
||||
|
||||
.title-box {
|
||||
width: 686rpx;
|
||||
height: 100%;
|
||||
font-size: 32rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
|
||||
.info {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
|
||||
.info-box {
|
||||
width: 686rpx;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.submit {
|
||||
width: 100%;
|
||||
height: 160rpx;
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
background-color: #ffffff;
|
||||
|
||||
.submit-box {
|
||||
width: 686rpx;
|
||||
height: 88rpx;
|
||||
background-color: #FCD202;
|
||||
border-radius: 40rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
227
my/store/huodong.vue
Normal file
227
my/store/huodong.vue
Normal file
@@ -0,0 +1,227 @@
|
||||
<template>
|
||||
<view>
|
||||
<!-- swiper -->
|
||||
<view class="myswiper flex justify-center align-center" v-if="myhd.length!=0">
|
||||
<swiper :indicator-dots="false" style="width: 100%;height: 100%;" :autoplay="true" :interval="3000" :duration="300">
|
||||
<swiper-item v-for="(item,index) in myhd" :key="index">
|
||||
<view class="swiper-item">
|
||||
<image :src="item" style="width: 100%;height: 340rpx;" mode="aspectFill"></image>
|
||||
</view>
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
</view>
|
||||
<!-- 活动列表 -->
|
||||
<view :style="myhd.length==0?'margin-top: 20rpx;':'margin-top: -40rpx;'" class="list flex justify-center flex-wrap">
|
||||
<view class="list-box flex justify-center" v-if="item.no != '是'" v-for="(item,index) in huodongList" :key="index" @click="item.se!='是'?gotoinfo(item.activityId):''">
|
||||
<view class="list-box-c flex justify-between align-center">
|
||||
<view class="list-box-c-l flex align-center">
|
||||
<image :src="item.activityImage.split(',')[0]" style="width: 100rpx;height: 100rpx;" mode="aspectFill"></image>
|
||||
<view class="list-box-c-l-txt">
|
||||
{{item.activityTitle}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="list-box-c-r" v-if="item.se!='是'" @click.stop="joinHd(item.activityId)">
|
||||
加入
|
||||
</view>
|
||||
<view class="list-box-c-r" v-else>
|
||||
已加入
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<u-loadmore :status="status" v-if="huodongList.length>0" :icon-type="iconType" :load-text="loadText" />
|
||||
</view>
|
||||
<view class="flex justify-center flex-wrap" v-if="huodongList.length==0">
|
||||
<image src="../../static/images/img/empty.png" style="width: 387rpx;height: 341rpx;margin-top: 100rpx;" mode=""></image>
|
||||
<view class="" style="width: 100%;text-align: center;margin-top: 20rpx;">
|
||||
暂无数据
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
myhd:[],
|
||||
page: 1,
|
||||
limit: 10,
|
||||
huodongList: [],
|
||||
total: 1,
|
||||
status: 'loadmore',
|
||||
iconType: 'flower',
|
||||
activityId:'',
|
||||
loadText: {
|
||||
loadmore: '上拉加载更多',
|
||||
loading: '努力加载中',
|
||||
nomore: '实在没有了'
|
||||
}
|
||||
};
|
||||
},
|
||||
onLoad() {
|
||||
//我参与的活动
|
||||
this.getMyHuoDong()
|
||||
//活动列表
|
||||
this.getHuoDongList();
|
||||
},
|
||||
onShow() {
|
||||
//我参与的活动
|
||||
this.getMyHuoDong()
|
||||
//活动列表
|
||||
this.getHuoDongList();
|
||||
},
|
||||
//加载更多
|
||||
onReachBottom() {
|
||||
if(this.page < this.total){
|
||||
this.page += 1
|
||||
this.status = 'loading'
|
||||
this.getHuoDongList()
|
||||
}
|
||||
},
|
||||
//下拉刷新
|
||||
onPullDownRefresh() {
|
||||
this.page = 1
|
||||
this.getHuoDongList()
|
||||
this.getMyHuoDong()
|
||||
},
|
||||
methods: {
|
||||
//加入活动
|
||||
joinHd(activityId) {
|
||||
let that = this
|
||||
let data = {
|
||||
activityId: activityId,
|
||||
shopId: uni.getStorageSync('shopId')
|
||||
}
|
||||
this.$Request.get("/app/activityManage/shopJoinActivity", data).then(res => {
|
||||
if (res.code == 0) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '加入该活动将自动退出当前活动,确定加入该活动?',
|
||||
complete(ret) {
|
||||
if (ret.confirm) {
|
||||
uni.showToast({
|
||||
title: '加入成功'
|
||||
})
|
||||
//我参与的活动
|
||||
that.getMyHuoDong()
|
||||
//活动列表
|
||||
that.getHuoDongList();
|
||||
}
|
||||
|
||||
}
|
||||
})
|
||||
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
});
|
||||
},
|
||||
gotoinfo(activityId){
|
||||
uni.navigateTo({
|
||||
url:'./hdInfo?activityId='+activityId
|
||||
})
|
||||
},
|
||||
// 我参与的活动
|
||||
getMyHuoDong() {
|
||||
let data = {
|
||||
shopId:uni.getStorageSync('shopId')
|
||||
}
|
||||
this.$Request.get("/app/goods/getShopActivity", data).then(res => {
|
||||
if (res.code == 0) {
|
||||
this.activityId = res.data.activityId
|
||||
this.myhd = res.data.activityImage.split(',')
|
||||
}
|
||||
});
|
||||
},
|
||||
getHuoDongList() {
|
||||
let data = {
|
||||
page: this.page,
|
||||
limit: this.limit
|
||||
}
|
||||
this.$Request.getT("/app/activityManage/getActivityList", data).then(res => {
|
||||
uni.stopPullDownRefresh()
|
||||
if (res.code == 0) {
|
||||
res.data.records.map(item=>{
|
||||
if(item.activityId==14){
|
||||
item.no = '是'
|
||||
}
|
||||
if(item.activityId==this.activityId){
|
||||
item.se = '是'
|
||||
}else{
|
||||
item.se = '否'
|
||||
}
|
||||
})
|
||||
this.total = res.data.pages
|
||||
if (this.page == 1) {
|
||||
this.huodongList = res.data.records
|
||||
} else {
|
||||
this.huodongList = [...this.huodongList, ...res.data.records]
|
||||
}
|
||||
if(this.page == this.total){
|
||||
this.status = 'nomore'
|
||||
}else{
|
||||
this.status = 'loadmore'
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.myswiper {
|
||||
width: 100%;
|
||||
height: 340rpx;
|
||||
z-index: 0;
|
||||
}
|
||||
|
||||
.list {
|
||||
width: 100%;
|
||||
height: 160rpx;
|
||||
|
||||
|
||||
.list-box {
|
||||
width: 686rpx;
|
||||
height: 100%;
|
||||
border-radius: 24rpx;
|
||||
background-color: #ffffff;
|
||||
margin-bottom: 20rpx;
|
||||
z-index: 999;
|
||||
.list-box-c {
|
||||
width: 646rpx;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.list-box-c-l {
|
||||
image {
|
||||
width: 100rpx;
|
||||
height: 100rpx;
|
||||
border-radius: 16rpx;
|
||||
}
|
||||
|
||||
.list-box-c-l-txt {
|
||||
width: 50vw;
|
||||
height: 100rpx;
|
||||
margin-left: 20rpx;
|
||||
font-size: 26rpx;
|
||||
overflow: hidden;
|
||||
line-height: 100rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.list-box-c-r {
|
||||
// border: 1rpx solid #FCD202;
|
||||
background: #FCD202;
|
||||
padding: 10rpx 30rpx 10rpx 30rpx;
|
||||
// color: #ffffff;
|
||||
font-size: 26rpx;
|
||||
border-radius: 24rpx;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
596
my/store/index.vue
Normal file
596
my/store/index.vue
Normal file
@@ -0,0 +1,596 @@
|
||||
<template>
|
||||
<view class="padding">
|
||||
<view class="text-white padding bg radius">
|
||||
<u-form :model="shop" label-position="top">
|
||||
<u-form-item label="店铺名称 ">
|
||||
<text class="text-sm" @click="gokefu()"
|
||||
style="color: red;position: absolute;top: 20rpx;left:135rpx;">*请联系客服修改</text>
|
||||
<u-input v-model="shop.shopName" placeholder="请输入店铺名称" :disabled="true" />
|
||||
</u-form-item>
|
||||
<u-form-item label="开店时间">
|
||||
<!-- #ifdef MP-WEIXIN -->
|
||||
<u-input v-model="shop.businessHours" placeholder="请填写" :disabled="true"
|
||||
@click="startShow = true" />
|
||||
<!-- #endif -->
|
||||
<!-- #ifndef MP-WEIXIN -->
|
||||
<view style="width: 100%;">
|
||||
<picker mode="time" :value="shop.businessHours" placeholder="请填写" start="00:00" end="23:59"
|
||||
@change="bindTimeChange">
|
||||
<view class="uni-input">{{shop.businessHours?shop.businessHours:'请填写'}}</view>
|
||||
</picker>
|
||||
</view>
|
||||
<!-- #endif -->
|
||||
</u-form-item>
|
||||
<u-form-item label="闭店时间">
|
||||
<!-- #ifdef MP-WEIXIN -->
|
||||
<u-input v-model="shop.lockHours" :disabled="true" placeholder="请填写" @click="endShow = true" />
|
||||
<!-- #endif -->
|
||||
<!-- #ifndef MP-WEIXIN -->
|
||||
<view style="width: 100%;">
|
||||
<picker mode="time" :value="shop.lockHours" placeholder="请填写" start="00:00" end="23:59"
|
||||
@change="bindTimeChanges">
|
||||
<view class="uni-input">{{shop.lockHours?shop.lockHours:'请填写'}}</view>
|
||||
</picker>
|
||||
</view>
|
||||
<!-- #endif -->
|
||||
</u-form-item>
|
||||
<u-form-item label="店铺地址">
|
||||
<text class="text-sm" @click="gokefu()"
|
||||
style="color: red;position: absolute;top: 20rpx;left:135rpx;">*请联系客服修改</text>
|
||||
<!-- @click="bindOpen()" -->
|
||||
<u-input v-model="shop.detailedAddress" :disabled="true" placeholder="请填写" />
|
||||
</u-form-item>
|
||||
<u-form-item label="店铺公告">
|
||||
<textarea v-model="shop.shopNotice" rows="3" placeholder="请填写" maxlength="50" />
|
||||
</u-form-item>
|
||||
<u-form-item label="配送费(元)">
|
||||
<text class="text-sm" @click="gokefu()"
|
||||
style="color: red;position: absolute;top: 20rpx;left:155rpx;">*请联系客服修改</text>
|
||||
<u-input v-model="shop.errandMoney" placeholder="请输入配送费" :disabled="true" />
|
||||
</u-form-item>
|
||||
<u-form-item label="最低起送金额(元)">
|
||||
<u-input v-model="shop.minimumDelivery" placeholder="请输入最低起送金额" />
|
||||
</u-form-item>
|
||||
<u-form-item label="减免配送费最小订单金额(元)">
|
||||
<u-input v-model="shop.exemptMinMoney" placeholder="请输入减免配送费最小订单金额" />
|
||||
</u-form-item>
|
||||
<u-form-item label="最大配送距离(千米)">
|
||||
<text class="text-sm" @click="gokefu()"
|
||||
style="color: red;position: absolute;top: 20rpx;left:285rpx;">*请联系客服修改</text>
|
||||
<u-input v-model="distributionDistance" placeholder="请输入最大配送距离(单位:km)" :disabled="true" />
|
||||
</u-form-item>
|
||||
<u-form-item label="是否上线">
|
||||
<u-radio-group v-model="shop.putawayFlag">
|
||||
<u-radio name=0>上班啦</u-radio>
|
||||
<u-radio name=1>打烊啦</u-radio>
|
||||
</u-radio-group>
|
||||
</u-form-item>
|
||||
<u-form-item label="是否开启平台配送">
|
||||
<u-radio-group v-model="shop.autoSendOrder">
|
||||
<u-radio name=0>开启</u-radio>
|
||||
<u-radio name=1>关闭</u-radio>
|
||||
</u-radio-group>
|
||||
</u-form-item>
|
||||
<u-form-item label="是否开启自动接单">
|
||||
<u-radio-group v-model="shop.autoAcceptOrder">
|
||||
<u-radio name=0>开启</u-radio>
|
||||
<u-radio name=1>关闭</u-radio>
|
||||
</u-radio-group>
|
||||
</u-form-item>
|
||||
</u-form>
|
||||
</view>
|
||||
|
||||
<view class="text-white padding bg radius margin-tb">
|
||||
<u-form :model="shop" label-position="top">
|
||||
<u-form-item label="打印机">
|
||||
<text class="text-sm"
|
||||
style="color: red;position: absolute;top: 25rpx;left: 105rpx;">*一个打印机只能绑定一个商家</text>
|
||||
<u-radio-group v-model="shop.facility">
|
||||
<!-- <u-radio name=0>上线</u-radio> -->
|
||||
<u-radio name=1>飞鹅</u-radio>
|
||||
</u-radio-group>
|
||||
</u-form-item>
|
||||
<u-form-item label="设备sn编码">
|
||||
<u-input v-model="shop.snCode" placeholder="请输入设备sn编码" />
|
||||
</u-form-item>
|
||||
<u-form-item label="设备key秘钥">
|
||||
<u-input v-model="shop.value" placeholder="请输入设备key秘钥" />
|
||||
</u-form-item>
|
||||
</u-form>
|
||||
</view>
|
||||
<view class="text-white padding bg radius margin-tb">
|
||||
<view>
|
||||
<view class="text-lg margin-top-sm text-black">店铺logo</view>
|
||||
<view class="flex" style="overflow: hidden;flex-wrap: wrap;">
|
||||
<view v-if="shop.shopCover.length">
|
||||
<view class="margin-top flex margin-right-sm flex-wrap">
|
||||
<view class="flex"
|
||||
style="width: 200rpx;height: 200rpx;margin-right: 2rpx;position: relative;">
|
||||
<image :src="shop.shopCover" style="width: 100%;height: 100%;"></image>
|
||||
<view style="z-index: 9;position: absolute;top: -15rpx;right: -15rpx;"
|
||||
@click="removeImgs()">
|
||||
<u-icon name="close-circle-fill" color="#2979ff" size="50rpx"></u-icon>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="margin-top" @click="addImage()" v-if="shop.shopCover.length<=0">
|
||||
<view style="width: 200rpx;height: 200rpx;background: #f4f5f6;"
|
||||
class="flex justify-center align-center">
|
||||
<view>
|
||||
<view class="text-center">
|
||||
<image src="../static/addimg.png" style="width: 65rpx;height: 55rpx;">
|
||||
</image>
|
||||
</view>
|
||||
<view class="text-center text-black">添加图片</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view>
|
||||
<view class="text-lg margin-top-sm text-black">店铺活动广告图(可多张)</view>
|
||||
<view class="flex" style="overflow: hidden;flex-wrap: wrap;">
|
||||
<view v-if="shopBanner.length">
|
||||
<view class="margin-top flex margin-right-sm flex-wrap">
|
||||
<view class="flex"
|
||||
style="width: 200rpx;height: 200rpx;margin-right: 2rpx;position: relative;"
|
||||
v-for="(image,index) in shopBanner" :key="index">
|
||||
<image :src="image" style="width: 100%;height: 100%;"></image>
|
||||
<view style="z-index: 9;position: absolute;top: -15rpx;right: -15rpx;"
|
||||
@click="removeImg(index)">
|
||||
<u-icon name="close-circle-fill" color="#2979ff" size="50rpx"></u-icon>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="margin-top" @click="addImages(2)" v-if="shopBanner.length<6">
|
||||
<view style="width: 200rpx;height: 200rpx;background: #f4f5f6;"
|
||||
class="flex justify-center align-center">
|
||||
<view>
|
||||
<view class="text-center">
|
||||
<image src="../static/addimg.png" style="width: 65rpx;height: 55rpx;">
|
||||
</image>
|
||||
</view>
|
||||
<view class="text-center text-black">添加图片</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 时间筛选 -->
|
||||
<u-picker v-model="startShow" mode="time" :params="params" @confirm="getStarttime()"></u-picker>
|
||||
|
||||
<u-picker v-model="endShow" mode="time" :params="paramss" @confirm="getEndtime()"></u-picker>
|
||||
|
||||
|
||||
<u-button @click="submit" class="margin-top" :custom-style="customStyle" shape="square" :hair-line="false">提交
|
||||
</u-button>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import configdata from '@/common/config.js';
|
||||
export default {
|
||||
|
||||
data() {
|
||||
return {
|
||||
shop: {
|
||||
shopName: '',
|
||||
businessHours: '',
|
||||
lockHours: '',
|
||||
detailedAddress: '',
|
||||
shopNotice: '',
|
||||
putawayFlag: 1,
|
||||
latitude: '',
|
||||
longitude: '',
|
||||
shopCover: '',
|
||||
//详情图
|
||||
shopBanner: [],
|
||||
shopId: uni.getStorageSync('shopId'),
|
||||
errandMoney: '',
|
||||
minimumDelivery: '',
|
||||
exemptMinMoney: '',
|
||||
distributionDistance: '',
|
||||
autoSendOrder: 1,
|
||||
autoAcceptOrder: 1,
|
||||
facility: 1,
|
||||
snCode: '',
|
||||
value: ''
|
||||
},
|
||||
// facility:1,
|
||||
startShow: false,
|
||||
endShow: false,
|
||||
customStyle: {
|
||||
backgroundColor: '#FFCC00',
|
||||
color: '#000000',
|
||||
border: 0
|
||||
},
|
||||
status: 1,
|
||||
customStyle1: {
|
||||
color: '#000000',
|
||||
position: "fixed",
|
||||
bottom: "15rpx",
|
||||
left: "0rpx",
|
||||
right: "0rpx",
|
||||
margin: "0rpx 50rpx",
|
||||
backgroundColor: '#FFCC00',
|
||||
},
|
||||
selarr: [],
|
||||
show: false,
|
||||
//详情图
|
||||
shopBanner: [],
|
||||
params: {
|
||||
year: false,
|
||||
month: false,
|
||||
day: false,
|
||||
hour: true,
|
||||
minute: true,
|
||||
second: false
|
||||
},
|
||||
paramss: {
|
||||
year: false,
|
||||
month: false,
|
||||
day: false,
|
||||
hour: true,
|
||||
minute: true,
|
||||
second: false
|
||||
},
|
||||
shopId: '',
|
||||
|
||||
page: 1,
|
||||
limit: 100,
|
||||
list: [{
|
||||
name: '上线',
|
||||
disabled: false
|
||||
},
|
||||
{
|
||||
name: '下线',
|
||||
disabled: false
|
||||
}
|
||||
],
|
||||
distributionDistance: ''
|
||||
}
|
||||
},
|
||||
onLoad(option) {
|
||||
uni.showLoading({
|
||||
title: '加载中......',
|
||||
icon: 'loading'
|
||||
})
|
||||
// console.log(option, '店铺id')
|
||||
this.shopId = option.shopId
|
||||
|
||||
this.getShopList()
|
||||
},
|
||||
onShow() {
|
||||
|
||||
},
|
||||
methods: {
|
||||
gokefu() {
|
||||
uni.navigateTo({
|
||||
url: '/pages/my/chat'
|
||||
})
|
||||
},
|
||||
bindTimeChange: function(e) {
|
||||
console.log(e)
|
||||
this.shop.businessHours = e.target.value
|
||||
},
|
||||
bindTimeChanges: function(e) {
|
||||
console.log(e)
|
||||
this.shop.lockHours = e.target.value
|
||||
},
|
||||
//上线 下线
|
||||
radioChange(e) {
|
||||
// console.log(e)
|
||||
},
|
||||
// 店铺信息
|
||||
getShopList() {
|
||||
let data = {
|
||||
shopId: this.$queue.getData('shopId')
|
||||
}
|
||||
this.$Request.getA("/app/shop/selectShopMessage", data).then(res => {
|
||||
if (res.code == 0) {
|
||||
uni.hideLoading()
|
||||
this.shop.shopName = res.data.shopName
|
||||
this.shop.detailedAddress = res.data.detailedAddress
|
||||
this.shop.businessHours = res.data.businessHours
|
||||
this.shop.lockHours = res.data.lockHours
|
||||
this.shop.shopCover = res.data.shopCover
|
||||
this.shop.shopNotice = res.data.shopNotice
|
||||
this.shop.putawayFlag = res.data.putawayFlag ? res.data.putawayFlag : 0
|
||||
this.shop.errandMoney = res.data.errandMoney
|
||||
this.shop.minimumDelivery = res.data.minimumDelivery
|
||||
this.shop.exemptMinMoney = res.data.exemptMinMoney
|
||||
if (res.data.shopBanner) {
|
||||
this.shop.shopBanner = res.data.shopBanner.split(',')
|
||||
this.shopBanner = res.data.shopBanner.split(',')
|
||||
}
|
||||
this.shop.distributionDistance = res.data.distributionDistance
|
||||
this.distributionDistance = res.data.distributionDistance / 1000
|
||||
this.shop.autoSendOrder = res.data.autoSendOrder ? res.data.autoSendOrder : 0;
|
||||
this.shop.autoAcceptOrder = res.data.autoAcceptOrder ? res.data.autoAcceptOrder : 0;
|
||||
this.shop.snCode = res.data.snCode //设备sn编码
|
||||
this.shop.value = res.data.value //设备key秘钥
|
||||
// this.shop.facility = res.data.facility // 设备类型
|
||||
}
|
||||
});
|
||||
},
|
||||
getStarttime(e) {
|
||||
console.log(e, '1111111111')
|
||||
|
||||
this.shop.businessHours = e.hour + ':' + e.minute
|
||||
},
|
||||
getEndtime(e) {
|
||||
console.log(e)
|
||||
this.shop.lockHours = e.hour + ':' + e.minute
|
||||
},
|
||||
// 详情图删除
|
||||
removeImg(index) {
|
||||
this.shopBanner.splice(index, 1)
|
||||
},
|
||||
// 店铺logo删除
|
||||
removeImgs() {
|
||||
this.shop.shopCover = ''
|
||||
},
|
||||
bindOpen(e) {
|
||||
console.log(e)
|
||||
let that = this
|
||||
uni.chooseLocation({
|
||||
success: function(res) {
|
||||
console.log('位置名称:' + res.name);
|
||||
console.log('详细地址:' + res.address);
|
||||
console.log('纬度:' + res.latitude);
|
||||
console.log('经度:' + res.longitude);
|
||||
that.shop.detailedAddress = res.address
|
||||
that.shop.shopLat = res.latitude
|
||||
that.shop.shopLng = res.longitude
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
// 图片上传
|
||||
addImages(e) {
|
||||
let that = this
|
||||
uni.chooseImage({
|
||||
count: 6,
|
||||
sourceType: ['album', 'camera'],
|
||||
success: res => {
|
||||
for (let i = 0; i < res.tempFilePaths.length; i++) {
|
||||
that.$queue.showLoading("上传中...");
|
||||
uni.uploadFile({ // 上传接口
|
||||
url: that.config("APIHOST1") + '/alioss/upload', //真实的接口地址
|
||||
filePath: res.tempFilePaths[i],
|
||||
name: 'file',
|
||||
success: (uploadFileRes) => {
|
||||
if (that.shopBanner.length < 6) {
|
||||
that.shopBanner.push(JSON.parse(uploadFileRes.data).data)
|
||||
}
|
||||
|
||||
console.log(that.shopBanner)
|
||||
uni.hideLoading();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
// 图片上传
|
||||
addImage() {
|
||||
let that = this
|
||||
uni.chooseImage({
|
||||
count: 1,
|
||||
sourceType: ['album', 'camera'],
|
||||
success: res => {
|
||||
for (let i = 0; i < res.tempFilePaths.length; i++) {
|
||||
that.$queue.showLoading("上传中...");
|
||||
uni.uploadFile({ // 上传接口
|
||||
url: that.config("APIHOST1") + '/alioss/upload', //真实的接口地址
|
||||
// url: 'https://jiazheng.xianmxkj.com/sqx_fast/alioss/upload',
|
||||
filePath: res.tempFilePaths[i],
|
||||
name: 'file',
|
||||
success: (uploadFileRes) => {
|
||||
that.shop.shopCover = JSON.parse(uploadFileRes.data).data
|
||||
uni.hideLoading();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
config: function(name) {
|
||||
var info = null;
|
||||
if (name) {
|
||||
var name2 = name.split("."); //字符分割
|
||||
if (name2.length > 1) {
|
||||
info = configdata[name2[0]][name2[1]] || null;
|
||||
} else {
|
||||
info = configdata[name] || null;
|
||||
}
|
||||
if (info == null) {
|
||||
let web_config = cache.get("web_config");
|
||||
if (web_config) {
|
||||
if (name2.length > 1) {
|
||||
info = web_config[name2[0]][name2[1]] || null;
|
||||
} else {
|
||||
info = web_config[name] || null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return info;
|
||||
},
|
||||
// 发布
|
||||
submit() {
|
||||
console.log(this.distributionDistance)
|
||||
this.shop.shopBanner = this.shopBanner
|
||||
this.shop.shopBanner = this.shop.shopBanner.toString();
|
||||
this.shop.distributionDistance = this.distributionDistance * 1000
|
||||
// this.shop.distributionDistance = this.shop.distributionDistance * 1000
|
||||
|
||||
// if (!this.shop.shopName) {
|
||||
// uni.showToast({
|
||||
// title: '请填写店铺名称',
|
||||
// icon: 'none',
|
||||
// duration: 1000
|
||||
// })
|
||||
// return
|
||||
// }
|
||||
if (!this.shop.businessHours) {
|
||||
uni.showToast({
|
||||
title: '请填写开店时间',
|
||||
icon: 'none',
|
||||
duration: 1000
|
||||
})
|
||||
return
|
||||
}
|
||||
if (!this.shop.lockHours) {
|
||||
uni.showToast({
|
||||
title: '请填写闭店时间',
|
||||
icon: 'none',
|
||||
duration: 1000
|
||||
})
|
||||
return
|
||||
}
|
||||
// if (!this.shop.detailedAddress) {
|
||||
// uni.showToast({
|
||||
// title: '请填写店铺地址',
|
||||
// icon: 'none',
|
||||
// duration: 1000
|
||||
// })
|
||||
// return
|
||||
// }
|
||||
if (!this.shop.shopNotice) {
|
||||
uni.showToast({
|
||||
title: '请填写店铺公告',
|
||||
icon: 'none',
|
||||
duration: 1000
|
||||
})
|
||||
return
|
||||
}
|
||||
// if (!this.shop.snCode) {
|
||||
// uni.showToast({
|
||||
// title: '请填写设备sn编码',
|
||||
// icon: 'none',
|
||||
// duration: 1000
|
||||
// })
|
||||
// return
|
||||
// }
|
||||
// if (!this.shop.value) {
|
||||
// uni.showToast({
|
||||
// title: '请填写设备key秘钥',
|
||||
// icon: 'none',
|
||||
// duration: 1000
|
||||
// })
|
||||
// return
|
||||
// }
|
||||
|
||||
if (!this.shop.shopCover) {
|
||||
uni.showToast({
|
||||
title: '请上传店铺logo',
|
||||
icon: 'none',
|
||||
duration: 1000
|
||||
})
|
||||
return
|
||||
}
|
||||
if (!this.shop.shopBanner) {
|
||||
uni.showToast({
|
||||
title: '请上传店铺轮播图',
|
||||
icon: 'none',
|
||||
duration: 1000
|
||||
})
|
||||
return
|
||||
}
|
||||
// console.log('this.shop.putawayFlag',this.shop.putawayFlag)
|
||||
// return
|
||||
if (this.shop.putawayFlag == 0) {
|
||||
|
||||
// if (!this.shop.errandMoney) {
|
||||
// uni.showToast({
|
||||
// title: '请填写配送费',
|
||||
// icon: 'none',
|
||||
// duration: 1000
|
||||
// })
|
||||
// return
|
||||
// }
|
||||
if (!this.shop.minimumDelivery) {
|
||||
this.shop.minimumDelivery = 0;
|
||||
// uni.showToast({
|
||||
// title: '请填写最低起送金额',
|
||||
// icon: 'none',
|
||||
// duration: 1000
|
||||
// })
|
||||
// return
|
||||
}
|
||||
if (!this.shop.exemptMinMoney) {
|
||||
this.shop.exemptMinMoney = 0;
|
||||
// uni.showToast({
|
||||
// title: '请填写减免配送费最小订单金额',
|
||||
// icon: 'none',
|
||||
// duration: 1000
|
||||
// })
|
||||
// return
|
||||
}
|
||||
console.log(this.shop.distributionDistance)
|
||||
// if (!this.shop.distributionDistance) {
|
||||
// uni.showToast({
|
||||
// title: '请填写最大配送距离',
|
||||
// icon: 'none',
|
||||
// duration: 1000
|
||||
// })
|
||||
// return
|
||||
// }
|
||||
}
|
||||
console.log(this.shop)
|
||||
// uni.setStorageSync('shopId', this.shop.shopId)
|
||||
this.$Request.postJsonA("/app/shop/updateShopMessage", this.shop).then(res => {
|
||||
if (res.code == 0) {
|
||||
uni.showToast({
|
||||
title: '修改成功',
|
||||
icon: 'none'
|
||||
})
|
||||
|
||||
setTimeout(function() {
|
||||
uni.navigateBack()
|
||||
// uni.navigateTo({
|
||||
// url: '/my/publish/index'
|
||||
// })
|
||||
}, 1000)
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
});
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
page {
|
||||
background-color: #F5F5F5;
|
||||
}
|
||||
|
||||
.bg {
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
|
||||
|
||||
.tabBox {
|
||||
border: 1rpx solid #999999;
|
||||
padding: 15rpx 20rpx;
|
||||
border-radius: 15rpx;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
.btnnum {
|
||||
color: #005DFF;
|
||||
border: 1rpx solid #005DFF;
|
||||
}
|
||||
</style>
|
||||
369
my/store/pingjia.vue
Normal file
369
my/store/pingjia.vue
Normal file
@@ -0,0 +1,369 @@
|
||||
<template>
|
||||
<view>
|
||||
<view class="flex margin-lr padding-tb-sm u-border-bottom" v-if="shopDet.shopScore">
|
||||
<view class="flex padding-right">
|
||||
<view class="text-sl" style="color: #FD6416;">{{shopDet.shopScore}}</view>
|
||||
<view class="flex flex-direction justify-around margin-left-sm">
|
||||
<view>商家评分</view>
|
||||
<view class="flex">
|
||||
<u-icon v-for="ite in shopDet.shopScore1" :key='ite' color="#FCD202" name="star-fill"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex-sub flex justify-around u-border-left padding-left">
|
||||
<view class="flex flex-direction justify-around text-center">
|
||||
<view>好评</view>
|
||||
<view>{{EvaluateData.goodReputation}}</view>
|
||||
</view>
|
||||
<view class="flex flex-direction justify-around text-center">
|
||||
<view>中评</view>
|
||||
<view>{{EvaluateData.mediumReview}}</view>
|
||||
</view>
|
||||
<view class="flex flex-direction justify-around text-center">
|
||||
<view>差评</view>
|
||||
<view>{{EvaluateData.negativeComment}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="padding-tb-sm margin-lr">
|
||||
<u-button hover-class='none' @click="sel(0)" type="primary" shape="circle" size="mini" :plain="false"
|
||||
:custom-style="count==0?customStyle:customStyle1">全部评论</u-button>
|
||||
<u-button hover-class='none' @click="sel(1)" type="primary" shape="circle" size="mini" :plain="false"
|
||||
:custom-style="count==1?customStyle:customStyle1">
|
||||
好评({{EvaluateData.goodReputation}})</u-button>
|
||||
<u-button hover-class='none' @click="sel(2)" type="primary" shape="circle" size="mini" :plain="false"
|
||||
:custom-style="count==2?customStyle:customStyle1">
|
||||
中评({{EvaluateData.mediumReview}})</u-button>
|
||||
<u-button hover-class='none' @click="sel(3)" type="primary" shape="circle" size="mini" :plain="false"
|
||||
:custom-style="count==3?customStyle:customStyle1">
|
||||
差评({{EvaluateData.negativeComment}})</u-button>
|
||||
</view>
|
||||
<view class="padding-tb-sm margin-lr u-border-bottom" v-for="(item, index) in EvaluateList" :key='index'>
|
||||
<view class="flex justify-between align-center">
|
||||
<view class="flex align-center">
|
||||
<u-avatar :src="item.avatar" size="65"></u-avatar>
|
||||
<view class=" margin-left-sm" style="line-height: 46upx;">{{item.userName?item.userName:'匿名'}}
|
||||
</view>
|
||||
<view class="flex margin-left-sm">
|
||||
<u-icon v-for="ite in item.score" :key='ite' color="#FCD202" name="star-fill">
|
||||
</u-icon>
|
||||
</view>
|
||||
</view>
|
||||
<view>{{item.createTime}}</view>
|
||||
</view>
|
||||
<view style="display: flex;">
|
||||
<view class="margin-top-sm" :style="!item.shopReplyMessage ? 'width: 90%;' : ''">{{item.evaluateMessage}}</view>
|
||||
<view class="flex padding-top-sm margin-right" @tap="goShow(index)" v-if="!item.shopReplyMessage">
|
||||
<image src="../../static/images/order/pinglun.png" style="width: 20px;height: 20px;"></image>
|
||||
</view>
|
||||
</view>
|
||||
<view class="margin-top-sm" v-if="item.shopReplyMessage">
|
||||
<view class="flex align-center">
|
||||
<view class=" flex align-center text-df" style="color: #999999;">
|
||||
<view class="text-df">商家回复:</view>{{item.shopReplyMessage}}
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view class="text-lg padding-left margin-left-xl">{{dataDet.shopReplyMessage}}</view> -->
|
||||
</view>
|
||||
<view class="flex" style="width: 100%;margin-top: 20rpx;flex-wrap: wrap;" v-if="item.pictures">
|
||||
<image @click="lookImgs(ind,item.pictures)" :src="ite" v-for="(ite,ind) in item.pictures" :key="ind" style="width: 200rpx;height: 200rpx;margin-right: 10rpx;margin-bottom: 10rpx;" mode=""></image>
|
||||
</view>
|
||||
</view>
|
||||
<empty v-if="EvaluateList.length<=0"></empty>
|
||||
<!-- 评论弹框 -->
|
||||
<u-popup v-model="show" mode="bottom" border-radius="14" :closeable="closeable">
|
||||
<view>
|
||||
<view class="margin padding-tb">
|
||||
<u-input v-model="pinglun" type="textarea" height="200" placeholder="请填写回复的内容" maxlengt="200"
|
||||
:clearable="false" style="background:#F5F5F5;" />
|
||||
</view>
|
||||
<view class="btn" @click="bindEvaluate()">提交</view>
|
||||
</view>
|
||||
</u-popup>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import empty from '../../components/empty.vue'
|
||||
export default {
|
||||
components:{
|
||||
empty
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
pinglun: '',
|
||||
count: 0,
|
||||
show: false,
|
||||
customStyle: {
|
||||
color: '#333333',
|
||||
background: '#FCD202',
|
||||
marginRight: '20rpx',
|
||||
border: 0
|
||||
},
|
||||
customStyle1: {
|
||||
color: '#333333',
|
||||
background: '#F2F2F2',
|
||||
marginRight: '20rpx',
|
||||
border: 0
|
||||
},
|
||||
cashDeposit: [],
|
||||
EvaluateData: {},
|
||||
EvaluateList: [],
|
||||
grade: '',
|
||||
page: 1,
|
||||
size: 10,
|
||||
isShow: false,
|
||||
oneData: [],
|
||||
titleData: [],
|
||||
shopDet: {}
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
this.getshanghuinfo();
|
||||
this.getList()
|
||||
},
|
||||
onReachBottom: function() {
|
||||
this.page = this.page + 1;
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
//预览图片
|
||||
lookImgs(index,imgs){
|
||||
uni.previewImage({
|
||||
current:index,
|
||||
urls:imgs
|
||||
})
|
||||
},
|
||||
goShow(index){
|
||||
this.orderNumber = this.EvaluateList[index].orderNumber;
|
||||
this.show = true;
|
||||
},
|
||||
getshanghuinfo() {
|
||||
let data = {
|
||||
shopId: uni.getStorageSync('shopId')
|
||||
}
|
||||
this.$Request.get("/app/shop/selectShopMessage", data).then(res => {
|
||||
if (res.code == 0) {
|
||||
this.shopDet = res.data;
|
||||
this.shopDet.shopScore = parseFloat(this.shopDet.shopScore).toFixed(1)
|
||||
this.shopDet.shopScore1 = Math.floor(this.shopDet.shopScore)
|
||||
}
|
||||
});
|
||||
},
|
||||
//评论
|
||||
bindEvaluate() {
|
||||
let data = {
|
||||
shopReplyMessage: this.pinglun,
|
||||
orderNumber: this.orderNumber
|
||||
}
|
||||
this.$Request.postT("/admin/order/shopReplyEvaluate", data).then(res => {
|
||||
uni.hideLoading()
|
||||
if (res.code == 0) {
|
||||
this.show = false
|
||||
this.page = 1
|
||||
this.getList()
|
||||
}
|
||||
});
|
||||
},
|
||||
sel(e) {
|
||||
this.grade = e
|
||||
this.count = e
|
||||
this.page = 1
|
||||
this.getList()
|
||||
},
|
||||
open(data) {
|
||||
console.log(data);
|
||||
this.oneData = data;
|
||||
this.titleData = data.goods
|
||||
this.isShow = true;
|
||||
},
|
||||
close() {
|
||||
this.isShow = false;
|
||||
},
|
||||
// 获取评价列表
|
||||
getList() {
|
||||
let data = {
|
||||
shopId: uni.getStorageSync('shopId'),
|
||||
page: this.page,
|
||||
limit: this.size,
|
||||
grade: this.grade
|
||||
}
|
||||
this.$Request.get("/app/goods/selectEvaluateByShopId", data).then(res => {
|
||||
if (res.code == 0 && res.data) {
|
||||
this.EvaluateData = res.data
|
||||
res.data.pageUtils.list.map(item=>{
|
||||
if(item.pictures){
|
||||
item.pictures = item.pictures.split(',')
|
||||
}else{
|
||||
item.pictures = []
|
||||
}
|
||||
})
|
||||
if (this.page == 1) {
|
||||
this.EvaluateList = res.data.pageUtils.list
|
||||
} else {
|
||||
this.EvaluateList = [...this.EvaluateList, ...res.data.pageUtils.list]
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
|
||||
.box1 {
|
||||
position: absolute;
|
||||
background: #000000;
|
||||
width: 750rpx;
|
||||
height: 100vh;
|
||||
opacity: 0.4;
|
||||
}
|
||||
|
||||
.moudes {
|
||||
width: 650rpx;
|
||||
position: absolute;
|
||||
background: #FFFFFF;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
margin: auto;
|
||||
height: 700rpx;
|
||||
border-radius: 10rpx;
|
||||
|
||||
.bt {
|
||||
font-size: 30rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.pjImg {
|
||||
width: 200rpx;
|
||||
height: 200rpx;
|
||||
}
|
||||
|
||||
.navBox {
|
||||
.avtiter {
|
||||
width: 80rpx;
|
||||
height: 80rpx;
|
||||
border-radius: 40rpx;
|
||||
margin-right: 15rpx
|
||||
}
|
||||
|
||||
padding-left: 30rpx;
|
||||
padding-top: 30rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.userName {
|
||||
font-size: 28rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
.nrTxt {
|
||||
display: inline-block;
|
||||
width: 500rpx;
|
||||
}
|
||||
|
||||
.navList {
|
||||
text-align: center;
|
||||
margin-top: 30rpx;
|
||||
padding-left: 30rpx;
|
||||
padding-right: 30rpx;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
|
||||
.xq {
|
||||
font-size: 30rpx;
|
||||
font-weight: bolder;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
.contentTxt {
|
||||
|
||||
view {
|
||||
margin-bottom: 30rpx;
|
||||
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.title {
|
||||
font-size: 30rpx;
|
||||
font-weight: bold;
|
||||
color: #000000;
|
||||
margin-right: 15rpx;
|
||||
}
|
||||
|
||||
.imgRsc {
|
||||
width: 100rpx;
|
||||
height: 100rpx;
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.list_1 {
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
.btn {
|
||||
width: 690upx;
|
||||
height: 88upx;
|
||||
margin: 30upx auto;
|
||||
background: #FCD202;
|
||||
box-shadow: 0px 10upx 20upx 0upx #FFD9B3;
|
||||
border-radius: 16upx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
color: #000000;
|
||||
|
||||
}
|
||||
|
||||
.one {
|
||||
background: #FFFFFF;
|
||||
margin-top: 20rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding: 20rpx;
|
||||
|
||||
.imgSrc {
|
||||
width: 100rpx;
|
||||
height: 100rpx;
|
||||
vertical-align: middle;
|
||||
margin-right: 20rpx;
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
|
||||
.name {
|
||||
margin-top: 10rpx;
|
||||
margin-bottom: 20rpx;
|
||||
font-size: 24rpx;
|
||||
color: #000000;
|
||||
}
|
||||
|
||||
.timer {
|
||||
font-size: 20rpx;
|
||||
color: #b3b3c4;
|
||||
}
|
||||
|
||||
.contentTxt {
|
||||
|
||||
font-size: 24rpx;
|
||||
color: #000000;
|
||||
}
|
||||
|
||||
}
|
||||
</style>
|
||||
189
my/yhq/add.vue
Normal file
189
my/yhq/add.vue
Normal file
@@ -0,0 +1,189 @@
|
||||
<template>
|
||||
<view>
|
||||
<view class="from flex justify-center">
|
||||
<view class="from-box flex justify-center">
|
||||
<view class="from-box-c">
|
||||
<u-form :model="form" label-position="top" ref="uForm">
|
||||
<u-form-item label="优惠券名称">
|
||||
<u-input v-model="form.couponName" placeholder="请输入优惠券名称" />
|
||||
</u-form-item>
|
||||
<u-form-item label="有效期天数">
|
||||
<u-input v-model="form.endDate" type="number" placeholder="请选择有效期天数" />
|
||||
</u-form-item>
|
||||
<u-form-item label="可使用订单最低金额">
|
||||
<u-input v-model="form.minMoney" type="number" placeholder="请输入可使用订单最低金额" />
|
||||
</u-form-item>
|
||||
<!-- <u-form-item label="所需积分数">
|
||||
<u-input v-model="form.needIntegral" type="number" placeholder="请输入所需积分数" />
|
||||
</u-form-item> -->
|
||||
<u-form-item label="优惠券金额">
|
||||
<u-input v-model="form.money" type="number" placeholder="请输入优惠券金额" />
|
||||
</u-form-item>
|
||||
<u-form-item label="优惠券图片">
|
||||
<u-upload ref="uUpload" :multiple="false" max-count="1" :action="action" @on-remove="onRemove" @on-change="onChange"></u-upload>
|
||||
</u-form-item>
|
||||
|
||||
</u-form>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
<!-- 保存 -->
|
||||
<view class="button flex justify-center align-center">
|
||||
<view class="button-box flex justify-center align-center" @click="sumbit()">
|
||||
保存
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import config from '../../common/config.js'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
action: 'https://tcwm.xianmaxiong.com/sqx_fast/alioss/upload',
|
||||
// action: config.APIHOST+'/alioss/upload',
|
||||
fileList: [],
|
||||
form: {
|
||||
couponName: '',
|
||||
endDate: '',
|
||||
minMoney: '',
|
||||
// needIntegral: '',
|
||||
money: '',
|
||||
shopId: uni.getStorageSync('shopId'),
|
||||
couponPicture: '',
|
||||
},
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
onRemove(e){
|
||||
this.form.couponPicture = ''
|
||||
},
|
||||
onChange(e){
|
||||
|
||||
if(e.data){
|
||||
let obj = JSON.parse(e.data)
|
||||
if(obj.code!=0){
|
||||
uni.showToast({
|
||||
title:'上传失败,请重新上传!',
|
||||
icon:'none'
|
||||
})
|
||||
|
||||
this.$refs.uUpload.clear()
|
||||
}else{
|
||||
this.form.couponPicture = obj.data
|
||||
}
|
||||
|
||||
}else{
|
||||
uni.showToast({
|
||||
title:'上传失败,请重新上传!',
|
||||
icon:'none'
|
||||
})
|
||||
this.$refs.uUpload.clear()
|
||||
}
|
||||
},
|
||||
//提交
|
||||
sumbit(){
|
||||
if(!this.form.couponName){
|
||||
uni.showToast({
|
||||
title:'请输入优惠券名称',
|
||||
icon:'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
if(!this.form.endDate){
|
||||
uni.showToast({
|
||||
title:'请输入有效期天数',
|
||||
icon:'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
if(!this.form.minMoney){
|
||||
uni.showToast({
|
||||
title:'请输入可使用订单最低金额',
|
||||
icon:'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
// if(!this.form.needIntegral){
|
||||
// uni.showToast({
|
||||
// title:'请输入所需积分数',
|
||||
// icon:'none'
|
||||
// })
|
||||
// return
|
||||
// }
|
||||
if(!this.form.money){
|
||||
uni.showToast({
|
||||
title:'请输入优惠券金额',
|
||||
icon:'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
if(!this.form.couponPicture){
|
||||
uni.showToast({
|
||||
title:'请上传优惠券图片',
|
||||
icon:'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
uni.showLoading({
|
||||
title:'提交中...'
|
||||
})
|
||||
this.$Request.postJson("/admin/coupon/issueCoupon", this.form).then(res => {
|
||||
if (res.code == 0) {
|
||||
uni.showToast({
|
||||
title:'发布成功'
|
||||
})
|
||||
setTimeout(()=>{
|
||||
uni.navigateBack()
|
||||
},1000)
|
||||
}else{
|
||||
uni.showToast({
|
||||
title:res.msg,
|
||||
icon:'none'
|
||||
})
|
||||
}
|
||||
uni.hideLoading()
|
||||
});
|
||||
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.from {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
margin-top: 30rpx;
|
||||
|
||||
.from-box {
|
||||
width: 686rpx;
|
||||
height: 100%;
|
||||
border-radius: 16rpx;
|
||||
background-color: #ffffff;
|
||||
|
||||
.from-box-c {
|
||||
width: 646rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.button {
|
||||
width: 100%;
|
||||
height: 120rpx;
|
||||
background-color: rgb(241, 241, 241);
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
z-index: 999;
|
||||
|
||||
.button-box {
|
||||
width: 686rpx;
|
||||
height: 80rpx;
|
||||
border-radius: 40rpx;
|
||||
background-color: #FCD202;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
207
my/yhq/edit.vue
Normal file
207
my/yhq/edit.vue
Normal file
@@ -0,0 +1,207 @@
|
||||
<template>
|
||||
<view>
|
||||
<view class="from flex justify-center">
|
||||
<view class="from-box flex justify-center">
|
||||
<view class="from-box-c">
|
||||
<u-form :model="form" label-position="top" ref="uForm">
|
||||
<u-form-item label="优惠券名称">
|
||||
<u-input v-model="form.couponName" placeholder="请输入优惠券名称" />
|
||||
</u-form-item>
|
||||
<u-form-item label="有效期天数">
|
||||
<u-input v-model="form.endDate" type="number" placeholder="请选择有效期天数" />
|
||||
</u-form-item>
|
||||
<u-form-item label="可使用订单最低金额">
|
||||
<u-input v-model="form.minMoney" type="number" placeholder="请输入可使用订单最低金额" />
|
||||
</u-form-item>
|
||||
<!-- <u-form-item label="所需积分数">
|
||||
<u-input v-model="form.needIntegral" type="number" placeholder="请输入所需积分数" />
|
||||
</u-form-item> -->
|
||||
<u-form-item label="优惠券金额">
|
||||
<u-input v-model="form.money" type="number" placeholder="请输入优惠券金额" />
|
||||
</u-form-item>
|
||||
<u-form-item label="优惠券图片">
|
||||
<u-upload ref="uUpload" :file-list="fileList" :multiple="false" max-count="1" :action="action" @on-remove="onRemove" @on-change="onChange"></u-upload>
|
||||
</u-form-item>
|
||||
|
||||
</u-form>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
<!-- 保存 -->
|
||||
<view class="button flex justify-center align-center">
|
||||
<view class="button-box flex justify-center align-center" @click="sumbit()">
|
||||
保存
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import config from '../../common/config.js'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
action: 'https://tcwm.xianmaxiong.com/sqx_fast/alioss/upload',
|
||||
// action: config.APIHOST+'/alioss/upload',
|
||||
fileList: [],
|
||||
form: {
|
||||
couponId:'',
|
||||
couponName: '',
|
||||
endDate: '',
|
||||
minMoney: '',
|
||||
// needIntegral: '',
|
||||
money: '',
|
||||
shopId: uni.getStorageSync('shopId'),
|
||||
couponPicture: '',
|
||||
},
|
||||
};
|
||||
},
|
||||
onLoad(option) {
|
||||
let info = JSON.parse(option.info)
|
||||
this.fileList = [
|
||||
{url:info.couponPicture}
|
||||
]
|
||||
this.form = {
|
||||
couponId:info.couponId,
|
||||
couponName: info.couponName,
|
||||
endDate: info.endDate,
|
||||
minMoney: info.minMoney,
|
||||
// needIntegral: info.needIntegral,
|
||||
money: info.money,
|
||||
shopId: uni.getStorageSync('shopId'),
|
||||
couponPicture: info.couponPicture,
|
||||
},
|
||||
console.log(this.form)
|
||||
},
|
||||
methods: {
|
||||
onRemove(e){
|
||||
this.form.couponPicture = ''
|
||||
},
|
||||
onChange(e){
|
||||
|
||||
if(e.data){
|
||||
let obj = JSON.parse(e.data)
|
||||
if(obj.code!=0){
|
||||
uni.showToast({
|
||||
title:'上传失败,请重新上传!',
|
||||
icon:'none'
|
||||
})
|
||||
|
||||
this.$refs.uUpload.clear()
|
||||
}else{
|
||||
this.form.couponPicture = obj.data
|
||||
}
|
||||
|
||||
}else{
|
||||
uni.showToast({
|
||||
title:'上传失败,请重新上传!',
|
||||
icon:'none'
|
||||
})
|
||||
this.$refs.uUpload.clear()
|
||||
}
|
||||
},
|
||||
//提交
|
||||
sumbit(){
|
||||
if(!this.form.couponName){
|
||||
uni.showToast({
|
||||
title:'请输入优惠券名称',
|
||||
icon:'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
if(!this.form.endDate){
|
||||
uni.showToast({
|
||||
title:'请输入有效期天数',
|
||||
icon:'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
if(!this.form.minMoney){
|
||||
uni.showToast({
|
||||
title:'请输入可使用订单最低金额',
|
||||
icon:'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
// if(!this.form.needIntegral){
|
||||
// uni.showToast({
|
||||
// title:'请输入所需积分数',
|
||||
// icon:'none'
|
||||
// })
|
||||
// return
|
||||
// }
|
||||
if(!this.form.money){
|
||||
uni.showToast({
|
||||
title:'请输入优惠券金额',
|
||||
icon:'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
if(!this.form.couponPicture){
|
||||
uni.showToast({
|
||||
title:'请上传优惠券图片',
|
||||
icon:'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
uni.showLoading({
|
||||
title:'提交中...'
|
||||
})
|
||||
this.$Request.postJson("/admin/coupon/updateCoupon", this.form).then(res => {
|
||||
if (res.code == 0) {
|
||||
uni.showToast({
|
||||
title:'修改成功'
|
||||
})
|
||||
setTimeout(()=>{
|
||||
uni.navigateBack()
|
||||
},1000)
|
||||
}else{
|
||||
uni.showToast({
|
||||
title:res.msg,
|
||||
icon:'none'
|
||||
})
|
||||
}
|
||||
uni.hideLoading()
|
||||
});
|
||||
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.from {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
margin-top: 30rpx;
|
||||
|
||||
.from-box {
|
||||
width: 686rpx;
|
||||
height: 100%;
|
||||
border-radius: 16rpx;
|
||||
background-color: #ffffff;
|
||||
|
||||
.from-box-c {
|
||||
width: 646rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.button {
|
||||
width: 100%;
|
||||
height: 120rpx;
|
||||
background-color: rgb(241, 241, 241);
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
z-index: 999;
|
||||
|
||||
.button-box {
|
||||
width: 686rpx;
|
||||
height: 80rpx;
|
||||
border-radius: 40rpx;
|
||||
background-color: #FCD202;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
186
my/yhq/yhq.vue
Normal file
186
my/yhq/yhq.vue
Normal file
@@ -0,0 +1,186 @@
|
||||
<template>
|
||||
<view>
|
||||
<view class="list flex justify-center flex-wrap">
|
||||
<view class="list-box flex justify-center flex-wrap" v-for="(item,index) in couponList" :key="index">
|
||||
<view class="yhq-box-list-item" >
|
||||
<view class="yhq-box-list-item-t flex align-center justify-between" style="border-bottom: 1px dashed #e5e5e5;padding-bottom: 26rpx;">
|
||||
<view class="yhq-box-list-item-t-l flex align-center">
|
||||
<image :src="item.couponPicture?item.couponPicture:'../../static/logo.png'" style="width: 120rpx;height: 120rpx;border-radius: 16rpx;" mode=""></image>
|
||||
<view class="" style="margin-left: 20rpx;">
|
||||
<view class="" style="font-weight: bold;">
|
||||
<text>{{item.couponName}}</text>(满{{item.minMoney}}元使用)
|
||||
</view>
|
||||
<view class="" style="color: gray;font-size: 24rpx;margin-top: 10rpx;">
|
||||
购买后{{item.endDate}}天内使用
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="yhq-box-list-item-t-r" style="font-size: 32rpx;color: red;">
|
||||
<text style="font-size: 24rpx;font-weight: bold;">¥</text>
|
||||
{{item.money}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="yhq-box-list-item-b flex justify-end align-center" style="margin-top: 26rpx;">
|
||||
<view class="" @click="updata(1,item)" style="padding: 5rpx 20rpx 5rpx 20rpx;border-radius: 24rpx;border: 1rpx solid gray;color: gray;">
|
||||
编辑
|
||||
</view>
|
||||
<view class="" @click="updata(2,item)" style="padding: 5rpx 20rpx 5rpx 20rpx;border-radius: 24rpx;border: 1rpx solid red;color: red;margin-left: 20rpx;">
|
||||
删除
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<u-loadmore :status="status" :icon-type="iconType" :load-text="loadText" />
|
||||
</view>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- 添加优惠券 -->
|
||||
<view class="button flex justify-center align-center">
|
||||
<view class="button-box flex justify-center align-center" @click="gotoAdd()">
|
||||
添加优惠券
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
couponList: [],
|
||||
couponLists: [],
|
||||
limit: 10,
|
||||
page: 1,
|
||||
status: 'loadmore',
|
||||
iconType: 'flower',
|
||||
loadText: {
|
||||
loadmore: '轻轻上拉',
|
||||
loading: '努力加载中',
|
||||
nomore: '实在没有了'
|
||||
},
|
||||
};
|
||||
},
|
||||
onPullDownRefresh() {
|
||||
this.page = 1
|
||||
this.getList()
|
||||
},
|
||||
onReachBottom() {
|
||||
if(this.couponLists.length==10){
|
||||
this.page += 1
|
||||
this.status = 'loading'
|
||||
this.getList()
|
||||
}else{
|
||||
this.status = 'nomore'
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
this.page = 1
|
||||
this.getList()
|
||||
},
|
||||
onLoad() {
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
//1:编辑 2:删除
|
||||
updata(type,item){
|
||||
if(type==1){
|
||||
uni.navigateTo({
|
||||
url:'./edit?info='+JSON.stringify(item)
|
||||
})
|
||||
}else{
|
||||
let that = this
|
||||
uni.showModal({
|
||||
title:'提示',
|
||||
content:'是否删除该优惠券?',
|
||||
complete(ret) {
|
||||
if(ret.confirm){
|
||||
let data = {
|
||||
couponId:item.couponId
|
||||
}
|
||||
that.$Request.postT("/admin/coupon/deleteCoupon", data).then(res => {
|
||||
if (res.code == 0) {
|
||||
uni.showToast({
|
||||
title:'已删除'
|
||||
})
|
||||
that.page = 1
|
||||
that.getList()
|
||||
}else{
|
||||
uni.showToast({
|
||||
title:res.msg,
|
||||
icon:'none'
|
||||
})
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
},
|
||||
//添加优惠券
|
||||
gotoAdd(){
|
||||
uni.navigateTo({
|
||||
url:'./add'
|
||||
})
|
||||
},
|
||||
//优惠券列表
|
||||
getList() {
|
||||
let data = {
|
||||
shopId: uni.getStorageSync('shopId')
|
||||
}
|
||||
this.$Request.get("/admin/coupon/seleteAllCoupon", data).then(res => {
|
||||
if (res.code == 0) {
|
||||
this.couponLists = res.data
|
||||
if (this.page == 1) {
|
||||
this.couponList = res.data
|
||||
} else {
|
||||
this.couponList = [...this.couponList, ...res.data]
|
||||
}
|
||||
}
|
||||
uni.stopPullDownRefresh()
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.list {
|
||||
width: 100%;
|
||||
// height: 500rpx;
|
||||
margin-top: 20rpx;
|
||||
padding-bottom: 200rpx;
|
||||
.list-box {
|
||||
width: 686rpx;
|
||||
height: 100%;
|
||||
border-radius: 16rpx;
|
||||
background-color: #ffffff;
|
||||
margin-bottom: 20rpx;
|
||||
|
||||
.yhq-box-list-item {
|
||||
width: 646rpx;
|
||||
// background-color: red;
|
||||
padding: 20rpx 0 20rpx 0;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.button {
|
||||
width: 100%;
|
||||
height: 140rpx;
|
||||
background-color: rgb(241, 241, 241);
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
z-index: 999;
|
||||
.button-box {
|
||||
width: 686rpx;
|
||||
height: 80rpx;
|
||||
background-color: #FCD202;
|
||||
border-radius: 40rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user