This commit is contained in:
liyanhong 2024-11-26 15:28:15 +08:00
parent 6faeed11f1
commit 8064cae907
20 changed files with 714 additions and 463 deletions

16
main.js
View File

@ -9,17 +9,21 @@ uni.$u.config.unit = 'rpx'
Vue.config.productionTip = false
App.mpType = 'app'
const app = new Vue({
...App
...App
})
Vue.prototype.$shopId = uni.getStorageSync('shopId')
// Vue.prototype.$shopAdminId = uni.getStorageSync('shopManage').shop_admin_id
app.$mount()
// #endif
// #ifdef VUE3
import { createSSRApp } from 'vue'
import {
createSSRApp
} from 'vue'
export function createApp() {
const app = createSSRApp(App)
return {
app
}
const app = createSSRApp(App)
return {
app
}
}
// #endif

View File

@ -154,6 +154,26 @@
"bounce": "none" //
}
}
},
//
{
"path": "pages/store/withdraw/alipay",
"style": {
"navigationBarTitleText": "绑定支付宝",
"app-plus": {
"bounce": "none" //
}
}
},
//
{
"path": "pages/fiance/bonus/bonus",
"style": {
"navigationBarTitleText": "奖励金提现",
"app-plus": {
"bounce": "none" //
}
}
}
],

View File

@ -0,0 +1 @@
.header{background-image:url(https://yuledui.oss-cn-qingdao.aliyuncs.com/merch_manage/img/bg_bonus.png);background-size:cover;color:#fff}.header .top{padding-top:50rpx;padding-left:30rpx;display:flex;flex-direction:column;justify-content:flex-end;padding-bottom:40rpx}.header .top .desc{font-size:30rpx;font-weight:bold;font-size:36rpx}.header .top .balance{font-size:60rpx;font-weight:600}.header .bottom{height:140rpx;display:flex;flex-direction:row;justify-content:left;border-top:solid 1rpx #f0ecec}.header .bottom .left,.header .bottom .right{width:50%;padding-left:30rpx;padding-top:30rpx}.header .bottom .left .balance,.header .bottom .right .balance{padding-top:10rpx}.header .bottom .left{border-right:solid 1rpx #f0ecec}.content{margin-top:130rpx;background-color:#fff;padding:0rpx 30rpx 0rpx 30rpx}.bottom-tips{margin:15rpx;opacity:.8}.button{width:90%;font-size:40rpx;background-color:#ed6d00;color:#fff;letter-spacing:10rpx}

View File

@ -0,0 +1,59 @@
.header{
background-image: url(https://yuledui.oss-cn-qingdao.aliyuncs.com/merch_manage/img/bg_bonus.png);
background-size: cover;
color: #FFFFFF;
.top{
padding-top: 50rpx;
padding-left: 30rpx;
display: flex;
flex-direction: column;
justify-content: flex-end;
padding-bottom: 40rpx;
.desc{
font-size: 30rpx;
font-weight: bold;font-size: 36rpx;
}
.balance{
font-size: 60rpx;
font-weight: 600;
}
}
.bottom{
height: 140rpx;
display: flex;
flex-direction: row;
justify-content: left;
border-top:solid 1rpx #F0ECEC;
.left, .right{
width: 50%;
padding-left: 30rpx;
padding-top: 30rpx;
.balance{
padding-top:10rpx;
}
}
.left{
border-right: solid 1rpx #F0ECEC;
}
}
}
.content{
margin-top: 130rpx;
background-color: #FFFFFF;
padding: 0rpx 30rpx 0rpx 30rpx;
}
.bottom-tips{
margin: 15rpx;
opacity: 0.8;
}
.button{
width: 90%;
font-size: 40rpx;
background-color: #ED6D00;
color: #FFFFFF;
letter-spacing: 10rpx;
}

View File

@ -0,0 +1,173 @@
<template>
<view class="body">
<view class="">
<view class="header">
<view class="top">
<view class="desc">
可提现奖励金()
</view>
<view class="balance">
{{form.realprice}}
</view>
</view>
<view class="bottom">
<view class="left">
<view class="desc">
已提现奖励金()
</view>
<view class="balance">
{{form.already_pay_money}}
</view>
</view>
<view class="right">
<view class="desc">
累计会员数()
</view>
<view class="balance">
{{form.member_num}}
</view>
</view>
</view>
<view class="bottom">
<view class="left">
<view class="desc">
分润金豆数()
</view>
<view class="balance">
{{form.creditnum}}
</view>
</view>
<view class="right">
<view class="desc">
分润订单数()
</view>
<view class="balance">
{{form.order_num}}
</view>
</view>
</view>
</view>
<view class="content" style="margin-top:30rpx;">
<u-form :model="form">
<u-form-item label-width="200" :label-position="labelPosition" label="收款人姓名:" prop="bankName">
<u-input @click="go2Page('/pages/store/withdraw/alipay')" :border="border" placeholder="请输入收款人姓名" v-model="form.merch_payinfo.legalname" disabled></u-input>
</u-form-item>
<u-form-item label-width="200" :label-position="labelPosition" label="支付宝账号:" prop="bankName">
<u-input @click="go2Page('/pages/store/withdraw/alipay')" :border="border" placeholder="请输入收款人支付宝账号" v-model="form.merch_payinfo.alipayinfo" disabled></u-input>
</u-form-item>
</u-form>
</view>
<view style="margin-top: 60rpx;">
<u-button :disabled="false" class="button" @click="submit">提现</u-button>
</view>
<view class="bottom-tips">
备注:奖励金为本店会员在其他店铺消费所得奖励
</view>
</view>
</view>
</template>
<script>
let that = {}
export default {
data() {
return {
form: {
payType: '提现到银行',
payTypeValue: 2,
merch_payinfo: {}, //
realprice:0, //
already_pay_money:0, //
member_num:0, //
creditnum:0, //
order_num:0, //
},
border: 'none',
labelPosition: 'left',
}
},
onLoad() {
uni.showLoading({
title: '加载中'
});
},
onLoad: function () {
that = this
// this.init();
},
onPullDownRefresh() {
that.init()
setTimeout(function() {
uni.showToast({
title: '刷新成功',
icon: 'none'
})
uni.stopPullDownRefresh({
success: (result) => {},
fail: (error) => {}
})
}, 688)
},
methods: {
init() {
//
this.$api.get({
url: '/bonus/get',
data: {
merchid: uni.getStorageSync('merch_info').merch_id
},
success: res => {
console.log(res);
that.form=res;
}
});
},
submit() {
if(that.form.realprice<=0.1){ //
this.$yld.msg('您当前可提现余额小于0.1元,满0.1元以上可提现')
}
if(that.form.merch_payinfo.legalname==''){ //
this.$yld.msg('请填写姓名')
}
if(that.form.merch_payinfo.alipayinfo==''){ //
this.$yld.msg('请先完善支付宝收款账号信息')
}
/* getApp().globalData.util.request({
s: 'Merch.Bonus_Index.submit'
}).then(res => {
uni.hideLoading()
uni.showModal({
title: '提示',
content: res.data.data.res_msg,
showCancel: false,
success: function (res) {
that.init()
}
})
}) */
},
go2Page(page){
uni.navigateTo({
url:page
})
},
// /methods
},
}
</script>
<style lang="scss" scoped>
@import './bonus.scss';</style>

View File

@ -65,8 +65,7 @@
<view class="text">扫码送金豆</view>
</u-col>
<u-col class="row-second-cus" :span="span" :offset="offset"
@click="credigGive">
<u-col class="row-second-cus" :span="span" :offset="offset" @click="credigGive">
<view>
<u-image
src="http://yuledui.oss-cn-qingdao.aliyuncs.com/merch_manage/img/home/home_manage.png"
@ -82,6 +81,13 @@
</view>
<view class="text">店铺设置</view>
</u-col>
<u-col class="row-second-cus" :span="span" :offset="offset" @click="autoMoney">
<view>
<u-image src="http://yuledui.oss-cn-qingdao.aliyuncs.com/merch_manage/img/home/bank.png"
class="image" height="75rpx" width="75rpx"></u-image>
</view>
<view class="text">结算银行卡</view>
</u-col>
<!-- <u-col class="row-second-cus" :span="span" :offset="offset" @click="autoMoney">
<view>
<u-image src="http://yuledui.oss-cn-qingdao.aliyuncs.com/merch_manage/img/home/bank.png"
@ -114,21 +120,28 @@
</view>
<view class="text">更多功能</view>
</u-col> -->
<u-col class="row-second-cus" :span="span" :offset="offset" @click="safecenter">
<!-- <u-col class="row-second-cus" :span="span" :offset="offset" @click="bindAlipay">
<view>
<u-image
src="http://yuledui.oss-cn-qingdao.aliyuncs.com/merch_manage/img/home/more_function.png"
src="http://yuledui.oss-cn-qingdao.aliyuncs.com/merch_manage/img/home/icon_alipay.png"
class="image" height="75rpx" width="75rpx"></u-image>
</view>
<view class="text">安全中心</view>
<view class="text">绑定支付宝</view>
</u-col> -->
<u-col class="row-second-cus" :span="span" :offset="offset" @click="navigateToBonus">
<view>
<u-image src="http://yuledui.oss-cn-qingdao.aliyuncs.com/merch_manage/img/home/home_reward.png"
class="image" height="75rpx" width="75rpx"></u-image>
</view>
<view class="text">奖励金</view>
</u-col>
<u-col class="row-second-cus" :span="span" :offset="offset" @click="autoMoney">
<!-- <u-col class="row-second-cus" :span="span" :offset="offset" @click="autoMoney">
<view>
<u-image src="http://yuledui.oss-cn-qingdao.aliyuncs.com/merch_manage/img/home/bank.png"
class="image" height="75rpx" width="75rpx"></u-image>
</view>
<view class="text">结算银行卡</view>
</u-col>
</u-col> -->
</u-row>
</view>
@ -147,6 +160,10 @@
</template>
<script>
import {
managerdetail,
shopdetail
} from '@/utils/api.js'
var that = {},
userInfo, autoGo2CashTask
export default {
@ -160,14 +177,9 @@
type: 'primary',
color: '#909399',
fontSize: '26',
// swiper
// swipList: [{
// image: 'http://yuledui.oss-cn-qingdao.aliyuncs.com/merch_manage/img/home_swiper.png',
// title: '',
// url: 'https://v1.angyakeji.com/appindex.php?i=2&c=entry&m=ewei_shopv2&do=mobile&r=article.list'
// }],
swipList: [
'http://yuledui.oss-cn-qingdao.aliyuncs.com/merch_manage/img/home_swiper.png',
// title: '',
// url: 'https://v1.angyakeji.com/appindex.php?i=2&c=entry&m=ewei_shopv2&do=mobile&r=article.list'
],
@ -180,27 +192,13 @@
effect3d: false
}
},
onLoad: function() {
that = this
// this.autoGo2Cash()
},
onUnload() {
clearTimeout(autoGo2CashTask)
},
onShow: function() {
this.yldstoreDataLocal = uni.getStorageSync("yldstoreDataLocal")
// userInfo = uni.getStorageSync(getApp().globalData.config.userDataKey)
// if (typeof (userInfo) == 'undefined' || !userInfo || !userInfo.mobile || !userInfo.sign) {
// uni.reLaunch({
// url: '/pages/login/index'
// })
// return
// } else {
setTimeout(function() {
//
// that.init()
}, 299)
// }
console.log(this.$shopId);
this.getShop()
this.getShopdetail()
},
onPullDownRefresh() {
setTimeout(function() {
@ -216,6 +214,26 @@
},
methods: {
getShop() {
managerdetail({
shop_id: this.$shopId
}).then(res => {
if (res.code == 200) {
uni.setStorageSync('shopManage', res.data)
}
})
},
getShopdetail() {
shopdetail({
shop_id: this.$shopId
}).then(r => {
if (r.code == 200) {
console.log(r);
uni.setStorageSync('shopInfo', r.data)
}
})
},
init() {
//
this.showNotice()
@ -269,15 +287,15 @@
})
},
//
safecenter(){
safecenter() {
uni.navigateTo({
url:'/pages/store/secret/secret'
url: '/pages/store/secret/secret'
})
},
//
credigGive(){
credigGive() {
uni.navigateTo({
url:'/pages/store/withdraw/credit'
url: '/pages/store/withdraw/credit'
})
},
navigateToProductManage(type) {
@ -311,6 +329,7 @@
navigateToQrList_sy_scan() {
this.navigateTo('/pages/store/cashier_sy/cashier_sy_b/cashier_sy_f')
},
//
navigateToBonus() {
this.navigateTo('/pages/fiance/bonus/bonus')
},
@ -324,6 +343,7 @@
url: '/pages/store/card'
});
},
//
bindAlipay() {
uni.navigateTo({
url: '/pages/store/withdraw/alipay'

View File

@ -12,8 +12,6 @@
<view class="main">
<wInput v-model="phoneData" type="text" maxlength="11" placeholder="手机号"></wInput>
<wInput v-if="type=='password'" v-model="password" type="password" placeholder="密码"></wInput>
<wInput v-if="type=='code'" v-model="verCode" type="number" maxlength="6" placeholder="验证码" isShowCode
ref="runCode" @setCode="getVerCode()"></wInput>
</view>
<wButton class="wbutton" text="登 录" :rotate="isRotate" @click.native="startReg()"></wButton>
@ -35,6 +33,7 @@
</template>
<script>
import {login} from '@/utils/api.js'
import wInput from '../../components/watch-login/watch-input.vue' //input
import wButton from '../../components/watch-login/watch-button.vue' //button
export default {
@ -131,14 +130,6 @@
});
return false;
}
if (this.verCode.length != 6 && this.type == 'code') {
uni.showToast({
icon: 'none',
position: 'bottom',
title: '验证码不正确'
});
return false;
}
if (!this.password && this.type == 'password') {
uni.showToast({
icon: 'none',
@ -147,16 +138,28 @@
});
return false;
}
uni.showToast({
icon: 'success',
position: 'bottom',
title: '登录成功',
duration: 1000
});
uni.switchTab({
url: "/pages/first/index",
login({
user_name:this.phoneData,
password:this.password
}).then(res=>{
if(res.code==200){
uni.showToast({
icon: 'success',
position: 'bottom',
title: '登录成功',
duration: 1000
});
uni.setStorageSync('shopId',res.data.shop_id)
uni.switchTab({
url: "/pages/first/index",
})
}else{
this.$u.toast(res.msg)
}
})
},
}
}

View File

@ -1,13 +1,13 @@
<template>
<view class="body">
<view class="head" @click="go2Page('/pages/store/setup')">
<view class="head">
<view class="avatar">
<u-avatar :mode="mode" :size="size" :src="storeData.logo" :text="text" :showLevel="showLevel"
<u-avatar :mode="mode" :size="size" :src="storeData.door_photo" :text="text" :showLevel="showLevel"
:showSex="showSex" :sexIcon="sexIcon" :bgColor='bgColor'></u-avatar>
</view>
<view class="text">
<view>{{storeData.merchname}}</view>
<view style="font-size: 25rpx; padding-top: 10rpx;">ID:{{storeData.id}}</view>
<view>{{storeData.shop_name}}</view>
<view style="font-size: 25rpx; padding-top: 10rpx;">联系人:{{storeData.contact_name}}</view>
</view>
</view>
<view class="wrapper">
@ -18,8 +18,8 @@
</u-cell-group>
<view class="hr"></view>
<u-cell-group>
<u-cell title="店铺设置" @click="go2Page('/pages/store/setup')">
</u-cell>
<!-- <u-cell title="店铺设置" @click="go2Page('/pages/store/setup')">
</u-cell> -->
<!-- <u-cell @click="go2Page('/pages/store/withdraw/creditadd')" title="扫码送金豆">
</u-cell> -->
</u-cell-group>
@ -27,10 +27,12 @@
<u-cell-group>
<u-cell title="安全中心" @click="go2Page('/pages/store/secret/secret')"></u-cell>
<u-cell title="修改/忘记密码"
@click="go2Page('/pages/store/modify_password/modify_password')"></u-cell>
@click="showToast"></u-cell>
<!-- <u-cell title="修改/忘记密码"
@click="go2Page('/pages/store/modify_password/modify_password')"></u-cell> -->
<u-cell title="修改登录手机号"
@click="go2Page('/pages/store/change_phone/change_phone')"></u-cell>
<!-- <u-cell title="修改登录手机号"
@click="go2Page('/pages/store/change_phone/change_phone')"></u-cell> -->
</u-cell-group>
<view class="hr"></view>
@ -124,15 +126,14 @@
},
onShow() {
that = this
// this.init()
this.init()
},
methods: {
init() {
getApp().globalData.util.request({
s: 'Merch.Mershop_Index.get'
}).then(res => {
that.storeData = res.data.data
})
this.storeData = uni.getStorageSync('shopInfo')
},
showToast(){
this.$u.toast('请去联系客服')
},
go2News() {
this.go2Page(

View File

@ -35,9 +35,9 @@
<u-form-item label-width="200" :label-position="labelPosition" label="收款卡号:" prop="bank_no">
<u-input :border="border" placeholder="请输入收款卡号" v-model="form.bank_no" :disabled='true'></u-input>
</u-form-item>
<u-form-item label-width="200" :label-position="labelPosition" label="确认收款卡号:" prop="bank_no">
<!-- <u-form-item label-width="200" :label-position="labelPosition" label="确认收款卡号:" prop="bank_no">
<u-input :border="border" placeholder="请再次输入收款卡号" v-model="form.bank_no2" :disabled='true'></u-input>
</u-form-item>
</u-form-item> -->
<u-form-item label-width="200" :label-position="labelPosition" label="银行:" prop="bank_com">
<u-input :border="border" placeholder="请输入银行" v-model="form.bank_com" :disabled='true'></u-input>
</u-form-item>
@ -67,10 +67,10 @@
},
bankImgUp: 'http://yuledui.oss-cn-qingdao.aliyuncs.com/merch_manage/img/bank_card_setting/take_photo.png', // OCR
openAutoPay: true,
border: false,
border: 'none',
showPayType: false,
labelPosition: 'left',
errorType: ['message'],
errorType: 'message',
rules: {
bank_name: [{
required: true,

View File

@ -109,7 +109,10 @@
},
//
makeQRCode(total = null) {
let qrcodeText = "https://yld.angyakeji.com/www/public/view/merge_qrcode/index.html?a=1&scene=merchid%3d"
// this.$shopId
// let qrcodeText = "https://yld.angyakeji.com/www/public/view/merge_qrcode/index.html?a=1&scene=merchid%3d"
let qrcodeText = "https://yld.angyakeji.com/www/public/view/merge_qrcode/index.html?a=1&scene=merchid%3d&appid=wx231bd3f08954da9e&shopId=${this.$shopId}"
// let qrcodeText=`https://mp.weixin.qq.com/wxapp/qr/code?appid=wx231bd3f08954da9e&shopId=${this.$shopId}`
let qrOption = {
text: qrcodeText,
size: this.sysWidth * this.qrcodeWidth * 0.35,

View File

@ -3,7 +3,7 @@
<view class="wrap">
<u--form :model="form" :rules="rules" ref="uForm">
<u-form-item label-width="160" :label-position="labelPosition" label="手机号" prop='userInfo.phone'>
<u--input :password-icon="true" :border="border" placeholder=""
<u--input :password-icon="true" placeholder=""
v-model="form.userInfo.phone"></u--input>
</u-form-item>
@ -20,7 +20,7 @@
</u-form-item>
<u-form-item label-width="160" :label-position="labelPosition" label="新密码" prop='userInfo.password'>
<u--input :password-icon="true" type="password" :border="border" placeholder="请输入新密码"
<u--input :password-icon="true" type="password" placeholder="请输入新密码"
v-model="form.password"></u--input>
</u-form-item>
@ -33,7 +33,7 @@
</view>
</view>
<u-form-item label-width="160" :label-position="labelPosition" label="确认密码" prop="userInfo.re_password">
<u--input :password-icon="true" type="password" :border="border" placeholder="请再次输入新密码确认"
<u--input :password-icon="true" type="password" placeholder="请再次输入新密码确认"
v-model="form.re_password"></u--input>
</u-form-item>
@ -61,7 +61,7 @@
}
},
timeTick: 0,
border: false,
border: 'none',
labelPosition: 'top',
errorType: ['message'],
rules: {
@ -103,10 +103,7 @@
}
},
onLoad() {
that = this
_this = that
// let userData = uni.getStorageSync(getApp().globalData.config.userDataKey)
// _this.form.mobile = userData.mobile
// this.form.userInfo=uni.getStorageSync('shopInfo')
},
onReady() {
this.$refs.uForm.setRules(this.rules)

View File

@ -15,9 +15,10 @@ export default {
},
go2Page(urlPath) {
uni.navigateTo({
url: urlPath,
});
this.$u.toast('请去联系客服')
// uni.navigateTo({
// url: urlPath,
// });
},
deleteAccount(){

View File

@ -3,20 +3,21 @@
<view class="wrap">
<view class="logo">
<view class="u-avatar-wrap">
<image class="u-avatar-demo" @click="chooseAvatar" :src="storeData.logo" mode="aspectFill"></image>
<image class="u-avatar-demo" @click="chooseAvatar" :src="storeData.door_photo" mode="aspectFill">
</image>
</view>
<view class="title">{{ storeData.merchname }}</view>
<view class="title">{{ storeData.shop_name }}</view>
</view>
<view class="info">
<u--form :model="storeData" ref="uForm" :errorType="errorType">
<u-form-item label="商户名称" label-width="220" prop="name"><u-input v-model="storeData.merchname" fontSize='28'
placeholder="请输入商户名称" /></u-form-item>
<u-form-item label="商户名称" label-width="220" prop="name"><u-input v-model="storeData.shop_name"
fontSize='28' placeholder="请输入商户名称" /></u-form-item>
<!-- <u-form-item label="商户简介" label-width="220" prop="desc"><u-input v-model="storeData.desc" fontSize='28'
placeholder="请输入商户简介" /></u-form-item> -->
<u-form-item label="联系电话" label-width="220" prop="phone"><u-input v-model="storeData.tel" fontSize='28'
placeholder="请输入联系电话" /></u-form-item>
<u-form-item label="店铺位置" label-width="220" prop="phone"><u-input v-model="storeData.address" fontSize='28'
placeholder="请输入店铺位置" /></u-form-item>
<u-form-item label="联系电话" label-width="220" prop="phone"><u-input v-model="storeData.tel"
fontSize='28' placeholder="请输入联系电话" /></u-form-item>
<u-form-item label="店铺位置" label-width="220" prop="phone"><u-input v-model="storeData.address"
fontSize='28' placeholder="请输入店铺位置" /></u-form-item>
<!-- <u-form-item label="店铺主题颜色" label-width="220">
<u-input v-model="storeData.themeText" placeholder="选择店铺主题颜色" :clearable="false"
@click="showShopTheme = true" />
@ -37,15 +38,17 @@
@on-success="uploadThumb" @on-remove="removeImg" @on-progress="showLoading"></u-upload>
</view> -->
<view class="bottom"><u-button :disabled="false" class="button" @click="submit">保存设置</u-button>
</view>
<view class="bottom"><u-button :disabled="false" class="button" @click="submit">保存设置</u-button>
</view>
</view>
</view>
</view>
</template>
<script>
// import util from "../../src/utils/util";
import {
update_shop
} from '@/utils/api.js';
let that = {},
storeThumbs = {}
export default {
@ -60,44 +63,21 @@
}
},
onLoad() {
that = this
// this.init()
this.storeData = uni.getStorageSync('shopInfo')
},
methods: {
init() {
getApp().globalData.util.request({
s: 'Merch.Mershop_Index.get'
}).then(res => {
let storeData = res.data.data
//
for (let i = 0; i < storeData.themearr.length; i++) {
if (storeData.themearr[i].value == storeData.theme) {
storeData.themeText = storeData.themearr[i].label;
}
}
storeData.is_direct2_shop_page = (storeData.is_direct2_shop_page == 1)
//
if (parseInt(storeData.credit_give) < storeData.credit_give) {
storeData.credit_give = parseFloat(storeData.credit_give).toFixed(4);
} else {
storeData.credit_give = parseFloat(storeData.credit_give).toFixed(0);
}
storeThumbs = JSON.parse(JSON.stringify(storeData.thumbs))
that.storeData = storeData
})
},
selectColor(items) {
this.storeData.theme = items[0].value;
this.storeData.themeText = items[0].label;
},
submit() {
let updata = that.storeData
updata['s'] = 'Merch.Mershop_Index.update'
if (updata.thumbs != storeThumbs) { //
that.updateThumbs()
}
getApp().globalData.util.request(updata).then(res => {
if (res.data.ret == 200) {
// let updata = that.storeData
// updata['s'] = 'Merch.Mershop_Index.update'
// if (updata.thumbs != storeThumbs) { //
// that.updateThumbs()
// }
update_shop(this.storeData).then(res => {
if (res.code == 200) {
uni.showToast({
title: '保存成功',
duration: 2000,
@ -147,13 +127,15 @@
}
</script>
<style lang="scss" scoped>
page{
page {
background-color: #f7f7f7;
}
/deep/.u-form-item__body__left__content__label {
color: #7f8185 !important;
font-size:28rpx !important;
color: #7f8185 !important;
font-size: 28rpx !important;
}
.logo {
padding-top: 40rpx;
padding-bottom: 40rpx;
@ -184,7 +166,8 @@
padding-right: 30rpx;
background-color: #ffffff;
}
/deep/.u-form-item{
/deep/.u-form-item {
border-bottom: 1px solid #f4f6f8;
}

View File

@ -1,109 +0,0 @@
let that = {}
export default {
data() {
return {
showInfo: false,
form: {
payType: '提现到银行',
payTypeValue: 2,
},
bankImgUp: 'http://yuledui.oss-cn-qingdao.aliyuncs.com/merch_manage/img/bank_card_setting/take_photo.png',// 银行卡照片OCR
openAutoPay: true,
border: false,
showPayType: false,
labelPosition: 'left',
errorType: ['message'],
rules: {
bank_name: [
{
required: true,
message: '请输入姓名',
trigger: 'blur',
},
{
min: 3,
max: 5,
message: '姓名长度在3到5个字符',
trigger: ['change', 'blur'],
},
{
// 此为同步验证可以直接返回true或者false如果是异步验证稍微不同见下方说明
validator: (rule, value, callback) => {
return this.$u.test.chinese(value);
},
message: '姓名必须为中文',
trigger: ['change', 'blur'],
},
]
}
};
},
onLoad: function () {
that = this
that.init();
},
methods: {
init() {
getApp().globalData.util.request({
s: 'Merch.Mershop_Alipay.get'
}).then(res => {
that.form = res.data.data
that.form.alipay_account2 = res.data.data.alipay_account
})
},
submit() {
if (that.form.alipay_account2 !== that.form.alipay_account) {
uni.showModal({
title: '提示',
content: '两次输入的手机号不一致'
});
return
}
getApp().globalData.util.request({
s: 'Merch.Mershop_Alipay.update',
alipay_account: that.form.alipay_account,
alipay_realname: that.form.alipay_realname
}).then(res => {
uni.showModal({
title: '提示',
content: res.data.data.res_msg,
showCancel:false,
success: function (res) {
if (res.confirm) {
console.log('用户点击确定');
}
}
})
})
},
selectColor(items) {
if (items[0].value == 'no') {
that.openAutoPay = false
} else {
that.openAutoPay = true
}
},
// 银行卡识别OCR
getBankOCR: function (fileUrl) {
uni.showLoading({
title: '识别中'
})
uni.request({
url: 'https://yld.angyakeji.com/www/src/tools/aliyun/ocr.php',
data: {
fileUrl: fileUrl,
type: 'bankcard'
},
complete: (res) => {
uni.hideLoading()
if (res.data && res.data.Data) {
let fres = res.data.Data
that.$set(that.form, 'bank_com', fres.BankName)
that.$set(that.form, 'bank_no', fres.CardNumber)
that.$set(that.form, 'bank_no2', fres.CardNumber)
}
},
})
},
}
}

View File

@ -10,7 +10,7 @@
<view class="line"></view>
<view class="content">
<u-form :model="form" :rules="rules" ref="uForm" :errorType="errorType">
<u-form :model="form" :rules="rules" ref="uForm">
<u-form-item label-width="300" :label-position="labelPosition" label="支付宝姓名:" prop="bank_name">
<u-input :border="border" placeholder="请输入支付宝账号姓名" v-model="form.alipay_realname"></u-input>
</u-form-item>
@ -27,7 +27,94 @@
</view>
</template>
<script src="./alipay.js"></script>
<script>
let that = {}
export default {
data() {
return {
showInfo: false,
form: {
payType: '提现到银行',
payTypeValue: 2,
},
bankImgUp: 'http://yuledui.oss-cn-qingdao.aliyuncs.com/merch_manage/img/bank_card_setting/take_photo.png',// OCR
openAutoPay: true,
border: 'none',
showPayType: false,
labelPosition: 'left',
rules: {
bank_name: [
{
required: true,
message: '请输入姓名',
trigger: 'blur',
},
{
min: 3,
max: 5,
message: '姓名长度在3到5个字符',
trigger: ['change', 'blur'],
},
{
// truefalse
validator: (rule, value, callback) => {
return this.$u.test.chinese(value);
},
message: '姓名必须为中文',
trigger: ['change', 'blur'],
},
]
}
};
},
onLoad: function () {
that = this
// that.init();
},
methods: {
init() {
getApp().globalData.util.request({
s: 'Merch.Mershop_Alipay.get'
}).then(res => {
that.form = res.data.data
that.form.alipay_account2 = res.data.data.alipay_account
})
},
submit() {
if (that.form.alipay_account2 !== that.form.alipay_account) {
uni.showModal({
title: '提示',
content: '两次输入的手机号不一致'
});
return
}
getApp().globalData.util.request({
s: 'Merch.Mershop_Alipay.update',
alipay_account: that.form.alipay_account,
alipay_realname: that.form.alipay_realname
}).then(res => {
uni.showModal({
title: '提示',
content: res.data.data.res_msg,
showCancel:false,
success: function (res) {
if (res.confirm) {
console.log('用户点击确定');
}
}
})
})
},
selectColor(items) {
if (items[0].value == 'no') {
that.openAutoPay = false
} else {
that.openAutoPay = true
}
},
}
}
</script>
<style lang="scss" scoped>
@import './alipay.scss';

View File

@ -1,87 +1,76 @@
<template>
<view class="body">
<view class="header">
<view class="container">
<view class="icon">
<u-image v-if="false" height="60" width="60"
src="https://yuledui.oss-cn-qingdao.aliyuncs.com/merch_manage/img/credit_card_icon.png"></u-image>
</view>
<view class="title " @click='showInfo = !showInfo'>
扫码付款 <text style="font-weight:bold;">[金豆抵扣]</text>设置<u-icon name="info-circle
<view class="body">
<view class="header">
<view class="container">
<view class="icon">
<u-image v-if="false" height="60" width="60"
src="https://yuledui.oss-cn-qingdao.aliyuncs.com/merch_manage/img/credit_card_icon.png"></u-image>
</view>
<view class="title " @click='showInfo = !showInfo'>
扫码付款 <text style="font-weight:bold;">[金豆抵扣]</text>设置<u-icon name="info-circle
" size="28"></u-icon>
</view>
</view>
</view>
<!-- <view class="payinfo" v-if="showInfo">
</view>
</view>
</view>
<!-- <view class="payinfo" v-if="showInfo">
<view>开启金豆抵扣后,
<text style="font-weight:bold;">将同时开启随机立减功能;</text></view>
<view style="color:red;">请注意:提现时将扣除订单金豆赠送比例金额</view> -->
<!-- 0.0038平台手续费 -->
<!-- <view style="color:red;">例如:金豆赠送比例为0.01(百分之一),那消费者付款100元后,您将得到100*(1-0.0038)-(0.01*100)=98.62</view>
<!-- 0.0038平台手续费 -->
<!-- <view style="color:red;">例如:金豆赠送比例为0.01(百分之一),那消费者付款100元后,您将得到100*(1-0.0038)-(0.01*100)=98.62</view>
<view style="color:#999999;">随机立减费用由余乐兑平台方承担,不会从商家提现中扣除</view>
</view> -->
<view class="content">
<!-- <view class="content">
<u--form :model="form" ref="uForm">
<u-form-item label="是否开启金豆抵扣" label-width="280" prop="redirect">
<u-switch size='50' v-model="openCreditGive" @change="openCreditGiveChange" slot="right"></u-switch>
</u-form-item>
</u--form>
</view>
</view> -->
<view class="content" v-if="openCreditGive">
<u--form :model="form" ref="uForm">
<u-form-item label-width="300" :label-position="labelPosition" label="输入金豆抵扣比例:" prop="credit_give">
<u-input :border="border" @change="creditGiveInputChange" type="number" placeholder="请输入金豆抵扣比例"
v-model="form.credit_give"></u-input>
</u-form-item>
<u-form-item label-width="300" :label-position="labelPosition" label="确认金豆抵扣比例:" prop="credit_give2">
<u-input :border="border" type="number" placeholder="请再次输入金豆抵扣比例" v-model="form.credit_give2"></u-input>
</u-form-item>
</u--form>
</view>
<view class="content" v-if="openCreditGive">
<u--form :model="form" ref="uForm">
<u-form-item label-width="300" :label-position="labelPosition" label="当前金豆抵扣比例(%):" prop="credit_give">
<u-input :border="border" type="number" placeholder="请输入金豆抵扣比例"
v-model="form.deduction_ratio"></u-input>
</u-form-item>
<u-form-item label-width="300" :label-position="labelPosition" label="输入金豆抵扣比例(%):" prop="credit_give">
<u-input :border="border" type="number" placeholder="请输入金豆抵扣比例"
v-model="form.credit_give"></u-input>
</u-form-item>
<u-form-item label-width="300" :label-position="labelPosition" label="确认金豆抵扣比例(%):" prop="credit_give2">
<u-input :border="border" type="number" placeholder="请再次输入金豆抵扣比例"
v-model="form.credit_give2"></u-input>
</u-form-item>
</u--form>
</view>
<view style="padding:0.5rem 1rem;">
<view v-if="form.credit_give >= 1">
金豆抵扣比例不能大于1
</view>
<view v-else-if="form.credit_give > 0">
当前金豆抵扣百分比为:
<text style="font-weight:bold;">{{ (modifyCreditMoneyEg()) }}%; </text>
<text>即每收款100元,则抵扣消费者价值 <text>{{ modifyCreditMoneyEg() }}</text> 元的金豆</text>
</view>
<view v-else>
当前未开启金豆抵扣
</view>
<!-- <view style="margin-top:15rpx;">
<text>最大金豆赠送比例:{{ form.max_credit_give }} ; </text>
<text>最小金豆赠送比例:{{ form.min_credit_give }} ; </text>
</view> -->
</view>
<view style="margin-top: 60rpx;">
<u-button :disabled="false" class="button" @click="submit">保存设置</u-button>
</view>
<view style="margin-top: 60rpx;">
<u-button :disabled="false" class="button" @click="submit">保存设置</u-button>
</view>
</view>
</view>
</template>
<script>
import {
update_deduction
} from '@/utils/api.js'
let that = {}
export default {
data() {
return {
showInfo: false,
form: {
payType: '提现到银行',
payTypeValue: 2,
},
bankImgUp: 'http://yuledui.oss-cn-qingdao.aliyuncs.com/merch_manage/img/bank_card_setting/take_photo.png',// OCR
bankImgUp: 'http://yuledui.oss-cn-qingdao.aliyuncs.com/merch_manage/img/bank_card_setting/take_photo.png', // OCR
openCreditGive: true,
border: 'none',
showPayType: false,
labelPosition: 'left',
modifyCreditMoneyEg: function () {
modifyCreditMoneyEg: function() {
let resNum = parseFloat(parseFloat(that.form.credit_give) * 100).toFixed(2)
if (parseInt(resNum) == resNum) {
resNum = parseInt(resNum)
@ -90,77 +79,48 @@
},
};
},
onLoad: function () {
that = this
// that.init();
onLoad() {
this.init()
},
methods: {
init() {
getApp().globalData.util.request({
s: 'Merch.Mershop_Index.get',
}).then(res => {
console.log(res);
if (res.data.ret == 200) {
that.form = res.data.data
that.form.max_credit_give = parseFloat(that.form.max_credit_give).toFixed(2)
that.form.min_credit_give = parseFloat(that.form.min_credit_give).toFixed(3)
that.form.credit_give2 = res.data.data.credit_give
if (res.data.data.credit_give <= 0) {
that.openCreditGive = false
}
}
})
if (uni.getStorageSync('shopManage').deduction_ratio > 0) {
this.openCreditGive = true
} else {
this.openCreditGive = false
}
this.form.deduction_ratio = uni.getStorageSync('shopManage').deduction_ratio
},
submit() {
if (!that.openCreditGive) {
that.form.credit_give = 0
}
if (that.form.credit_give >= 1) {
uni.showModal({
title: '提示',
content: '赠送比例必须小于1'
})
return
}
if (that.form.credit_give !== that.form.credit_give2) {
uni.showModal({
title: '提示',
content: '两次输入的赠送比例不一致'
})
return
}
// if (that.form.credit_give < that.form.min_credit_give || that.form.credit_give > that.form.max_credit_give) {
var that=this
// if (!that.openCreditGive) {
// that.form.credit_give = 0
// }
// if (that.form.credit_give >= 1) {
// uni.showModal({
// title: '',
// content: ''+that.form.min_credit_give+""+that.form.max_credit_give+""
// content: '1'
// })
// return
// }
getApp().globalData.util.request({
s: 'Merch.Mershop_Index.updateCreditGive',
credit_give: that.form.credit_give
}).then(res => {
if (that.form.credit_give !== that.form.credit_give2) {
uni.showModal({
title: '提示',
content: res.data.data.res_msg,
showCancel: false,
success: function (res) {
if (res.confirm) {
console.log('用户点击确定');
}
}
content: '两次输入的抵现比例不一致'
})
return
}
update_deduction({
shop_admin_id: uni.getStorageSync('shopManage').shop_admin_id,
deduction_ratio: this.form.credit_give
}).then(res => {
if(res.code==200){
this.$u.toast('修改成功')
}
})
},
openCreditGiveChange(selectValue) {
console.log(selectValue);
// if (!selectValue) {
// that.form.credit_give = 0
// that.form.credit_give2 = that.form.credit_give
// }else{
// that.form.credit_give = 0.001
// that.form.credit_give2 = that.form.credit_give
// }
console.log(selectValue);
},
creditGiveInputChange(inputValue) {
console.log(inputValue)
@ -171,5 +131,5 @@
<style lang="scss" scoped>
@import "./creditadd.scss";
</style>
@import "./creditadd.scss";
</style>

View File

@ -1,86 +1,71 @@
<template>
<view class="body">
<view class="header">
<view class="container">
<view class="icon">
<u-image v-if="false" height="60" width="60"
src="https://yuledui.oss-cn-qingdao.aliyuncs.com/merch_manage/img/credit_card_icon.png"></u-image>
</view>
<view class="title " @click='showInfo = !showInfo'>
扫码付款 <text style="font-weight:bold;">[赠送金豆]</text>设置<u-icon name="info-circle
<view class="body">
<view class="header">
<view class="container">
<view class="icon">
<u-image v-if="false" height="60" width="60"
src="https://yuledui.oss-cn-qingdao.aliyuncs.com/merch_manage/img/credit_card_icon.png"></u-image>
</view>
<view class="title " @click='showInfo = !showInfo'>
扫码付款 <text style="font-weight:bold;">[赠送金豆]</text>设置<u-icon name="info-circle
" size="28"></u-icon>
</view>
</view>
</view>
<view class="payinfo" v-if="showInfo">
<view>开启金豆赠送后,<text style="font-weight:bold;">将同时开启随机立减功能;</text></view>
<view style="color:red;">请注意:提现时将扣除订单金豆赠送比例金额</view>
<!-- 0.0038平台手续费 -->
<view style="color:red;">例如:金豆赠送比例为0.01(百分之一),那消费者付款100元后,您将得到100*(1-0.0038)-(0.01*100)=98.62</view>
<view style="color:#999999;">随机立减费用由余乐兑平台方承担,不会从商家提现中扣除</view>
</view>
</view>
</view>
<view class="payinfo" v-if="showInfo">
<view>开启金豆赠送后,<text style="font-weight:bold;">将同时开启随机立减功能;</text></view>
<view style="color:red;">请注意:提现时将扣除订单金豆赠送比例金额</view>
<!-- 0.0038平台手续费 -->
<view style="color:red;">例如:金豆赠送比例为0.01(百分之一),那消费者付款100元后,您将得到100*(1-0.0038)-(0.01*100)=98.62</view>
<view style="color:#999999;">随机立减费用由余乐兑平台方承担,不会从商家提现中扣除</view>
</view>
<view class="content">
</view>
<!-- <view class="content">
<u--form :model="form" ref="uForm">
<u-form-item label="是否开启金豆赠送" label-width="280" prop="redirect">
<u-switch size='50' v-model="openCreditGive" @change="openCreditGiveChange" slot="right"></u-switch>
</u-form-item>
</u--form>
</view>
</view> -->
<view class="content" v-if="openCreditGive">
<u--form :model="form" ref="uForm">
<u-form-item label-width="300" :label-position="labelPosition" label="输入金豆赠送比例:" prop="credit_give">
<u-input :border="border" @change="creditGiveInputChange" type="number" placeholder="请输入金豆赠送比例"
v-model="form.credit_give"></u-input>
</u-form-item>
<u-form-item label-width="300" :label-position="labelPosition" label="确认金豆赠送比例:" prop="credit_give2">
<u-input :border="border" type="number" placeholder="请再次输入金豆赠送比例" v-model="form.credit_give2"></u-input>
</u-form-item>
</u--form>
</view>
<view class="content">
<u--form :model="form" ref="uForm">
<u-form-item label-width="300" :label-position="labelPosition" label="当前金豆赠送比例(%):" prop="credit_give">
<u-input :border="border" @change="creditGiveInputChange" placeholder="请输入金豆赠送比例"
v-model="form.gift_rate"></u-input>
</u-form-item>
<u-form-item label-width="300" :label-position="labelPosition" label="新的金豆赠送比例(%):" prop="credit_give">
<u-input :border="border" @change="creditGiveInputChange" placeholder="请输入金豆赠送比例"
v-model="form.credit_give"></u-input>
</u-form-item>
<u-form-item label-width="300" :label-position="labelPosition" label="确认金豆赠送比例(%):" prop="credit_give2">
<u-input :border="border" placeholder="请再次输入金豆赠送比例" v-model="form.credit_give2"></u-input>
</u-form-item>
</u--form>
</view>
<view style="margin-top: 60rpx;">
<u-button :disabled="false" class="button" @click="submit">保存设置</u-button>
</view>
<view style="padding:0.5rem 1rem;">
<view v-if="form.credit_give >= 1">
金豆赠送比例不能大于1
</view>
<view v-else-if="form.credit_give > 0">
当前金豆赠送百分比为:
<text style="font-weight:bold;">{{ (modifyCreditMoneyEg()) }}%; </text>
<text>即每收款100元,则赠送消费者价值 <text>{{ modifyCreditMoneyEg() }}</text> 元的金豆</text>
</view>
<view v-else>
当前未开启扫码送金豆
</view>
<!-- <view style="margin-top:15rpx;">
<text>最大金豆赠送比例:{{ form.max_credit_give }} ; </text>
<text>最小金豆赠送比例:{{ form.min_credit_give }} ; </text>
</view> -->
</view>
<view style="margin-top: 60rpx;">
<u-button :disabled="false" class="button" @click="submit">保存设置</u-button>
</view>
</view>
</view>
</template>
<script>
import {
update_gift_rate
} from '@/utils/api.js'
let that = {}
export default {
data() {
return {
showInfo: false,
form: {
payType: '提现到银行',
payTypeValue: 2,
},
bankImgUp: 'http://yuledui.oss-cn-qingdao.aliyuncs.com/merch_manage/img/bank_card_setting/take_photo.png',// OCR
form: {},
bankImgUp: 'http://yuledui.oss-cn-qingdao.aliyuncs.com/merch_manage/img/bank_card_setting/take_photo.png', // OCR
openCreditGive: true,
border: 'none',
showPayType: false,
labelPosition: 'left',
modifyCreditMoneyEg: function () {
modifyCreditMoneyEg: function() {
let resNum = parseFloat(parseFloat(that.form.credit_give) * 100).toFixed(2)
if (parseInt(resNum) == resNum) {
resNum = parseInt(resNum)
@ -89,26 +74,18 @@
},
};
},
onLoad: function () {
onLoad: function() {
that = this
// that.init();
that.init();
},
methods: {
init() {
getApp().globalData.util.request({
s: 'Merch.Mershop_Index.get',
}).then(res => {
console.log(res);
if (res.data.ret == 200) {
that.form = res.data.data
that.form.max_credit_give = parseFloat(that.form.max_credit_give).toFixed(2)
that.form.min_credit_give = parseFloat(that.form.min_credit_give).toFixed(3)
that.form.credit_give2 = res.data.data.credit_give
if (res.data.data.credit_give <= 0) {
that.openCreditGive = false
}
}
})
if (uni.getStorageSync('shopManage').gift_rate > 0) {
this.openCreditGive = true
} else {
this.openCreditGive = false
}
this.form.gift_rate = uni.getStorageSync('shopManage').gift_rate
},
submit() {
if (!that.openCreditGive) {
@ -128,38 +105,17 @@
})
return
}
// if (that.form.credit_give < that.form.min_credit_give || that.form.credit_give > that.form.max_credit_give) {
// uni.showModal({
// title: '',
// content: ''+that.form.min_credit_give+""+that.form.max_credit_give+""
// })
// return
// }
getApp().globalData.util.request({
s: 'Merch.Mershop_Index.updateCreditGive',
credit_give: that.form.credit_give
update_gift_rate({
shop_admin_id: uni.getStorageSync('shopManage').shop_admin_id,
gift_rate: this.form.credit_give
}).then(res => {
uni.showModal({
title: '提示',
content: res.data.data.res_msg,
showCancel: false,
success: function (res) {
if (res.confirm) {
console.log('用户点击确定');
}
if(res.code==200){
this.$u.toast('修改成功')
}
})
})
},
openCreditGiveChange(selectValue) {
console.log(selectValue);
// if (!selectValue) {
// that.form.credit_give = 0
// that.form.credit_give2 = that.form.credit_give
// }else{
// that.form.credit_give = 0.001
// that.form.credit_give2 = that.form.credit_give
// }
console.log(selectValue);
},
creditGiveInputChange(inputValue) {
console.log(inputValue)
@ -170,5 +126,5 @@
<style lang="scss" scoped>
@import "./creditadd.scss";
</style>
@import "./creditadd.scss";
</style>

27
utils/api.js Normal file
View File

@ -0,0 +1,27 @@
import request from "@/utils/request.js"
//登录
export const login = (params) => {
return request('/api/shop/shop_login',"POST",params)
}
//商铺信息
export const shopdetail = (params) => {
return request('/api/shop/detail_by_id',"POST",params)
}
//商铺管理信息
export const managerdetail = (params) => {
return request('/api/shop/manager_by_id',"POST",params)
}
//修改金豆赠送比例
export const update_gift_rate = (params) => {
return request('/api/shop/shop_update_gift_rate',"POST",params)
}
//修改金豆抵现比例
export const update_deduction= (params) => {
return request('/api/shop/shop_update_deduction_ratio',"POST",params)
}
//修改店铺信息
export const update_shop= (params) => {
return request('/api/shop/update_shop',"POST",params)
}

43
utils/imgtobase.js Normal file
View File

@ -0,0 +1,43 @@
/**
* @description 本地图片转base64方法兼容APPH5小程序
* @param {number} path 图片本地路径
* @returns Promise对象
*/
const toBase64 = (path) => {
return new Promise((resolve, reject) => {
// #ifdef APP-PLUS
plus.io.resolveLocalFileSystemURL(path, (entry) => {
entry.file((file) => {
let fileReader = new plus.io.FileReader()
fileReader.readAsDataURL(file)
fileReader.onloadend = (evt) => {
let base64 = evt.target.result.split(",")[1]
resolve(base64)
}
})
})
// // #endif
// #ifdef H5
uni.request({
url: path,
responseType: 'arraybuffer',
success: (res) => {
resolve(uni.arrayBufferToBase64(res.data))
}
})
// #endif
// #ifdef MP-WEIXIN
uni.getFileSystemManager().readFile({
filePath: path,
encoding: 'base64',
success: (res) => {
resolve(res.data)
}
})
// #endif
})
}
export {
toBase64
}

22
utils/request.js Normal file
View File

@ -0,0 +1,22 @@
export default ((url, method, data = {}) => {
var BaseUrl = ''
BaseUrl = "http://192.168.0.155:7301"
return new Promise((resolve, reject) => {
let header = {
"Content-Type": "application/json",
}
let api = BaseUrl + url
uni.request({
url: api,
method,
data,
header,
success: (res) => {
resolve(res.data)
},
fail: (erro) => {
reject(erro)
}
})
})
})