初始化代码

This commit is contained in:
2025-12-22 17:13:05 +08:00
parent ed0de08e3a
commit 1f7e9d401b
2947 changed files with 526137 additions and 0 deletions

View File

@@ -0,0 +1,74 @@
<template>
<view class="mine-pages-setting" v-if="isLoad">
<view class="flex-center flex-column">
<view class="space-lg"></view>
<view class="space-md"></view>
<image mode="aspectFill" lazy-load class="logo-img" :src="configInfo.app_logo"></image>
<view class="f-caption c-caption mt-md">{{configInfo.app_text}}</view>
<view class="space-lg"></view>
<view class="space-md"></view>
</view>
<view class="flex-between pd-lg fill-base f-paragraph">
<view>当前版本</view>
<view class="c-caption">{{version}}</view>
</view>
<view class="space-md"></view>
<view @tap.stop="$util.goUrl({url:`/home/pages/about`})" class="flex-between pd-lg fill-base f-paragraph">
<view>关于我们</view>
<i class="iconfont icon-right"></i>
</view>
<view class="space-footer"></view>
</view>
</template>
<script>
import {
mapState,
mapActions,
mapMutations
} from "vuex"
import siteInfo from '@/siteinfo.js'
import checkUpdate from '@/uni_modules/uni-upgrade-center-app/utils/check-update'
export default {
components: {},
data() {
return {
isLoad: false,
options: {},
version: plus.runtime.version
}
},
computed: mapState({
primaryColor: state => state.config.configInfo.primaryColor,
subColor: state => state.config.configInfo.subColor,
configInfo: state => state.config.configInfo,
userInfo: state => state.user.userInfo,
}),
async onLoad() {
this.initIndex()
},
methods: {
...mapActions(['getUserInfo', 'getConfigInfo']),
...mapMutations(['updateUserItem']),
async initIndex() {
await this.getConfigInfo()
this.isLoad = true
checkUpdate()
}
}
}
</script>
<style lang="scss">
.mine-pages-setting {
.iconfont {
color: #999
}
.logo-img {
width: 160rpx;
height: 160rpx;
}
}
</style>

View File

@@ -0,0 +1,278 @@
<template>
<view class="mine-address-edit" v-if="isLoad">
<view class="fill-base f-title">
<view class="flex-between pd-lg b-1px-b">
<view>联系人</view>
<input v-model="subForm.user_name" type="text" class="flex-1 f-paragraph text-right"
placeholder-class="c-placeholder" :placeholder="rule[0].errorMsg" />
</view>
<view class="flex-between pd-lg b-1px-b">
<view>手机号</view>
<input v-model="subForm.mobile" type="number" class="flex-1 f-paragraph text-right"
placeholder-class="c-placeholder" :placeholder="rule[1].errorMsg" />
<button open-type="getPhoneNumber" @getphonenumber="toAuthPhone" class="clear-btn"
:style="{color:primaryColor,marginLeft:'15rpx',fontSize:'28rpx'}">授权</button>
</view>
<view class="flex-between pd-lg b-1px-b">
<view class="flex-1">选择地区</view>
<view @tap.stop="toChooseLocation" class="flex-y-center f-paragraph max-500 text-right">
<view class="flex-1 text-right"
:class="[{'c-placeholder':!subForm.address},{'c-title':subForm.address}]">
{{subForm.address || `点击右边图标设置`}}
</view><i class="iconfont icon-dingwei-fill ml-sm" :style="{color: primaryColor}"></i>
</view>
</view>
<view class="pd-lg f-title">
<view>详细地址</view>
<textarea class="pt-lg textarea-item f-paragraph" v-model="subForm.address_info" maxlength="100"
placeholder-class="c-placeholder" :placeholder="rule[3].errorMsg"></textarea>
</view>
</view>
<view class="fill-base mt-md pt-sm pb-sm pl-lg pr-lg f-paragraph">
<view class="flex-between">
<view class="f-paragraph">设为默认地址</view>
<view @tap.stop="toSetItem" class="flex-1 text-right">
<i class="iconfont icon-switch ml-sm" :class="[{'icon-switch-on':subForm.status==1}]"
:style="{color: subForm.status==1 ? primaryColor : '#999'}"></i>
</view>
</view>
</view>
<view class="f-caption c-title mt-md pl-lg"> 设置后下单时优先展示该地址</view>
<view class="space-max-footer"></view>
<fix-bottom-button @cancel="$refs.del_item.open()" @confirm="confirmSubmit"
:text="subForm.id?[{text: '删除',type: 'cancel'}, {text: '保存',type: 'confirm'}]:[{text: '提交',type: 'confirm'}]"
bgColor="#fff"></fix-bottom-button>
<common-popup @confirm="confirmDel" ref="del_item" type="DEL_ITEM" :info="popupInfo"></common-popup>
</view>
</template>
<script>
import {
mapState,
mapActions,
mapMutations
} from "vuex"
export default {
components: {},
data() {
return {
isLoad: false,
options: {},
subForm: {
id: 0,
user_name: '',
mobile: '',
address: '',
address_info: '',
province:'',
lng: '',
lat: '',
status: 0
},
rule: [{
name: "user_name",
checkType: "isNotNull",
errorMsg: "请输入联系人姓名",
regType: 2
}, {
name: "mobile",
checkType: "isMobile",
errorMsg: "请输入手机号"
},
{
name: "address",
checkType: "isNotNull",
errorMsg: "设置地区"
},
{
name: "address_info",
checkType: "isNotNull",
errorMsg: "请输入街道、楼牌号等",
regType: 2
},
],
lockTap: false,
popupInfo: {}
}
},
computed: mapState({
primaryColor: state => state.config.configInfo.primaryColor,
subColor: state => state.config.configInfo.subColor,
userInfo: state => state.user.userInfo,
}),
onLoad(options) {
this.options = options
this.initIndex()
},
methods: {
...mapActions(['getAuthPhone']),
...mapMutations(['updateOrderItem']),
async initIndex() {
let {
id = 0
} = this.options
uni.setNavigationBarTitle({
title: id ? `编辑地址` : `新增地址`
})
if (!id) {
this.isLoad = true
this.subForm.mobile = this.userInfo.phone
return
}
this.$util.showLoading()
let data = await this.$api.mine.addressInfo({
id
})
for (let key in this.subForm) {
this.subForm[key] = data[key]
}
this.isLoad = true
this.$util.hideAll()
},
// 授权手机号
async toAuthPhone(e) {
let phone = await this.getAuthPhone({
e,
})
if (!phone) return
this.$nextTick(() => {
this.subForm.mobile = phone
})
},
// 选择地区
async toChooseLocation(e) {
await this.$util.checkAuth({
type: 'userLocation'
})
let [, {
address = '',
longitude,
latitude
} = {}] = await uni.chooseLocation();
if (!address) return
let reg = /.+?(省|市|自治区|自治州|区)/g
this.subForm.province = address.match(reg)[0]
this.subForm.address = address
this.subForm.lng = longitude
this.subForm.lat = latitude
},
toSetItem() {
this.subForm.status = this.subForm.status == 1 ? 0 : 1
},
// 确认:删除
async confirmDel() {
let {
id
} = this.subForm
let {
check_id
} = this.$util.getPage(-1)
if (this.lockTap) return
this.lockTap = true
this.$util.showLoading()
try {
await this.$api.mine.addressDel({
id
})
this.lockTap = false
this.$util.hideAll()
this.$util.showToast({
title: `删除成功`
})
this.$refs.del_item.close()
if (id == check_id) {
this.updateOrderItem({
key: 'haveOperItem',
val: true
})
}
setTimeout(() => {
this.$util.back()
this.$util.goUrl({
url: 1,
openType: `navigateBack`
})
}, 1000)
} catch (e) {
setTimeout(() => {
this.lockTap = false
this.$util.hideAll()
}, 2000)
}
},
//表单验证
validate(param) {
let validate = new this.$util.Validate();
this.rule.map(item => {
let {
name,
} = item
validate.add(param[name], item);
})
let message = validate.start();
return message;
},
// 新增/编辑
async confirmSubmit() {
let param = this.$util.deepCopy(this.subForm)
let msg = this.validate(param);
if (msg) {
this.$util.showToast({
title: msg
});
return;
}
if (this.lockTap) return
this.lockTap = true
this.$util.showLoading()
try {
let methodModel = param.id ? `addressUpdate` : `addressAdd`
await this.$api.mine[methodModel](param)
this.$util.hideAll()
this.$util.showToast({
title: `保存成功`,
});
this.lockTap = false;
setTimeout(() => {
this.$util.back()
this.$util.goUrl({
url: 1,
openType: `navigateBack`
})
}, 1000)
} catch (e) {
setTimeout(() => {
this.lockTap = false
this.$util.hideAll()
}, 2000)
}
}
}
}
</script>
<style lang="scss">
.mine-address-edit {
.icon-dingwei-fill {
font-size: 40rpx;
}
.icon-switch,
.icon-switch-on {
font-size: 80rpx;
}
.textarea-item {
width: 690rpx;
height: 200rpx;
overflow-y: auto;
}
}
</style>

View File

@@ -0,0 +1,279 @@
<template>
<view class="mine-address-list">
<view @tap.stop="toUpdateItem(index)" class="list-item fill-base mt-md" v-for="(item,index) in list.data"
:key="index">
<view class="flex-warp pd-lg b-1px-b">
<view class="address-icon flex-center c-base radius" :style="{background:primaryColor}"><i
class="iconfont icon-dingwei-fill"></i></view>
<view class="address-info flex-1 ml-md">
<view class="flex-y-baseline username c-title text-bold">{{item.user_name}}
<view class="ml-md f-desc c-paragraph">{{item.mobile}}</view>
</view>
<view class="f-desc c-title">{{`${item.address} ${item.address_info}`}}</view>
</view>
</view>
<view class="oper-info pl-lg pr-lg f-paragraph c-paragraph flex-between">
<view class="flex-y-center"
:style="{color:options.check && item.id == check_id || !options.check && item.status==1 ?primaryColor:''}">
<i class="iconfont icon-xuanze mr-sm"
:class="[{'icon-xuanze-fill':options.check && item.id == check_id || !options.check && item.status==1}]"
:style="{color:options.check && item.id == check_id || !options.check && item.status==1?primaryColor:''}"></i>
<block v-if="options.check">{{item.id == check_id ?'当前选择地址':'点击选择'}}</block>
<block v-else>{{item.status ==1?'默认地址':'设为默认'}}</block>
</view>
<view class="flex-center">
<view @tap.stop="goDetail(index)" class="pl-lg pr-lg">编辑</view>
<view @tap.stop="toDel(index)" class="pl-lg">删除</view>
</view>
</view>
</view>
<load-more :noMore="list.current_page>=list.last_page&&list.data.length>0" :loading="loading" v-if="loading">
</load-more>
<abnor title="暂未设置地址信息" :tip="[{ text: '点击下方按钮添加', color: 0 }]"
v-if="!loading&&list.data.length<=0&&list.current_page==1">
</abnor>
<view class="space-max-footer"></view>
<fix-bottom-button @confirm="$util.goUrl({url:`/mine/pages/address/edit`})"
:text="[{text:'新增地址',type:'confirm'}]"></fix-bottom-button>
<common-popup @confirm="confirmDel" ref="del_item" type="DEL_ITEM" :info="popupInfo"></common-popup>
</view>
</template>
<script>
import {
mapState,
mapMutations
} from "vuex"
export default {
components: {},
data() {
return {
options: {},
check_id: 0,
param: {
page: 1,
},
list: {
data: []
},
loading: true,
lockTap: false,
popupInfo: {}
}
},
computed: mapState({
primaryColor: state => state.config.configInfo.primaryColor,
subColor: state => state.config.configInfo.subColor,
userInfo: state => state.user.userInfo,
haveOperItem: state => state.order.haveOperItem,
}),
onLoad(options) {
let {
check = 0
} = options
// check 1土地/认养/商城下单选择地址2认养配送选择地址3土地配送选择地址
options.check = check
if (check) {
let {
id = 0
} = check == 1 ? this.$util.getPage(-1).orderInfo.address : this.$util.getPage(-1).address_info
this.check_id = id
}
this.options = options
this.updateOrderItem({
key: 'haveOperItem',
val: false
})
this.initIndex()
},
onUnload() {
let {
check = 0,
} = this.options
let {
haveOperItem
} = this
if (check && haveOperItem) {
if (check == 1) {
this.$util.getPage(-1).orderInfo.address = {}
} else {
this.$util.getPage(-1).address_info = {}
}
this.$util.back()
}
},
onPullDownRefresh() {
// #ifndef APP-PLUS
uni.showNavigationBarLoading()
// #endif
this.initRefresh()
uni.stopPullDownRefresh()
},
onReachBottom() {
if (this.list.current_page >= this.list.last_page || this.loading) return
this.param.page = this.param.page + 1
this.loading = true
this.getList()
},
methods: {
...mapMutations(['updateOrderItem']),
initIndex() {
this.getList()
},
initRefresh() {
this.param.page = 1
this.initIndex()
},
async getList() {
let {
list: oldList,
param,
check_id = 0
} = this
let {
check = 0
} = this.options
let newList = await this.$api.mine.addressList(param);
if (this.param.page == 1) {
this.list = newList
let arr = newList.data.filter(item => {
return item.id == check_id
})
if (check && arr.length > 0) {
if (check == 1) {
this.$util.getPage(-1).orderInfo.address = arr[0]
this.$util.back()
} else {
this.$util.getPage(-1).address_info = arr[0]
if (check == 3) {
this.$util.getPage(-1).detail.address_info = arr[0]
}
}
}
} else {
newList.data = oldList.data.concat(newList.data)
this.list = newList
}
this.loading = false
this.$util.hideAll()
},
async toUpdateItem(index) {
let {
check = 0
} = this.options
let item = this.list.data[index]
// check 1下单选择地址2发起配送选择地址
if (check) {
if (check == 1) {
this.$util.getPage(-1).orderInfo.address = item
this.$util.back()
} else {
this.$util.getPage(-1).address_info = item
}
this.$util.goUrl({
url: 1,
openType: `navigateBack`
})
} else {
let {
id,
status
} = item
await this.$api.mine.addressUpdate({
id,
status: status == 0 ? 1 : 0
})
this.initRefresh()
}
},
// 弹窗:删除
async toDel(index) {
let {
id,
} = this.list.data[index]
this.popupInfo = {
id,
name: '',
image: '',
index,
}
this.$refs.del_item.open()
},
async confirmDel() {
let {
id,
index,
} = this.popupInfo
let {
check_id
} = this
if (this.lockTap) return
this.lockTap = true
this.$util.showLoading()
try {
await this.$api.mine.addressDel({
id
})
this.lockTap = false
this.$util.hideAll()
this.$util.showToast({
title: `删除成功`
})
this.list.data.splice(index, 1)
this.$refs.del_item.close()
if (id == check_id) {
this.updateOrderItem({
key: 'haveOperItem',
val: true
})
}
} catch (e) {
setTimeout(() => {
this.lockTap = false
this.$util.hideAll()
}, 2000)
}
},
goDetail(index) {
let {
id
} = this.list.data[index]
let url = `/mine/pages/address/edit?id=${id}`
this.$util.goUrl({
url
})
},
}
}
</script>
<style lang="scss">
.mine-address-list {
.address-icon {
width: 64rpx;
height: 64rpx;
.iconfont {
font-size: 38rpx;
}
}
.address-info {
max-width: 606rpx;
}
.username {
font-size: 30rpx;
}
.oper-info {
height: 80rpx;
}
}
</style>

View File

@@ -0,0 +1,77 @@
<template>
<view class="mine-agreement" v-if="detail.id">
<view class="pd-lg">
<parser :html="detail.text" @linkpress="linkpress" show-with-animation lazy-load>加载中...</parser>
</view>
<view class="space-footer"></view>
</view>
</template>
<script>
import {
mapState,
} from "vuex"
import parser from "@/components/jyf-Parser/index"
export default {
components: {
parser
},
data() {
return {
options: {},
detail: {},
popupInfo: {}
}
},
computed: mapState({
primaryColor: state => state.config.configInfo.primaryColor,
subColor: state => state.config.configInfo.subColor,
configInfo: state => state.config.configInfo,
userInfo: state => state.user.userInfo,
}),
onLoad(options) {
this.$util.showLoading()
this.options = options
this.initIndex()
},
onUnload() {
this.$util.back()
},
methods: {
async initIndex() {
let {
type
} = this.options
this.detail = await this.$api.home.aboutUsInfoType({
type
})
let {
title
} = this.detail
uni.setNavigationBarTitle({
title
})
this.$util.hideAll()
},
initRefresh() {
this.initIndex()
},
linkpress(res) {
console.log("linkpress", res);
// #ifdef APP-PLUS
this.$util.goUrl({
url: res.href,
openType: 'web'
})
// #endif
}
}
}
</script>
<style lang="scss">
page {
background: #fff
}
</style>

View File

@@ -0,0 +1,171 @@
<template>
<view class="master-apply-result" v-if="isLoad">
<abnor percent="150%" @confirm="confirm" @cancel="cancel" :title="title[status]" :tip="tipArr[status]"
:button="buttonArr[status]" :image="image[status]" :tipMax="status == 4? '690rpx':''"></abnor>
</view>
</template>
<script>
import {
mapState,
mapActions,
mapMutations
} from "vuex"
export default {
components: {},
data() {
return {
// || (options.type == 2 && [1,2].includes(farmer_status))
options: {},
// -1未申请1审核中2审核通过3取消授权4审核失败(可再次申请)
tipArr: {
'1': [],
'2': [],
'3': [{
text: '平台管理员已取消授权',
color: 0
}],
'4': [{
text: '请联系平台管理人员询问失败原因',
color: 0
}]
},
buttonArr: {
'1': [{
text: '返回',
type: 'cancel'
}],
'2': [{
text: '',
type: 'confirm'
}],
'3': [{
text: '返回',
type: 'cancel'
}],
'4': [{
text: '再次申请',
type: 'confirm'
}, {
text: '返回',
type: 'cancel'
}]
},
title: {
'1': '等待审核',
'2': '',
'3': '取消授权',
'4': '申请失败',
},
image: {
'1': 'https://lbqny.migugu.com/admin/public/apply_wait.jpg',
'2': 'https://lbqny.migugu.com/admin/public/apply_suc.jpg',
'3': 'https://lbqny.migugu.com/admin/public/apply_fail.jpg',
'4': 'https://lbqny.migugu.com/admin/public/apply_fail.jpg',
},
isLoad: false,
status: 1
}
},
computed: mapState({
primaryColor: state => state.config.configInfo.primaryColor,
subColor: state => state.config.configInfo.subColor,
configInfo: state => state.config.configInfo,
mineInfo: state => state.user.mineInfo,
}),
async onLoad(options) {
this.$util.showLoading()
this.options = options
await this.initIndex()
},
methods: {
...mapActions(['getMineInfo']),
...mapMutations(['updateUserItem']),
async initIndex() {
await this.getMineInfo()
this.$util.hideAll()
let {
type
} = this.options
let {
farmer_status,
sh_text,
fx_status,
fx_text,
} = this.mineInfo
let status = type == 1 ? farmer_status : fx_status
let text = type == 1 ? sh_text : fx_text
this.status = status
if (status == 1) {
this.tipArr[status] = type == 1 ? [{
text: '审核成功后将直接入驻平台',
color: 0
}] : [{
text: '您已经成功提交申请',
color: 0
}, {
text: '审核将在3个工作日内出结果请耐心等待',
color: 0
}]
}
if (status == 2) {
this.tipArr[status] = type == 1 ? [{
text: '恭喜您,审核通过!',
color: 0
}] : [{
text: '您已具备分销资格,快去分享商品体验吧~',
color: 0
}]
this.buttonArr[status][0].text = type == 1 ? `去管理` : `去分享`
this.title[status] = type == 1 ? `入驻成功` : `审核通过`
}
if (status == 4 && text) {
this.tipArr[status][0].text = text
}
this.$util.hideAll()
this.isLoad = true
uni.setNavigationBarTitle({
title: this.title[status]
})
},
initRefresh() {
this.isLoad = false
this.initIndex(true)
},
// 再次申请
async confirm() {
let {
status
} = this
let {
type
} = this.options
let url = status == 2 ? type == 1 ? `/pages/mine` : `/pages/shop` : type == 1 ?
`/farmer/pages/apply` :
`/mine/pages/distribution/apply`
this.$util.log(url)
this.$util.goUrl({
url,
openType: status == 2 ? `switchTab` : `redirectTo`
})
},
// 返回首页
cancel() {
this.$util.back()
this.$util.goUrl({
url: 1,
openType: `navigateBack`
})
},
}
}
</script>
<style lang="scss">
page {
background: white;
}
</style>

View File

@@ -0,0 +1,113 @@
<template>
<view class="mine-balance-index rel" v-if="isLoad">
<view class="count-info flex-center flex-column c-base" :style="{background:primaryColor}">
<view class="f-caption">{{mineInfo.is_user?'我的余额(元)':'可提余额(元)'}}</view>
<view class="price mt-sm">{{mineInfo.is_user?mineInfo.balance:mineInfo.wallet_cash}}</view>
<view class="flex-center btn-list f-paragraph mt-lg pt-lg">
<view @tap.stop="$util.goUrl({url:`/mine/pages/balance/list`})"
class="item-child flex-center fill-base c-title mr-lg radius">充值</view>
<view @tap.stop="$util.goUrl({url:`/mine/pages/cash-out?type=business`})"
class="item-child flex-center c-base radius" v-if="!mineInfo.is_user">提现</view>
</view>
</view>
<view class="money-count fill-base flex-center pt-lg pb-lg" v-if="!mineInfo.is_user">
<view class="item-child flex-center flex-column b-1px-r">
<view class="flex-y-baseline f-lg-title">{{mineInfo.balance}}</view>
<view class="f-caption c-caption">总金额()</view>
</view>
<view class="item-child flex-center flex-column">
<view class="flex-y-baseline f-lg-title">{{mineInfo.frozen_cash}}</view>
<view class="f-caption c-caption">不可用余额()</view>
</view>
</view>
<view @tap.stop="$util.goUrl({url:`/mine/pages/balance/record`})" class="flex-between mt-md pd-lg fill-base">
<view class="f-title c-title">交易记录</view>
<i class="iconfont icon-right"></i>
</view>
<view class="space-footer"></view>
</view>
</template>
<script>
import {
mapState,
mapActions
} from "vuex"
import tabbar from "@/components/tabbar.vue"
export default {
components: {
tabbar
},
data() {
return {
detail: {},
isLoad: false
}
},
computed: mapState({
primaryColor: state => state.config.configInfo.primaryColor,
subColor: state => state.config.configInfo.subColor,
configInfo: state => state.config.configInfo,
commonOptions: state => state.user.commonOptions,
userInfo: state => state.user.userInfo,
mineInfo: state => state.user.mineInfo,
}),
onLoad() {
this.$util.setNavigationBarColor({
color: '#ffffff',
bg: '#39b54a'
});
this.initIndex()
},
onUnload() {
this.$util.back()
},
onPullDownRefresh() {
// #ifndef APP-PLUS
uni.showNavigationBarLoading()
// #endif
this.initRefresh()
uni.stopPullDownRefresh()
},
methods: {
...mapActions(['getMineInfo']),
async initIndex() {
await this.getMineInfo()
this.$util.hideAll()
this.isLoad = true
},
initRefresh() {
this.initIndex()
}
}
}
</script>
<style lang="scss">
.mine-balance-index {
.count-info {
height: 450rpx;
.price {
font-size: 70rpx;
}
.btn-list {
.item-child {
width: 240rpx;
height: 64rpx;
border: 1rpx solid #fff;
transform: rotateZ(360deg);
}
}
}
.money-count {
.item-child {
width: 50%;
}
}
}
</style>

View File

@@ -0,0 +1,313 @@
<template>
<view class="mine-balance-list">
<view class="count-info flex-center flex-column c-base" :style="{background:primaryColor}">
<view class="f-caption">当前余额()</view>
<view class="price mt-sm">{{userInfo.balance}}</view>
</view>
<view class="flex-center fill-base mg-big pd-lg box-shadow radius-24" v-for="(item,index) in list.data"
:key="index">
<view class="flex-1 mr-lg">
<view class="flex-y-baseline f-caption c-warning text-bold">
¥<view class="f-sm-title">{{item.price}}</view>
</view>
<view class="f-caption c-desc mt-sm">{{item.title}}</view>
<view class="f-caption mt-sm" :style="{color:primaryColor}" v-if="item.member_level*1>0">
{{item.member_title}}
</view>
</view>
<view @tap.stop="toChangeItem('chooseInd',index)" class="stored-btn flex-center f-caption c-base radius-4"
:style="{background:primaryColor}">立即充值
</view>
</view>
<view class="fill-base mg-big pd-lg box-shadow radius-24">
<view class="input-item flex-between radius-16">
<input v-model="price" v-on:input="checkInput($event,'price')" type="digit"
class="flex-1 mr-lg pt-md pb-md pl-lg f-paragraph c-title" placeholder="请输入充值金额,无赠送"
placeholder-class="f-paragraph c-caption" />
<view @tap.stop="toChangeItem('chooseInd','price')" class="stored-btn flex-center f-caption c-base"
:style="{background:primaryColor}">立即充值
</view>
</view>
</view>
<view class="fill-base mg-big pd-lg box-shadow radius-24">
<view class="flex-y-center mb-lg">
<view class="common-line" :style="{background:primaryColor}"></view>
<view class="f-title c-title text-bold">充值说明</view>
</view>
<view class="f-desc c-caption" v-html="text"></view>
</view>
<view class="space-footer"></view>
<uni-popup ref="choose_item" type="bottom" :custom="true">
<view @touchmove.stop.prevent class="popup-choose-item fill-base pt-lg pb-lg radius-top-34">
<view @tap.stop="$refs.choose_item.close()" class="flex-between pl-lg pr-lg pb-lg" style="width: 100%;">
<view class="flex-center f-title c-title text-bold">选择支付方式</view>
<i class="iconfont icon-add-circle rotate-45" :style="{color:subColor}"></i>
</view>
<view @tap.stop="toChangeItem('payInd',index)" class="flex-between ml-md mr-md pl-sm pr-sm pt-lg pb-lg"
:class="[{'b-1px-t':index>0}]" v-for="(item,index) in payList" :key="index">
<view class="pay-item flex-y-center"><i class="iconfont mr-md" :class="[item.icon]"
:style="{color:item.id==1?primaryColor:'#01AAF2'}"></i>
<view class="flex-y-baseline">{{item.title}}
</view>
</view>
<i class="pay-icon iconfont c-caption"
:class="[{'icon-xuanze':payInd != index},{'icon-radio-fill':payInd == index}]"
:style="{color:payInd==index?primaryColor:''}"></i>
</view>
<view class="space-lg"></view>
<view @tap="toPay" class="pay-btn flex-center f-title c-base radius" :style="{background:primaryColor}">
立即支付</view>
<view class="space-lg"></view>
<view class="space-safe"></view>
</view>
</uni-popup>
</view>
</template>
<script>
import {
mapState,
mapActions
} from "vuex"
export default {
components: {},
data() {
return {
// 1微信支付2余额支付3支付宝支付
payList: [{
id: 1,
title: '微信支付',
icon: 'icon-wechat-pay'
}
// #ifdef APP-PLUS
, {
id: 3,
title: '支付宝支付',
icon: 'icon-alipay',
is_disabled: false
}
// #endif
],
payInd: 0,
chooseInd: 0,
param: {
page: 1,
limit: 10
},
list: {
data: []
},
loading: true,
lockTap: false,
text: `
<p>1、充值的本金和赠送金额均不可提现、转移、转赠</p>
<p>2、使用范围本平台所有项目或者商品皆可购买</p>`,
price: ''
}
},
computed: mapState({
primaryColor: state => state.config.configInfo.primaryColor,
subColor: state => state.config.configInfo.subColor,
userInfo: state => state.user.userInfo,
}),
async onLoad() {
this.$util.showLoading()
await this.initIndex()
},
onUnload() {
this.$util.back()
},
onPullDownRefresh() {
// #ifndef APP-PLUS
uni.showNavigationBarLoading()
// #endif
this.initRefresh()
uni.stopPullDownRefresh()
},
onReachBottom() {
if (this.list.current_page >= this.list.last_page || this.loading) return
this.param.page = this.param.page + 1
this.loading = true
this.getList()
},
methods: {
...mapActions(['getUserInfo']),
async initIndex() {
await this.getList()
},
initRefresh() {
this.param.page = 1
this.initIndex()
},
async getList() {
let {
list: oldList,
param,
} = this
let newList = await this.$api.mine.cardList(param);
if (this.param.page == 1) {
this.list = newList
} else {
newList.data = oldList.data.concat(newList.data)
this.list = newList
}
this.loading = false
this.$util.hideAll()
},
checkInput(e, key) {
let val = this.$util.formatMoney(e.detail.value)
this.$nextTick(() => {
this[key] = val
})
},
toChangeItem(key, val) {
this[key] = val
if (key === 'payInd') return
this.$refs.choose_item.open()
this.lockTap = false
},
//表单验证
validate(param) {
let validate = new this.$util.Validate();
validate.add(param.price, {
name: "price",
checkType: "isMoney",
errorMsg: "请输入充值金额"
});
let message = validate.start();
return message;
},
// 去支付
async toPay() {
let {
chooseInd,
price
} = this
let param = {}
if (chooseInd == 'price') {
param = {
price
}
let msg = this.validate(param);
if (msg) {
this.$util.showToast({
title: msg
});
return;
}
} else {
let {
id: card_id,
} = this.list.data[chooseInd]
param = {
card_id
}
}
let {
id: pay_model
} = this.payList[this.payInd]
param.pay_model = pay_model
if (this.lockTap) return;
this.lockTap = true;
this.$util.showLoading()
try {
let {
pay_list
} = await this.$api.mine.payBalanceOrder(param)
this.$util.hideAll()
if (pay_list) {
if (param.pay_model == 3) {
pay_list = {
orderInfo: pay_list,
provider: 'alipay'
}
}
try {
console.log(pay_list, "========pay_listpay_listpay_listpay_list")
await this.$util.pay(pay_list)
this.lockTap = false;
this.price = ''
this.$refs.choose_item.close()
this.getUserInfo()
this.$util.back()
let url = `/mine/pages/stored/record`
this.$util.goUrl({
url
})
} catch (e) {
this.lockTap = false;
this.price = ''
return;
}
}
} catch (e) {
setTimeout(() => {
this.lockTap = false
this.price = ''
this.$util.hideAll()
}, 2000)
}
},
}
}
</script>
<style lang="scss">
.mine-balance-list {
.count-info {
height: 338rpx;
.price {
font-size: 70rpx;
}
}
.input-item {
overflow: hidden;
background: #F9F9F9;
.stored-btn {
width: 134rpx;
height: 88rpx;
}
}
.stored-btn {
width: 132rpx;
height: 58rpx;
}
.popup-choose-item {
.icon-add-circle {
font-size: 50rpx;
}
.pay-item {
.iconfont {
font-size: 50rpx;
}
}
.pay-icon {
font-size: 40rpx;
}
.pay-btn {
width: 500rpx;
height: 88rpx;
margin: 0 auto;
}
}
}
</style>

View File

@@ -0,0 +1,295 @@
<template>
<view class="mine-stored-record">
<fixed>
<view class="fill-base b-1px-b">
<view class="pl-lg pr-lg">
<view class="space-lg"></view>
<uni-segmented-control :current="typeInd" :values="typeList"
@clickItem="handerTabChange($event,'typeInd')" style-type="button" :active-color="primaryColor">
</uni-segmented-control>
</view>
<tab @change="handerTabChange($event,'activeIndex')" :list="tabList"
:lockTap="activeIndex==2&&tabList[2].start_time&&tabList[2].end_time ? false : true"
:activeIndex="activeIndex" :activeColor="primaryColor" :width="100/tabList.length + '%'"
height="100rpx"></tab>
</view>
</fixed>
<view class="fill-base pd-lg b-1px-b" v-for="(item,index) in list.data" :key="index">
<view class="flex-between">
<view class="max-446 ellipsis">{{typeType[item.type]}}</view>
<view class="text-bold" :style="{color:primaryColor}">{{item.add?'+':'-'}} {{item.price}}</view>
</view>
<view class="flex-between f-caption c-desc mt-sm">
<view class="c-caption">{{item.create_time}}</view>
<view>余额{{item.after_balance}}</view>
</view>
</view>
<load-more :noMore="list.current_page>=list.last_page&&list.data.length>0" :loading="loading" v-if="loading">
</load-more>
<abnor v-if="!loading&&list.data.length<=0&&list.current_page==1"></abnor>
<view class="space-footer"></view>
<uni-popup ref="show_choose_time" type="top" :custom="true" :maskClick="false">
<view style="height: 184rpx;"></view>
<view class="popup-choose-time fill-base f-paragraph c-desc pt-lg pb-lg radius-bottom-34">
<view class="time-item flex-center pt-lg">
<view @tap.stop="toShowTime('start_time')" class="item-child flex-center flex-column">
<view>开始时间</view>
<view class="mt-sm" :style="{color:tabList[2].start_time ? primaryColor : '#999'}">
{{tabList[2].start_time || '选择时间'}}
</view>
</view>
<view @tap.stop="toShowTime('end_time')" class="item-child flex-center flex-column b-1px-l">
<view>结束时间</view>
<view class="mt-sm" :style="{color:tabList[2].end_time ? primaryColor : '#999'}">
{{tabList[2].end_time || '选择时间'}}
</view>
</view>
</view>
<view class="button-item flex-center">
<view @tap.stop="toConfirm(1)" class="item-child disabled flex-center"> 取消 </view>
<view @tap.stop="toConfirm(2)" class="item-child flex-center"
:style="{background: primaryColor,color:'#fff'}"> 确定
</view>
</view>
</view>
</uni-popup>
<w-picker mode="date" :startYear="startYear" :endYear="endYear" :value="tabList[0].end_time" :current="false"
fields="day" @confirm="onConfirm($event)" :disabled-after="false" ref="day" :themeColor="primaryColor"
:visible.sync="showDate">
</w-picker>
</view>
</template>
<script>
import {
mapState,
} from "vuex"
import uniSegmentedControl from "@/components/uni-segmented-control.vue"
import wPicker from "@/components/w-picker/w-picker.vue";
export default {
components: {
uniSegmentedControl,
wPicker
},
data() {
return {
startYear: '',
endYear: '',
showKey: '',
showDate: false,
typeType: {
1: '购买储值卡',
2: '认养订单',
3: '认养配送订单',
4: '配送订单退款',
5: '养殖订单',
6: '土地订单',
7: '商城交易支付',
8: '提现',
9: '土地配送订单',
10: '商城订单退款',
11: '商城交易收入',
12: '拒绝提现',
13: '认养订单退款',
14: '',
15: ''
},
typeList: [{
id: 1,
title: '收入记录'
}, {
id: 0,
title: '支出记录'
}],
typeInd: 0,
activeIndex: 0,
tabList: [{
id: 1,
title: '本周',
start_time: '',
end_time: ''
}, {
id: 2,
title: '本月',
start_time: '',
end_time: ''
}, {
id: 3,
title: '自定义',
start_time: '',
end_time: ''
}],
preTime: {
start_time: '',
end_time: ''
},
param: {
page: 1,
start_time: '',
end_time: ''
},
list: {
data: []
},
loading: true,
lockTap: false
}
},
computed: mapState({
primaryColor: state => state.config.configInfo.primaryColor,
subColor: state => state.config.configInfo.subColor,
}),
onLoad() {
this.$util.showLoading()
this.initIndex()
},
onPullDownRefresh() {
// #ifndef APP-PLUS
uni.showNavigationBarLoading()
// #endif
this.initRefresh()
uni.stopPullDownRefresh()
},
onReachBottom() {
if (this.list.current_page >= this.list.last_page || this.loading) return
this.param.page = this.param.page + 1
this.loading = true
this.getList()
},
methods: {
initIndex() {
let cur_time = new Date(Math.ceil(new Date().getTime()))
const currentDate = new Date()
//返回date是一周中的某一天
const week = currentDate.getDay()
//一天的毫秒数
const millisecond = 1000 * 60 * 60 * 24
//减去的天数
const minusDay = week != 0 ? week - 1 : 6
//本周 周一
const monday = new Date(currentDate.getTime() - minusDay * millisecond)
//本周 周日
const sunday = new Date(monday.getTime() + 6 * millisecond)
this.tabList[0].start_time = this.$util.formatTime(monday, 'YY-M-D')
this.tabList[0].end_time = this.$util.formatTime(sunday, 'YY-M-D')
this.tabList[1].start_time = this.$util.formatTime(cur_time, 'YY-M') + '-01'
this.tabList[1].end_time = this.$util.formatTime(cur_time, 'YY-M-D')
let year = this.$util.formatTime(cur_time, 'YY') * 1
this.startYear = year - 5
this.endYear = year
this.getList()
},
initRefresh() {
this.param.page = 1
this.initIndex()
},
async getList() {
let {
list: oldList,
activeIndex,
tabList,
typeInd,
typeList,
} = this
let {
start_time,
end_time
} = tabList[activeIndex]
let param = this.$util.deepCopy(this.param)
param.add = typeList[typeInd].id
param.start_time = this.$util.DateToUnix(start_time)
param.end_time = this.$util.DateToUnix(end_time) + 24 * 3600 - 1
let newList = await this.$api.mine.userConsumeWater(param);
if (this.param.page == 1) {
this.list = newList
} else {
newList.data = oldList.data.concat(newList.data)
this.list = newList
}
this.loading = false
this.$util.hideAll()
},
handerTabChange(index, key, ind = 2) {
this[key] = index;
if (key == 'activeIndex') {
let methodModel = index == ind ? 'open' : 'close'
this.$refs.show_choose_time[methodModel]()
if (index == ind) return
} else {
this.$refs.show_choose_time.close()
}
this.$util.showLoading()
this.param.page = 1
this.list.data = []
this.getList()
},
toShowTime(key, ind = 2) {
if (key == 'end_time' && !this.tabList[ind].start_time) {
this.$util.showToast({
title: `请选择开始时间`
})
return
}
this.showKey = key
this.showDate = true
},
async onConfirm(val, ind = 2) {
let {
start_time,
end_time
} = this.tabList[ind]
let {
showKey
} = this
if ((end_time && showKey == 'start_time' && this.$util.DateToUnix(end_time) < this.$util.DateToUnix(val
.result)) || (
showKey == 'end_time' && this.$util.DateToUnix(start_time) > this.$util.DateToUnix(val.result)
)) {
this.$util.showToast({
title: `结束时间不能小于开始时间`
})
return
}
this.tabList[ind][showKey] = val.result;
if (showKey == 'end_time') {
this.showDate = false
}
},
toConfirm(type, ind = 2) {
let {
start_time = '',
end_time = ''
} = type == 1 ? this.preTime : this.tabList[ind]
if (type == 1) {
this.tabList[ind].start_time = start_time
this.tabList[ind].end_time = end_time
} else {
if (!start_time || !end_time) {
this.$util.showToast({
title: !start_time ? `请选择开始时间` : `请选择结束时间`
})
return
}
this.preTime.start_time = start_time
this.preTime.end_time = end_time
}
this.activeIndex = start_time && end_time ? ind : 0
this.$refs.show_choose_time.close()
this.param.page = 1
this.getList()
}
}
}
</script>
<style lang="scss">
</style>

View File

@@ -0,0 +1,199 @@
<template>
<view class="mine-cash-out">
<uni-nav-bar :fixed="true" :shadow="false" :statusBar="true" color="#fff"
:backgroundColor="scrollTop < 20 ?``:primaryColor" leftIcon="icon-left" title="提现">
</uni-nav-bar>
<view :style="{height:`${configInfo.navBarHeight}px`}"></view>
<image mode="aspectFill" lazy-load class="common-bg abs" src="https://lbqny.migugu.com/admin/farm/bg-cash.png"></image>
<view class="flex-column mt-md ml-lg mr-lg pd-lg fill-base radius-16">
<view class="f-title c-title text-bold">备注</view>
<view class="pt-lg pb-md b-1px-b">
<input v-model="text" class="flex-1" type="text" placeholder="请输入到账信息" />
</view>
<view class="pt-lg f-title c-title text-bold">提现金额</view>
<view class="flex-between pt-lg pb-md b-1px-b">
<view class="flex-y-center">
<view class="text-bold">¥</view>
<input v-on:input="checkInput($event,'apply_price')" v-model="apply_price" class="flex-1 ml-sm"
type="digit" placeholder="请输入提现金额" />
</view>
</view>
<view class="space-lg"></view>
<view @tap.stop="withAll" class="flex-y-baseline f-caption c-caption">可提现金额{{cash}}
<view class="text-bold c-warning ml-md">
全部提现</view>
</view>
<view class="flex-y-baseline f-caption c-caption">最低提现金额<view class="text-bold c-warning ml-md">
¥{{configInfo.cash_mini || 0}}</view>
</view>
<view class="space-lg"></view>
<view class="space-lg"></view>
<view @tap.stop="submit" class="cash-out-btn flex-center f-title c-base radius-16"
:style="{background:primaryColor}">提现</view>
<view class="flex-center f-caption c-caption mt-md" v-if="options.type != 'distribution' && isLoad">
每笔订单收取{{100-configInfo.cash_balance*1}}%手续费</view>
</view>
<view class="space-footer"></view>
</view>
</template>
<script>
import {
mapState,
mapActions
} from "vuex"
export default {
components: {},
data() {
return {
options: {},
isLoad: false,
scrollTop: 0,
cash: '',
apply_price: '',
text: '',
lockTap: false
}
},
computed: mapState({
primaryColor: state => state.config.configInfo.primaryColor,
subColor: state => state.config.configInfo.subColor,
configInfo: state => state.config.configInfo,
userInfo: state => state.user.userInfo,
mineInfo: state => state.user.mineInfo,
}),
onLoad(options) {
this.$util.showLoading()
this.options = options
this.initIndex()
},
onPageScroll(e) {
this.scrollTop = e.scrollTop
},
methods: {
...mapActions(['getConfigInfo']),
async initIndex() {
await this.getConfigInfo()
let {
type
} = this.options
// type farmer 农场主business 店主distribution 分销商
switch (type) {
case 'farmer':
let {
cash
} = await this.$api.farmer.farmerFinanceInfo()
this.cash = cash
break
case 'business':
this.cash = this.mineInfo.wallet_cash
break
case 'distribution':
this.cash = this.mineInfo.fx_cash
break
}
this.$util.hideAll()
this.isLoad = true
},
initRefresh() {
this.initIndex()
},
withAll() {
this.apply_price = this.cash
},
checkInput(e, key) {
let val = this.$util.formatMoney(e.detail.value)
this.$nextTick(() => {
this[key] = val
})
},
async submit() {
if (this.apply_price == '0.0') {
this.$nextTick(() => {
this.apply_price = '0'
})
}
let {
apply_price,
text,
} = this
let {
cash_mini
} = this.configInfo
let {
cash
} = this
text = text ? text.replace(/(^\s*)|(\s*$)/g, "") : ''
if (!text || !apply_price) {
this.$util.showToast({
title: !text ? `请输入到账信息` : `请输入提现金额`
})
return
}
if (parseFloat(apply_price) < parseFloat(cash_mini)) {
this.$util.showToast({
title: `提现金额不能低于最低提现金额${cash_mini}`
})
return
}
if (parseFloat(apply_price) > parseFloat(cash)) {
this.$util.showToast({
title: `提现金额不能大于可提现金额${cash}`
})
return
}
if (this.lockTap) return
this.lockTap = true
this.$util.showLoading()
try {
let {
type: methodModel
} = this.options
if (methodModel === 'distribution') {
methodModel = 'mine'
}
await this.$api[methodModel].applyWallet({
apply_price,
text
})
this.$util.hideAll()
this.$util.showToast({
title: `提交成功`
});
setTimeout(() => {
this.$util.back()
this.$util.goUrl({
url: 1,
openType: 'navigateBack'
})
}, 1000)
} catch (e) {
this.lockTap = false
this.$util.hideAll()
}
}
}
}
</script>
<style lang="scss">
.mine-cash-out {
.can-out-money {
font-size: 50rpx;
line-height: 70rpx;
.money {
font-size: 70rpx;
}
}
.cash-out-btn {
width: 622rpx;
height: 88rpx;
margin: 0 auto;
}
}
</style>

View File

@@ -0,0 +1,163 @@
<template>
<view class="mine-choose-time" v-if="isLoad">
<scroll-view class="scroll-left fill-base" scroll-y :scroll-into-view="scrollNav" :scroll-with-animation="true"
v-if="sendDay.length> 0">
<block v-for="(item,index) in sendDay" :key="index">
<view @tap="onChangeNav(index,1)" :id="`scrollNav${index}`"
class="item-child flex-center f-paragraph c-title" :class="[{'active':index==scrollInd}]"
:style="{color: index == scrollInd ? primaryColor: ''}">
<view class="flex-center child ellipsis"
:style="{borderLeft: index == scrollInd ? `5rpx solid ${primaryColor}`:''}">
{{`${item.date} (${item.week})`}}
</view>
</view>
</block>
</scroll-view>
<view class="scroll-right abs fill-base pl-lg" v-if="sendTime.length > 0">
<view @tap="onChangeNav(index,2)" class="item-child flex-center f-paragraph c-paragraph"
style="padding-right: 25rpx;" :style="{color: index == checkInd ? primaryColor: ''}"
v-for="(item,index) in sendTime" :key="index">
<view class="flex-1" :class="[{'text-delete': item.status != 1}]">
{{item.time_text}}
</view>
<i class="iconfont icon-xuanze-fill" v-if="index == checkInd"></i>
</view>
<view class="mg-lg">
<abnor v-if="!loading&&sendTime.length<=0"></abnor>
</view>
</view>
<abnor v-if="!loading&&sendDay.length<=0"></abnor>
</view>
</template>
<script>
import {
mapState,
mapActions
} from 'vuex';
export default {
data() {
return {
isLoad: false,
options: {},
today_time: '',
sendDay: [],
sendTime: [],
loading: false,
scrollNav: 'scrollNav0',
scrollInd: 0,
checkInd: -1
}
},
computed: mapState({
commonOptions: state => state.user.commonOptions,
primaryColor: state => state.config.configInfo.primaryColor,
subColor: state => state.config.configInfo.subColor,
}),
onLoad(options) {
let {
index = '-1'
} = options
if (index && index.includes('_')) {
let arr = index.split('_')
this.scrollInd = arr[0]
this.checkInd = arr[1]
}
this.options = options
this.$util.showLoading()
this.initIndex()
},
methods: {
async initIndex(type = 0) {
let cur_time = new Date().getTime()
this.today_time = this.$util.DateToUnix(this.$util.formatTime(cur_time, 'YY-M-D h:m'))
let {
time = [],
date = []
} = await this.$api.claim.sendTime()
if (date.length > 0) {
let {
date: cur_day
} = date[type]
time.map(item => {
item.time_text = `${item.start_time} ~ ${item.end_time}`
item.end_time_unix = this.$util.DateToUnix(`${cur_day} ${item.end_time}`)
item.status = item.end_time_unix < this.today_time ? 0 : 1
})
}
this.sendDay = date
this.sendTime = time
this.loading = false
this.isLoad = true
this.$util.hideAll()
},
async initRefresh() {
this.initIndex()
},
async onChangeNav(index, type = 1) {
let key = type == 1 ? 'sendDay' : 'sendTime'
if (type == 1) {
this.checkInd = this.scrollInd == index ? this.checkInd : -1
this.scrollInd = index
this.scrollNav = `scrollNav${index}`
await this.initIndex(index)
} else {
let {
status,
} = this[key][index]
if (status != 1) return
this.checkInd = index
let item = this[key][index]
let {
date
} = this.sendDay[this.scrollInd]
item.date = date
let send_info = {
time_index: `${this.scrollInd}_${index}`,
time: item
}
this.$util.getPage(-1).send_info = send_info
this.$util.goUrl({
url: 1,
openType: 'navigateBack'
})
}
},
},
}
</script>
<style lang="scss">
.mine-choose-time {
.scroll-left {
width: 260rpx;
height: 100vh;
position: fixed;
top: 0;
bottom: 0;
}
.item-child {
height: 98rpx;
}
.item-child.active {
background: #F9F9F9;
}
.item-child .child {
width: 100%;
height: 32rpx;
padding: 0 5%;
}
.scroll-right {
min-height: 100vh;
top: 0;
width: 460rpx;
margin-left: 292rpx;
}
}
</style>

View File

@@ -0,0 +1,72 @@
<template>
<view class="video-box" :style="{paddingBottom: number}">
<video class="my-video" object-fit="fill" preload="meta" :src="url" @play="play" @pause="pause" @ended="ended"
@waiting="waitingCallback" @error="errorCallback" @loadedmetadata="loadedmetadata" autoplay="true"
controls></video>
</view>
</template>
<script>
import {
mapState,
mapActions
} from 'vuex';
export default {
data() {
return {
url: '',
number: '',
}
},
async onLoad(options) {
let url = decodeURIComponent(options.url)
this.url = url
},
methods: {
play(e) {
this.$util.log("play=> ", e);
},
pause(e) {
this.$util.log("pause=> ", e);
},
ended(e) {
this.$util.log("ended=> ", e);
},
waitingCallback(e) {
this.$util.log("waitingCallback=> ", e);
},
errorCallback(e) {
this.$util.log("errorCallback=> ", e);
},
loadedmetadata(e) {
this.$util.log("loadedmetadata=> ", e);
let {
width,
height
} = e.detail;
let num = ((height / width) * 100).toFixed(2)
this.number = num ? `${num}%` : `56.25%`
}
}
}
</script>
<style>
.video-box {
position: relative;
width: 100%;
height: 0;
/* padding-bottom: 56.25%; */
/*用 9/16 得出,其他比例类似*/
}
.my-video {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
align-items: center;
}
</style>

View File

@@ -0,0 +1,27 @@
<template>
<view>
<web-view :src="url"></web-view>
</view>
</template>
<script>
import {
mapState,
} from 'vuex';
export default {
data() {
return {
url: ''
}
},
async onLoad(options) {
let {
url
} = options;
this.url = decodeURIComponent(url);
}
}
</script>
<style lang="scss">
</style>

View File

@@ -0,0 +1,252 @@
<template>
<view class="mine-coupon-list">
<fixed>
<tab @change="handerTabChange" :list="tabList" :activeIndex="activeIndex" :activeColor="primaryColor"
:width="100/tabList.length + '%'" height="100rpx"></tab>
<view class="b-1px-b"></view>
</fixed>
<view class="list-item fill-base mg-big pd-lg radius-34" v-for="(item,index) in list.data" :key="index">
<view class="flex-between">
<view class="flex-center flex-column">
<view class="flex-y-baseline f-caption c-warning">¥<view class="f-lg-title">{{item.discount}}
</view>
</view>
<view class="f-caption c-title">优惠券</view>
</view>
<view class="flex-1 ml-lg flex-between">
<view class="f-title c-title mr-lg">
<view class="text-bold">{{item.title}}</view>
<view class="f-icontext mt-sm">{{item.type==0?`${item.full}元可用`:'无门槛'}}</view>
<view @tap.stop="this.list.data[index].is_show = !this.list.data[index].is_show"
class="flex-y-baseline f-icontext mt-sm">查看详情
<i class="iconfont ml-sm" style="font-size: 24rpx"
:class="[{'icon-down':!item.is_show},{'icon-up':item.is_show}]"></i>
</view>
</view>
<view @tap.stop="goDetail(index)" class="use-btn flex-center f-caption c-base radius"
:style="{background:activeIndex==0?primaryColor:activeIndex==1?'#aaa':'#F1381F'}">
{{statusType[item.status]}}
</view>
</view>
</view>
<view class="mt-lg pd-lg f-icontext c-title radius-16" style="background: #F9FAF9" v-if="item.is_show">
<view class="flex-warp">
<view>卡券数量</view>
<view class="flex-1 c-desc">x{{item.num}}</view>
</view>
<view class="flex-warp mt-md">
<view>使用时间</view>
<view class="flex-1 c-desc">{{activeIndex==1?item.use_time : item.start_time}}</view>
</view>
<view class="flex-warp mt-md">
<view>使用范围</view>
<view class="flex-1 c-desc">{{item.use_range}}</view>
</view>
<view class="flex-warp mt-md">
<view>使用规则</view>
<view class="flex-1 c-desc">
<text decode="emsp" style="word-break:break-all;">{{item.rule}}</text>
</view>
</view>
<view class="flex-warp mt-md">
<view>优惠详情</view>
<view class="flex-1 c-desc">
<text decode="emsp" style="word-break:break-all;">{{item.text}}</text>
</view>
</view>
</view>
</view>
<load-more :noMore="list.current_page>=list.last_page&&list.data.length>0" :loading="loading" v-if="loading">
</load-more>
<abnor type="COUPON" v-if="!loading&&list.data.length<=0&&list.current_page==1"></abnor>
<view class="space-footer"></view>
</view>
</template>
<script>
import {
mapState,
} from "vuex"
export default {
components: {},
data() {
return {
options: {},
activeIndex: 0,
tabList: [{
title: '待使用',
id: 1
}, {
title: '已使用',
id: 2,
}, {
title: '已过期',
id: 3
}],
statusType: {
1: '去使用',
2: '已使用',
3: '删除',
},
useType: {
is_land: '土地租赁',
is_claim: '认养服务',
is_shop: '商城',
},
param: {
page: 1,
},
list: {
data: []
},
loading: true,
lockTap: false
}
},
computed: mapState({
primaryColor: state => state.config.configInfo.primaryColor,
subColor: state => state.config.configInfo.subColor,
userInfo: state => state.user.userInfo,
}),
onLoad(options) {
this.$util.showLoading()
this.options = options
let {
tab = 0
} = options
this.activeIndex = tab
this.initIndex()
},
onPullDownRefresh() {
// #ifndef APP-PLUS
uni.showNavigationBarLoading()
// #endif
this.initRefresh()
uni.stopPullDownRefresh()
},
onReachBottom() {
if (this.list.current_page >= this.list.last_page || this.loading) return
this.param.page = this.param.page + 1
this.loading = true
this.getList()
},
methods: {
initIndex() {
this.getList()
},
initRefresh() {
this.param.page = 1
this.initIndex()
},
async getList() {
let {
list: oldList,
param,
useType,
tabList,
activeIndex
} = this
param.status = tabList[activeIndex].id
let newList = await this.$api.mine.userCouponList(param);
newList.data.map(item => {
item.is_show = false
let use_range = ''
for (let key in useType) {
if (item[key]) {
use_range += `${useType[key]}`
}
}
item.use_range = use_range.substring(0, use_range.length - 1)
})
if (this.param.page == 1) {
this.list = newList
} else {
newList.data = oldList.data.concat(newList.data)
this.list = newList
}
this.loading = false
this.$util.hideAll()
},
handerTabChange(index) {
this.activeIndex = index
this.$util.showLoading()
this.param.page = 1
this.list.data = []
this.getList()
},
async goDetail(index) {
let {
activeIndex
} = this
switch (activeIndex) {
case 0:
let {
goods, shop_goods
} = this.list.data[index]
let url = goods.length > 0 ? `/pages/service` : shop_goods.length > 0 ? `/pages/shop` :
`/pages/restaurant`
this.$util.goUrl({
url,
openType: 'switchTab'
})
break;
case 1:
break;
case 2:
let {
id: coupon_id
} = this.list.data[index]
if (this.lockTap) return
this.lockTap = true
this.$util.showLoading()
try {
await this.$api.mine.couponDel({
coupon_id
})
this.$util.hideAll()
this.$util.showToast({
title: `删除成功`
})
this.list.data.splice(index, 1)
this.lockTap = false
} catch (e) {
setTimeout(() => {
this.lockTap = false
this.$util.hideAll()
}, 2000)
}
break;
}
}
}
}
</script>
<style lang="scss">
.mine-coupon-list {
.list-item {
overflow: hidden;
.item-title {
top: 0;
left: 0;
height: 50rpx;
background: #FFE2E2;
border-radius: 15rpx 0 15rpx 0;
}
.use-btn {
min-width: 120rpx;
height: 58rpx;
}
}
}
</style>

View File

@@ -0,0 +1,217 @@
<template>
<view class="mine-coupon-use">
<view class="list-item fill-base mg-big pd-lg radius-34" v-for="(item,index) in list.data" :key="index">
<view class="flex-between">
<view class="flex-center flex-column">
<view class="flex-y-baseline f-caption c-warning">¥<view class="f-lg-title">{{item.discount}}
</view>
</view>
<view class="f-caption c-title">优惠券</view>
</view>
<view class="flex-1 ml-lg flex-between">
<view class="f-title c-title mr-lg">
<view class="text-bold">{{item.title}}</view>
<view class="f-icontext mt-sm">{{item.type==0?`${item.full}元可用`:'无门槛'}}</view>
<view @tap.stop="this.list.data[index].is_show = !this.list.data[index].is_show"
class="flex-y-baseline f-icontext mt-sm">查看详情
<i class="iconfont ml-sm" style="font-size: 24rpx;"
:class="[{'icon-down':!item.is_show},{'icon-up':item.is_show}]"></i>
</view>
</view>
<view @tap.stop="toUse(index)" class="use-btn flex-center f-caption c-base radius"
:style="{background:primaryColor}">
去使用
</view>
</view>
</view>
<view class="mt-lg pd-lg f-icontext c-title radius-16" style="background: #F9FAF9" v-if="item.is_show">
<view class="flex-warp">
<view>卡券数量</view>
<view class="flex-1 c-desc">x{{item.num}}</view>
</view>
<view class="flex-warp mt-md">
<view>使用时间</view>
<view class="flex-1 c-desc">{{item.start_time}}</view>
</view>
<view class="flex-warp mt-md">
<view>使用范围</view>
<view class="flex-1 c-desc">{{item.use_range}}</view>
</view>
<view class="flex-warp mt-md">
<view>使用规则</view>
<view class="flex-1 c-desc">
<text decode="emsp" style="word-break:break-all;">{{item.rule}}</text>
</view>
</view>
<view class="flex-warp mt-md">
<view>优惠详情</view>
<view class="flex-1 c-desc">
<text decode="emsp" style="word-break:break-all;">{{item.text}}</text>
</view>
</view>
</view>
</view>
<load-more :noMore="list.current_page>=list.last_page&&list.data.length>0" :loading="loading" v-if="loading">
</load-more>
<abnor type="COUPON" v-if="!loading&&list.data.length<=0&&list.current_page==1"></abnor>
<view class="space-max-footer"></view>
<fix-bottom-button @confirm="noUse" :text="[{type:'confirm',text:'不使用卡券'}]">
</fix-bottom-button>
</view>
</template>
<script>
import {
mapState,
} from "vuex"
export default {
components: {},
data() {
return {
options: {},
useType: {
is_land: '土地租赁',
is_claim: '认养服务',
is_shop: '商城',
},
param: {
page: 1,
},
list: {
data: []
},
loading: true,
lockTap: false
}
},
computed: mapState({
primaryColor: state => state.config.configInfo.primaryColor,
subColor: state => state.config.configInfo.subColor,
userInfo: state => state.user.userInfo,
orderInfo: state => state.order.orderInfo,
}),
onLoad(options) {
this.options = options
this.$util.showLoading()
this.initIndex()
},
onPullDownRefresh() {
// #ifndef APP-PLUS
uni.showNavigationBarLoading()
// #endif
this.initRefresh();
uni.stopPullDownRefresh()
},
onReachBottom() {
if (this.list.current_page >= this.list.last_page || this.loading) return
this.param.page = this.param.page + 1
this.loading = true
this.getList()
},
methods: {
initIndex() {
this.getList()
},
initRefresh() {
this.param.page = 1
this.initIndex()
},
async getList() {
let {
list: oldList,
useType
} = this
let {
type = 1
} = this.options
let land_param = type == 1 ? this.$util.pick(this.orderInfo, ['land_id', 'spe_id', 'cycle',
'massif_id',
'seed_data'
]) : {}
let param = Object.assign({}, this.param, this.options, land_param)
let method = {
1: 'land',
2: 'claim',
3: 'shop'
}
delete param.type
let newList = await this.$api[method[type]].canUseCouponList(param)
newList.data.map(item => {
item.is_show = false
let use_range = ''
for (let key in useType) {
if (item[key]) {
use_range += `${useType[key]}`
}
}
item.use_range = use_range.substring(0, use_range.length - 1)
})
if (this.param.page == 1) {
this.list = newList
} else {
newList.data = oldList.data.concat(newList.data)
this.list = newList
}
this.loading = false
this.$util.hideAll()
},
toUse(index) {
if (this.lockTap) return
this.lockTap = true
try {
let {
id
} = this.list.data[index]
this.$util.getPage(-1).orderInfo.coupon_id = id
this.$util.back()
setTimeout(() => {
this.$util.goUrl({
url: 1,
openType: 'navigateBack'
})
}, 500)
} catch (e) {
setTimeout(() => {
this.lockTap = false
}, 2000)
}
},
noUse() {
this.$util.getPage(-1).orderInfo.coupon_id = 0
this.$util.back()
setTimeout(() => {
this.$util.goUrl({
url: 1,
openType: 'navigateBack'
})
}, 500)
}
}
}
</script>
<style lang="scss">
.mine-coupon-use {
.list-item {
overflow: hidden;
.item-title {
top: 0;
left: 0;
height: 50rpx;
background: #FFE2E2;
border-radius: 15rpx 0 15rpx 0;
}
.use-btn {
min-width: 120rpx;
height: 58rpx;
}
}
}
</style>

View File

@@ -0,0 +1,170 @@
<template>
<view class="mine-distribution-index">
<uni-nav-bar :fixed="true" :shadow="false" :statusBar="true" :color="color"
:backgroundColor="color == '#ffffff' ?``:primaryColor" title="分销申请" leftIcon="icon-left">
</uni-nav-bar>
<view mode="aspectFill" lazy-load class="mine-index-bg abs"></view>
<view class="space-user-info rel"></view>
<view class="apply-info ml-lg mr-lg fill-base f-title radius-24">
<view class="flex-center f-md-title text-bold c-black">申请成为分销商</view>
<view class="space-lg"></view>
<view class="pt-lg pb-md b-1px-b">
<view class="flex-y-center">
<i class="iconfont icon-required c-warning"></i>
<view class="text-bold">姓名</view>
</view>
<input v-model="subForm.user_name" type="text" class="pt-md" maxlength="20"
placeholder-class="c-placeholder" :placeholder="rule[0].errorMsg" />
</view>
<view class="mt-lg pb-md b-1px-b">
<view class="flex-y-center">
<i class="iconfont icon-required c-warning"></i>
<view class="text-bold">手机号</view>
</view>
<input v-model="subForm.mobile" type="number" class="pt-md" maxlength="20"
placeholder-class="c-placeholder" :placeholder="rule[1].errorMsg" />
</view>
<view @tap="submit" class="apply-btn flex-center f-sm-title c-base text-bold radius-16"
:style="{background:primaryColor}">立即申请</view>
</view>
<view class="space-footer"></view>
</view>
</template>
<script>
import {
mapState,
mapActions,
} from "vuex"
export default {
components: {},
data() {
return {
options: {},
color: '#ffffff',
subForm: {
user_name: '',
mobile: ''
},
rule: [{
name: "user_name",
checkType: "isNotNull",
errorMsg: "请输入您的真实姓名",
regType: 2
}, {
name: "mobile",
checkType: "isAllPhone",
errorMsg: "请输入手机号",
regText: "手机号"
}],
lockTap: false
}
},
computed: mapState({
primaryColor: state => state.config.configInfo.primaryColor,
subColor: state => state.config.configInfo.subColor,
configInfo: state => state.config.configInfo,
userInfo: state => state.user.userInfo,
mineInfo: state => state.user.mineInfo,
}),
onLoad(options) {
this.options = options
},
onPullDownRefresh() {
// #ifndef APP-PLUS
uni.showNavigationBarLoading()
// #endif
this.initRefresh()
uni.stopPullDownRefresh()
},
onPageScroll(e) {
let color = e.scrollTop < 20 ? '#ffffff' : '#000000'
if (this.color == color) return
this.color = color
this.$util.setNavigationBarColor({
color,
bg: 'none'
});
},
methods: {
...mapActions(['getConfigInfo', 'getUserInfo', 'getMineInfo', 'getAuthUserProfile']),
async initIndex() {},
initRefresh() {
this.initIndex()
},
//表单验证
validate(param) {
let validate = new this.$util.Validate();
this.rule.map(item => {
let {
name,
} = item
validate.add(param[name], item);
})
let message = validate.start();
console.log(message, "message");
return message;
},
async submit() {
let param = this.$util.deepCopy(this.subForm)
let msg = this.validate(param);
if (msg) {
this.$util.showToast({
title: msg
})
return
}
if (this.lockTap) return
this.lockTap = true
this.$util.showLoading()
try {
await this.$api.mine.applyReseller(param)
this.$util.hideAll()
this.$util.showToast({
title: `提交成功`
});
this.lockTap = false
this.$util.goUrl({
url: `/mine/pages/apply-result?type=2`,
openType: `redirectTo`
})
} catch (e) {
setTimeout(() => {
this.lockTap = false
this.$util.hideAll()
}, 2000)
}
},
}
}
</script>
<style lang="scss">
.mine-distribution-index {
.space-user-info {
top: 0;
left: 0;
width: 100%;
height: 219rpx;
}
.mine-index-bg {
background: rgb(57, 181, 74);
height: 14.625rem;
width: 140%;
left: -20%;
top: 0;
z-index: -1;
}
.apply-info {
padding: 50rpx;
.apply-btn {
width: 590rpx;
height: 96rpx;
margin-top: 70rpx;
}
}
}
</style>

View File

@@ -0,0 +1,241 @@
<template>
<view class="mine-distribution-index" v-if="detail.id">
<uni-nav-bar :fixed="true" :shadow="false" :statusBar="true" :color="color"
:backgroundColor="color == '#ffffff' ?``:primaryColor" title="分销中心" leftIcon="icon-left">
</uni-nav-bar>
<view mode="aspectFill" lazy-load class="mine-index-bg abs"></view>
<view class="user-info abs pt-md pl-lg pr-lg pb-lg flex-center">
<image mode="aspectFill" lazy-load class="user-img radius" :src="detail.avatarUrl">
</image>
<view class="flex-1 ml-md c-base">
<view class="f-lg-title text-bold max-550 ellipsis">
Hi{{ detail.nickName }}
</view>
<view @tap.top="$util.goUrl({url:detail.fx_code,openType:'copy'})" class="flex-y-center f-caption">邀请码:
{{detail.fx_code}}
<view class="copy-code-btn flex-center f-icontext ml-sm">复制</view>
</view>
</view>
</view>
<view class="space-user-info rel"></view>
<!-- fx_cash 可提现wallet_price 已提现 -->
<view @tap.stop="$util.goUrl({url:`/mine/pages/cash-out?type=distribution`})"
class="stored-item pd-lg ml-md mr-md fill-base box-shadow radius-20">
<view class="flex-center">
<view class="flex-center flex-column c-title">
<view class="f-lg-title text-bold">{{detail.fx_cash}}</view>
<view class="f-caption c-caption">总佣金</view>
</view>
<view class="line"></view>
<view class="flex-center flex-column c-title">
<view class="f-lg-title text-bold">{{detail.notreceived_cash}}</view>
<view class="f-caption c-caption">待结算</view>
</view>
</view>
<view class="flex-center pt-lg pb-sm">
<view class="common-btn flex-center f-paragraph c-base radius" style="min-width: 176rpx;height: 60rpx;"
:style="{background:primaryColor}">立即提现
</view>
</view>
</view>
<view class="mine-list mt-md ml-md mr-md fill-base box-shadow radius-20">
<view class="common-nav-title flex-y-center f-title c-title text-bold">我的收益</view>
<view class="flex-warp pb-md">
<auth :needAuth="userInfo && !userInfo.nickName" :must="true" @go="toJump('toolList', index)"
v-for="(item, index) in toolList" :key="index" class="item-child">
<view class="flex-center flex-column f-caption c-title">
<image mode="aspectFill" lazy-load class="item-img" :src="item.img"></image>
<view>{{ item.text }}</view>
</view>
</auth>
</view>
</view>
<view class="mine-list mt-md ml-md mr-md fill-base box-shadow radius-20">
<view class="common-nav-title flex-y-center f-title c-title text-bold">其他功能</view>
<view class="flex-warp pb-md">
<auth :needAuth="userInfo && !userInfo.nickName" :must="true" @go="toJump('otherList', index)"
v-for="(item, index) in otherList" :key="index" class="item-child">
<view class="flex-center flex-column f-caption c-title">
<image mode="aspectFill" lazy-load class="item-img" :src="item.img"></image>
<view>{{ item.text }}</view>
</view>
</auth>
</view>
</view>
<view class="space-footer"></view>
</view>
</template>
<script>
import {
mapState,
mapActions,
} from "vuex"
export default {
components: {},
data() {
return {
options: {},
color: '#ffffff',
// 我的收益
toolList: [{
img: '/static/image/mine/land-order.png',
text: '土地租赁',
url: '/mine/pages/distribution/profit?type=2'
}, {
img: '/static/image/mine/claim-order.png',
text: '认养订单',
url: '/mine/pages/distribution/profit?type=3'
}, {
img: '/static/image/mine/shop.png',
text: '商城订单',
url: '/mine/pages/distribution/profit?type=1'
}, {
img: '/static/image/mine/code.png',
text: '推广码',
url: '/mine/pages/distribution/poster'
}],
// 其他功能
otherList: [{
img: '/static/image/mine/team.png',
text: '我的团队',
url: '/mine/pages/distribution/team'
}, {
img: '/static/image/mine/collage.png',
text: '提现记录',
url: '/mine/pages/distribution/record'
}],
detail: {},
}
},
computed: mapState({
primaryColor: state => state.config.configInfo.primaryColor,
subColor: state => state.config.configInfo.subColor,
configInfo: state => state.config.configInfo,
userInfo: state => state.user.userInfo,
mineInfo: state => state.user.mineInfo,
}),
onLoad() {
this.$util.showLoading()
this.initIndex()
},
onPullDownRefresh() {
// #ifndef APP-PLUS
uni.showNavigationBarLoading()
// #endif
this.initRefresh()
uni.stopPullDownRefresh()
},
onPageScroll(e) {
let color = e.scrollTop < 20 ? '#ffffff' : '#000000'
if (this.color == color) return
this.color = color
this.$util.setNavigationBarColor({
color,
bg: 'none'
});
},
methods: {
...mapActions(['getConfigInfo', 'getUserInfo', 'getMineInfo', 'getAuthUserProfile']),
async initIndex() {
this.detail = await this.$api.mine.resellerInfo()
this.$util.hideAll()
},
initRefresh() {
this.initIndex()
},
async toJump(key, index) {
let {
url,
text
} = this[key][index]
this.$util.log(url)
this.$util.goUrl({
url
})
}
}
}
</script>
<style lang="scss">
.mine-distribution-index {
.user-info {
top: 0;
left: 0;
width: 100%;
height: 416rpx;
padding-top: 198rpx;
.user-img {
width: 120rpx;
height: 120rpx;
line-height: 1rpx;
overflow: hidden;
border: 4rpx solid #EFF3FD;
transform: rotateZ(360deg);
}
.copy-code-btn {
width: 65rpx;
height: 34rpx;
border-radius: 2rpx;
border: 1rpx solid #FFFFFF;
transform: rotateZ(360deg);
}
}
.space-user-info {
top: 0;
left: 0;
width: 100%;
height: 379rpx;
z-index: -1;
}
.mine-index-bg {
background: rgb(57, 181, 74);
height: 14.625rem;
width: 140%;
left: -20%;
top: 0;
z-index: -1;
}
.stored-item {
.flex-column {
width: 50%;
}
.line {
width: 1rpx;
height: 42rpx;
background: #99D3B9;
}
}
.mine-list {
.common-nav-title {
padding-top: 20rpx;
padding-left: 54rpx;
}
.item-child {
width: 25%;
margin: 10rpx 0;
.item-img {
width: 88rpx;
height: 88rpx;
margin-bottom: 15rpx;
}
}
}
}
</style>

View File

@@ -0,0 +1,253 @@
<template>
<view class="mine-distribution-poster">
<view class="hideCanvasView">
<l-painter class="hideCanvas" ref="painter" />
</view>
<block v-if="src">
<view class="space-md fill-body"></view>
<image :src="src" class="code-img" @tap="previewImage"></image>
<view class="space-md fill-body"></view>
<view class="pd-lg">
<!-- #ifdef H5 -->
<button class="save-btn flex-center radius" :style="{background:primaryColor}"
@tap="previewImage">长按上图保存图片</button>
<!-- #endif -->
<!-- #ifdef MP-WEIXIN -->
<button class="save-btn flex-center radius" :style="{background:primaryColor}"
@tap="saveImage">保存图片至相册</button>
<!-- #endif -->
<!-- #ifdef APP-PLUS -->
<button class="save-btn flex-center radius" :style="{background:primaryColor}"
@tap="toAppShare">分享专属海报</button>
<!-- #endif -->
<view class="text f-desc mt-lg" :style="{color:primaryColor}">
<view class="flex-y-center">
<view class="radius mr-sm" :style="{background:primaryColor}"></view>好友下载app并使用你的邀请码注册成功后
</view>
<view class="flex-y-center">
<view class="radius mr-sm" :style="{background:primaryColor}"></view>TA将成为你的粉丝粉丝下单你也可以获得收益哟!
</view>
</view>
<view class="space-footer"></view>
</view>
</block>
</view>
</template>
<script>
import {
mapState,
mapActions
} from 'vuex';
import siteInfo from '@/siteinfo.js';
export default {
components: {},
props: {
},
data() {
return {
src: '',
options: '',
poster: {}
}
},
computed: mapState({
primaryColor: state => state.config.configInfo.primaryColor,
configInfo: state => state.config.configInfo,
userInfo: state => state.user.userInfo,
}),
async onLoad(options) {
this.$util.setNavigationBarColor({
color: '#000000',
bg: '#ffffff'
})
this.widget = this.$refs.canvas
this.$util.showLoading()
let that = this
setTimeout(() => {
that.canvase()
}, 1000)
},
methods: {
...mapActions(['user/report']),
async canvase() {
let that = this
let qr_code = await this.$api.mine.getAppDownloadQr()
let cover = 'https://lbqny.migugu.com/admin/farm/share.png'
let {
primaryColor
} = this
let {
fx_code,
avatarUrl
} = this.$util.getPage(-1).detail
let poster = {
css: {
width: '750rpx',
height: '1156rpx',
},
views: [{
type: 'image',
src: cover,
css: {
width: '750rpx',
height: '1156rpx',
top: '0rpx',
left: '0rpx',
position: 'absolute'
}
},
{
type: 'image',
src: avatarUrl,
css: {
position: 'absolute',
baclground: '#fff',
width: '82rpx',
height: '82rpx',
top: '407rpx',
left: '333rpx',
border: '1rpx solid #fff',
borderRadius: '50%'
}
},
{
type: 'text',
text: `邀请码`,
css: {
position: 'absolute',
width: '137rpx',
height: '30rpx',
top: '658rpx',
left: '304rpx',
textAlign: 'center',
fontSize: '26rpx',
color: primaryColor
}
},
{
type: 'text',
text: fx_code,
css: {
position: 'absolute',
width: '137rpx',
height: '30rpx',
top: '696rpx',
left: '304rpx',
textAlign: 'center',
fontSize: '26rpx',
textWeight: 'bold',
color: primaryColor
}
},
{
type: 'image',
src: qr_code,
css: {
position: 'absolute',
baclground: '#fff',
width: '148rpx',
height: '148rpx',
top: '505rpx',
left: '304rpx',
}
}
]
}
// 渲染
this.$refs.painter.render(poster);
// 生成图片
this.$refs.painter.canvasToTempFilePathSync({
fileType: "jpg",
quality: 1,
success: (res) => {
that.$util.hideAll()
this.src = res.tempFilePath
console.log(res.tempFilePath);
},
});
},
previewImage() {
let finalPath = this.src;
uni.previewImage({
current: finalPath,
urls: [finalPath]
})
},
async saveImage() {
await this.$util.checkAuth({
type: "writePhotosAlbum"
});
let filePath = this.src;
let [err, success] = await uni.saveImageToPhotosAlbum({
filePath
})
if (err) return;
uni.showToast({
icon: 'none',
title: '保存成功'
})
},
toAppShare() {
uni.share({
provider: "weixin",
scene: "WXSceneSession",
type: 0,
href: "",
title: "用心分享邀粉丝",
summary: "月入过万 收益多",
imageUrl: this.src,
success: function(res) {
console.log("success:" + JSON.stringify(res));
},
fail: function(err) {
console.log("fail:" + JSON.stringify(err));
}
});
}
},
}
</script>
<style lang="scss">
page {
background: #fff
}
.mine-distribution-poster {
.code-img {
width: 750rpx;
height: 1156rpx;
}
.save-btn {
width: 690rpx;
height: 80rpx;
line-height: 80rpx;
margin: 0 auto;
}
.text {
.radius {
width: 10rpx;
height: 10rpx;
}
}
.hideCanvasView {
position: relative;
.hideCanvas {
position: absolute;
left: -9999rpx;
top: -9999rpx
}
}
}
</style>

View File

@@ -0,0 +1,217 @@
<template>
<view class="mine-coupon-list">
<fixed>
<tab @change="handerTabChange" :list="tabList" :activeIndex="activeIndex" :activeColor="primaryColor"
:width="100/tabList.length + '%'" height="100rpx"></tab>
</fixed>
<view @tap.stop="goDetail(index)" class="fill-base mt-md ml-md mr-md pd-lg box-shadow-mini radius-16"
v-for="(item,index) in list.data" :key="index">
<view class="flex-between pb-lg">
<view @tap.stop="goStore(index)" class="flex-y-center">
<image mode="aspectFill" class="user-img radius" :src="item.source_info.avatarUrl"></image>
<view class="flex-y-center f-paragraph c-title ml-md">下单人<view class="text-bold max-300 ellipsis">
{{item.source_info.nickName}}
</view>
</view>
</view>
<view class="f-paragraph c-caption" :class="[{'c-warning': item.status==1}]">
{{statusType[item.status]}}
</view>
</view>
<view class="profit-item flex-center" :class="[{'mt-md':aindex!=0}]"
v-for="(aitem,aindex) in item.order_goods" :key="aindex">
<image mode="aspectFill" lazy-load class="cover" :src="aitem.goods_cover">
</image>
<view class="flex-1 ml-md">
<view class="f-title c-title text-bold ellipsis"> {{aitem.goods_name}} </view>
<view class="flex-between mt-sm">
<view class="goods-spe pl-sm pr-sm f-caption c-paragraph ellipsis radius-4"> {{aitem.spe_name}}
</view>
<view class="flex-1"></view>
</view>
<view class="flex-between mt-md f-caption c-caption">
<view class="flex-y-baseline">
<view class="flex-y-baseline f-icontext c-warning">¥<view class="f-sm-title text-bold">
{{aitem.singe_pay_price}}
</view>
</view>
<view class="ml-sm">提成比例 {{aitem.balance}}%</view>
</view>
<view>x {{aitem.num}} </view>
</view>
</view>
</view>
<view class="flex-between mt-lg pt-md b-1px-t">
<view class="c-title ml-sm mr-sm"> 付款 ¥{{item.order_price}}</view>
<view class="reduce-info rel flex-center pr-sm f-caption c-base" :style="{background:primaryColor}">
<view class="reduce-tag abs flex-center pr-sm f-icontext c-title">分销佣金 </view>
¥{{item.cash}}
</view>
</view>
</view>
<load-more :noMore="list.current_page>=list.last_page&&list.data.length>0" :loading="loading" v-if="loading">
</load-more>
<abnor v-if="!loading&&list.data.length<=0&&list.current_page==1"></abnor>
<view class="space-footer"></view>
</view>
</template>
<script>
import {
mapState,
} from "vuex"
export default {
components: {},
data() {
return {
options: {},
statusType: {
1: '待结算',
2: '已结算'
},
activeIndex: 0,
tabList: [{
id: 0,
title: '全部'
}, {
id: 1,
title: '待结算'
}, {
id: 2,
title: '已结算'
}],
param: {
page: 1,
},
list: {
data: []
},
loading: true,
lockTap: false
}
},
computed: mapState({
primaryColor: state => state.config.configInfo.primaryColor,
subColor: state => state.config.configInfo.subColor,
userInfo: state => state.user.userInfo,
}),
onLoad(options) {
this.$util.showLoading()
this.options = options
let {
type = 1
} = options
let title = {
1: '商城',
2: '土地',
3: '认养',
}
uni.setNavigationBarTitle({
title: `${title[type]}订单分佣`
})
this.initIndex()
},
onPullDownRefresh() {
// #ifndef APP-PLUS
uni.showNavigationBarLoading()
// #endif
this.initRefresh()
uni.stopPullDownRefresh()
},
onReachBottom() {
if (this.list.current_page >= this.list.last_page || this.loading) return
this.param.page = this.param.page + 1
this.loading = true
this.getList()
},
methods: {
initIndex() {
this.getList()
},
initRefresh() {
this.param.page = 1
this.initIndex()
},
handerTabChange(index) {
this.activeIndex = index
this.$util.showLoading()
this.param.page = 1
this.list.data = []
this.getList()
},
async getList() {
let {
list: oldList,
tabList,
activeIndex,
options
} = this
let {
type
} = options
let {
id: status
} = tabList[activeIndex]
let param = Object.assign({}, this.param, {
type,
status
})
let newList = await this.$api.mine.fxOrderList(param);
if (this.param.page == 1) {
this.list = newList
} else {
newList.data = oldList.data.concat(newList.data)
this.list = newList
}
this.loading = false
this.$util.hideAll()
},
handerTabChange(index) {
this.activeIndex = index
this.$util.showLoading()
this.param.page = 1
this.list.data = []
this.getList()
}
}
}
</script>
<style lang="scss">
.mine-coupon-list {
.user-img {
width: 44rpx;
height: 44rpx;
}
.profit-item {
.cover {
width: 172rpx;
height: 172rpx;
border-radius: 12rpx;
}
.goods-spe {
height: 44rpx;
line-height: 44rpx;
background: #F7F7F7;
}
.ellipsis {
max-width: 458rpx;
}
}
.reduce-tag {
background: #FCC519;
background: linear-gradient(-70deg, transparent 20rpx, #FCC519 0);
}
}
</style>

View File

@@ -0,0 +1,169 @@
<template>
<view class="mine-stored-record">
<fixed>
<view class="record-header flex-center flex-column c-base" :style="{background:primaryColor}">
<view class="f-caption">已累积提现金额()</view>
<view class="wallet-price">{{wallet_price}}</view>
</view>
<tab @change="handerTabChange" :list="tabList" :activeIndex="activeIndex" :activeColor="primaryColor"
:width="100/tabList.length + '%'" height="100rpx"></tab>
</fixed>
<view class="pd-lg fill-base b-1px-b flex-center" :class="[{'mt-md':index==0}]"
v-for="(item,index) in list.data" :key="index">
<view class="record radius"
:style="{backgroundColor:item.status==1?primaryColor:item.status==2?subColor:'#f86c53'}"></view>
<view class="f-title c-title flex-1 ml-md">
<view class="flex-y-center">
<view>{{statusType[item.status]}}</view>
<view class="record-tag ml-sm" v-if="item.status==1"
@tap="$util.goUrl({url:item.order_code,openType:'copy'})">复制提现编号</view>
</view>
<view class="f-caption c-caption">{{item.create_time_text}}</view>
</view>
<view class="text-bold f-title c-title">-{{item.pay_price}}</view>
</view>
<load-more :noMore="list.current_page>=list.last_page&&list.data.length>0" :loading="loading" v-if="loading">
</load-more>
<abnor v-if="!loading&&list.data.length<=0&&list.current_page==1"></abnor>
<view class="space-footer"></view>
</view>
</template>
<script>
import {
mapState,
} from "vuex"
export default {
components: {},
data() {
return {
options: {},
activeIndex: 0,
tabList: [{
id: 0,
title: '全部'
}, {
id: 1,
title: '未到账'
}, {
id: 2,
title: '已到账'
}, {
id: 3,
title: '已拒绝'
}],
statusType: {
1: '未到账',
2: '已到账',
3: '已拒绝'
},
param: {
page: 1,
},
list: {
data: []
},
wallet_price: '',
loading: true,
lockTap: false
}
},
computed: mapState({
primaryColor: state => state.config.configInfo.primaryColor,
subColor: state => state.config.configInfo.subColor,
}),
onLoad() {
this.$util.showLoading()
let {
wallet_price
} = this.$util.getPage(-1).detail
this.wallet_price = wallet_price
this.initIndex()
},
onPullDownRefresh() {
// #ifndef APP-PLUS
uni.showNavigationBarLoading()
// #endif
this.initRefresh()
uni.stopPullDownRefresh()
},
onReachBottom() {
if (this.list.current_page >= this.list.last_page || this.loading) return
this.param.page = this.param.page + 1
this.loading = true
this.getList()
},
methods: {
initIndex() {
this.getList()
},
initRefresh() {
this.param.page = 1
this.initIndex()
},
handerTabChange(index) {
this.activeIndex = index
this.$util.showLoading()
this.param.page = 1
this.list.data = []
this.getList()
},
async getList() {
let {
list: oldList,
activeIndex,
tabList,
param
} = this
let {
id
} = tabList[activeIndex]
param.status = id
let newList = await this.$api.mine.walletList(param);
if (this.param.page == 1) {
this.list = newList
} else {
newList.data = oldList.data.concat(newList.data)
this.list = newList
}
this.loading = false
this.$util.hideAll()
}
}
}
</script>
<style lang="scss">
.record-header {
width: 100%;
height: 250rpx;
.wallet-price {
font-size: 70rpx;
}
}
.record {
width: 24rpx;
height: 24rpx;
display: block;
}
.record-tag {
width: 152rpx;
height: 32rpx;
background: #eeeeee;
font-size: 22rpx;
display: flex;
align-items: center;
justify-content: center;
color: #999999;
}
</style>

View File

@@ -0,0 +1,158 @@
<template>
<view class="mine-distribution-team">
<fixed>
<tab @change="handerTabChange" :list="tabList" :activeIndex="activeIndex" :activeColor="primaryColor"
:width="100/tabList.length + '%'" height="100rpx"></tab>
</fixed>
<view @tap.stop="goDetail(index)" class="partner-item fill-base mt-md ml-md mr-md pd-lg radius-16"
:class="[{'mt-md':index!=0}]" v-for="(item,index) in list.data" :key="index">
<view class="flex-center pb-lg">
<image mode="aspectFill" class="cover radius" :src="item.avatarUrl"></image>
<view class="flex-1 ml-md">
<view class="f-title c-title text-bold ellipsis" style="max-width: 526rpx;">{{item.nickName}}</view>
<view class="f-caption c-caption mt-sm">绑定时间{{item.fx_bind_time}}</view>
</view>
</view>
<view class="count-info flex-center radius-16">
<view class="flex-center flex-column">
<view class="f-md-title c-title text-bold">{{item.team_count}}</view>
<view class="f-icontext c-desc">推广人数</view>
</view>
<view class="flex-center flex-column">
<view class="f-md-title c-title text-bold">{{item.order_count}}</view>
<view class="f-icontext c-desc">消费订单</view>
</view>
<view class="flex-center flex-column">
<view class="f-md-title c-title text-bold">{{item.order_price}}</view>
<view class="f-icontext c-desc">消费金额</view>
</view>
</view>
</view>
<load-more :noMore="list.current_page>=list.last_page&&list.data.length>0" :loading="loading" v-if="loading">
</load-more>
<abnor v-if="!loading&&list.data.length<=0&&list.current_page==1"></abnor>
<view class="space-footer"></view>
</view>
</template>
<script>
import {
mapState,
} from "vuex"
export default {
components: {},
data() {
return {
options: {},
activeIndex: 0,
tabList: [{
title: '一级分销商',
id: 1
}, {
title: '二级分销商',
id: 2,
}],
param: {
page: 1,
},
list: {
data: []
},
loading: true,
lockTap: false
}
},
computed: mapState({
primaryColor: state => state.config.configInfo.primaryColor,
subColor: state => state.config.configInfo.subColor,
userInfo: state => state.user.userInfo,
}),
onLoad(options) {
this.$util.showLoading()
this.options = options
let {
tab = 0
} = options
this.activeIndex = tab
this.initIndex()
},
onPullDownRefresh() {
// #ifndef APP-PLUS
uni.showNavigationBarLoading()
// #endif
this.initRefresh()
uni.stopPullDownRefresh()
},
onReachBottom() {
if (this.list.current_page >= this.list.last_page || this.loading) return
this.param.page = this.param.page + 1
this.loading = true
this.getList()
},
methods: {
initIndex() {
this.getList()
},
initRefresh() {
this.param.page = 1
this.initIndex()
},
handerTabChange(index) {
this.activeIndex = index
this.$util.showLoading()
this.param.page = 1
this.list.data = []
this.getList()
},
async getList() {
let {
list: oldList,
param,
tabList,
activeIndex
} = this
param.type = tabList[activeIndex].id
let newList = await this.$api.mine.myTeam(param);
if (this.param.page == 1) {
this.list = newList
} else {
newList.data = oldList.data.concat(newList.data)
this.list = newList
}
let {
one_count = 0, two_count = 0
} = newList
this.tabList[0].title = `一级分销商(${one_count}`
this.tabList[1].title = `二级分销商(${two_count}`
this.loading = false
this.$util.hideAll()
},
}
}
</script>
<style lang="scss">
.mine-distribution-team {
.partner-item {
.cover {
width: 104rpx;
height: 104rpx;
}
.count-info {
height: 124rpx;
background: #F5FAF7;
.flex-column {
width: 33.33%;
}
}
}
}
</style>

View File

@@ -0,0 +1,267 @@
<template>
<view class="mine-evaluate-edit" v-if="detail.id">
<uni-nav-bar :fixed="true" :shadow="false" :statusBar="true" color="#fff"
:backgroundColor="scrollTop < 20 ?``:primaryColor" leftIcon="icon-left" title="订单评价">
</uni-nav-bar>
<view :style="{height:`${configInfo.navBarHeight}px`}"></view>
<image mode="aspectFill" lazy-load class="common-bg abs" src="https://lbqny.migugu.com/admin/farm/bg-cash.png"></image>
<view class="flex-column mt-md ml-lg mr-lg pd-lg fill-base radius-24">
<block v-if="options.type == 'shop'">
<view class="order-item flex-center fill-base" :class="[{'mt-md':index!=0}]"
v-for="(item,index) in detail.order_goods" :key="index">
<image mode="aspectFill" lazy-load class="avatar radius-34" :src="item.goods_cover"></image>
<view class="flex-1 ml-lg">
<view class="f-title c-title text-bold ellipsis" style="max-width: 470rpx;">
{{item.goods_name}}
</view>
<view class="flex-between f-caption c-caption mt-sm">
<view class="ellipsis" :style="{maxWidth:item.refund_num*1>0?'300rpx':'470rpx'}">
{{item.spe_name}}
</view>
<view class="flex-1 c-warning text-right" v-if="item.refund_num*1>0">
已退x{{item.refund_num}}
</view>
</view>
<view class="flex-y-baseline mt-sm">
<view class="flex-1 f-paragraph c-warning">¥{{item.goods_price}} </view>
<view class="f-caption c-caption">x {{item.goods_num}} </view>
</view>
</view>
</view>
</block>
<view class="order-item flex-center fill-base" v-if="options.type != 'shop'">
<image mode="aspectFill" lazy-load class="avatar radius-34" :src="detail.goods_cover"></image>
<view class="flex-1 ml-lg">
<view class="f-title c-title text-bold ellipsis" style="max-width: 470rpx;">
{{detail.goods_name}}
</view>
<block v-if="options.type == 'claim'">
<view class="title f-caption c-caption mt-sm"> 数量{{`${detail.num}/${detail.unit}`}} </view>
<view class="title f-caption c-caption"> 配送周期{{detail.send_cycle}} </view>
</block>
<block v-if="options.type == 'land'">
<view class="f-caption c-caption mt-sm"> 租赁期限{{detail.end_time}} 到期 </view>
<view class="f-caption c-caption"> 租赁面积{{detail.area}} </view>
</block>
</view>
</view>
</view>
<view class="fill-base mt-md pd-lg b-1px-t">
<view class="f-paragraph c-title" v-if="options.eva_id">
<text decode="emsp" style="word-break:break-all;">{{subForm.text || '没有填写评价哦'}}</text>
</view>
<block v-else>
<textarea
v-on:input="subForm.text = subForm.text.length > 200 ? subForm.text.substring(0,200) : subForm.text"
v-model="subForm.text" type="text" class="item-textarea" maxlength="200"
placeholder-class="c-placeholder" placeholder="商品满足您的期待吗?快来分享分享吧"></textarea>
<view class="mt-md f-caption c-placeholder text-right">
{{`已输入${subForm.text.length}/200`}}
</view>
</block>
</view>
<view class="fill-base pt-sm pl-lg pr-lg pb-lg b-1px-t"
v-if="!options.eva_id || (options.eva_id && subForm.imgs.length > 0)">
<upload @upload="imgUpload" @del="imgUpload" :imagelist="subForm.imgs" imgtype="imgs" text="添加图片"
:imgsize="9" :imgauth="options.eva_id ? false : true">
</upload>
</view>
<view class="fill-base mt-md pd-lg b-1px-tb">
<view class="pb-md f-title text-bold">商品的评价</view>
<view class="flex-center">
<view class="flex-warp flex-1">
<block v-for="(item,index) in 5" :key="index">
<i @tap="checkStar" :data-num="index*1+1" class="iconfont icon-star-fill mr-sm"
:class="[{'icon-font-color cur':subForm.star>=index*1+1 }]"></i>
</block>
</view>
<view class="f-paragraph c-caption" v-if="options.eva_id">{{create_time_text}}</view>
</view>
</view>
<view class="space-footer"></view>
<view @tap.stop="toDelSubmit" class="confirm-btn ml-lg mr-lg flex-center f-title c-base radius-16"
:style="{background:options.eva_id ?subColor:primaryColor}">{{options.eva_id ? '删除':'提交'}}</view>
<view class="space-footer"></view>
</view>
</template>
<script>
import {
mapState,
mapActions,
mapMutations
} from "vuex"
export default {
components: {},
data() {
return {
scrollTop: 0,
typeText: {
'claim': 1,
'land': 2,
'shop': 3
},
options: {},
detail: {},
create_time_text: '',
subForm: {
star: 0,
text: '',
imgs: [],
},
lockTap: false
}
},
computed: mapState({
primaryColor: state => state.config.configInfo.primaryColor,
subColor: state => state.config.configInfo.subColor,
configInfo: state => state.config.configInfo,
userInfo: state => state.user.userInfo,
}),
onLoad(options) {
this.options = options
this.$util.showLoading()
this.initIndex()
},
onPageScroll(e) {
this.scrollTop = e.scrollTop
},
methods: {
...mapMutations(['updateOrderItem']),
async initIndex() {
let {
id,
type,
eva_id = 0
} = this.options
if (eva_id) {
let data = await this.$api.mine.evaluateInfo({
id: eva_id
})
data.imgs = data.imgs && data.imgs.length > 0 ? data.imgs.map(item => {
return {
path: item
}
}) : []
for (let key in this.subForm) {
this.subForm[key] = data[key]
}
this.create_time_text = this.$util.formatTime(data.create_time * 1000)
}
this.detail = await this.$api[type].orderInfo({
id
})
this.$util.hideAll()
},
initRefresh() {
this.initIndex()
},
checkStar(e) {
let {
num
} = this.$util.getDataSet(e)
this.subForm.star = num;
},
imgUpload(e) {
let {
imagelist,
imgtype
} = e;
this.subForm[imgtype] = imagelist;
},
async toDelSubmit() {
let {
typeText
} = this
let {
id: order_id,
type: method,
eva_id = 0
} = this.options
let {
order_code,
farmer_id,
store_id = 0
} = this.detail
if(method === 'shop'){
farmer_id = store_id
}
let subForm = this.$util.deepCopy(this.subForm)
if (!eva_id) {
if (!this.subForm.star) {
this.$util.showToast({
title: `请选择星级评价`
})
return
}
subForm.imgs = subForm.imgs.length > 0 ? subForm.imgs.map(item => {
return item.path
}) : []
}
let param = eva_id ? {
id: eva_id,
status: -1
} : Object.assign({}, subForm, {
order_id,
order_code,
farmer_id,
type: typeText[method]
})
if (this.lockTap) return
this.lockTap = true
this.$util.showLoading()
let methodModel = eva_id ? 'evaluateUpdate' : 'evaluateAdd'
try {
await this.$api.mine[methodModel](param)
this.$util.hideAll()
this.$util.showToast({
title: eva_id ? `删除成功` : `提交成功`
});
this.updateOrderItem({
key: 'haveOperItem',
val: true
})
setTimeout(() => {
this.$util.back()
this.$util.goUrl({
url: 1,
openType: 'navigateBack'
})
}, 1000)
} catch (e) {
setTimeout(() => {
this.lockTap = false
this.$util.hideAll()
}, 2000)
}
}
}
}
</script>
<style lang="scss">
.mine-evaluate-edit {
.item-textarea {
width: 690rpx;
overflow-y: auto;
}
.iconfont {
font-size: 42rpx;
color: #eee;
}
.cur {
background-image: -webkit-linear-gradient(90deg, #FDCD47, #FFC000);
}
.confirm-btn {
width: 690rpx;
height: 96rpx;
}
}
</style>

View File

@@ -0,0 +1,358 @@
<template>
<view class="mine-evaluate-list">
<fixed>
<view class="fill-base b-1px-b">
<view class="pl-lg pr-lg">
<view class="space-lg"></view>
<uni-segmented-control :current="typeInd" :values="typeList"
@clickItem="handerTabChange($event,'typeInd')" style-type="button" :active-color="primaryColor">
</uni-segmented-control>
<view class="space-sm"></view>
</view>
<tab @change="handerTabChange($event,'activeIndex')" :list="tabList" :activeIndex="activeIndex"
:activeColor="primaryColor" :width="100/tabList.length + '%'" height="100rpx" msgRight="110rpx">
</tab>
</view>
</fixed>
<view @tap.stop="goDetail(index)" class="order-item fill-base mg-big pd-lg radius-16 box-shadow"
v-for="(item,index) in list.data" :key="index">
<view class="flex-between pb-lg c-title">
<view class="f-title flex-y-baseline"><i class="iconfont icon-dianpu mr-sm"></i>
<view class="text-bold max-400 ellipsis">
{{typeList[typeInd].id == 3 ? item.store_info.title : item.farmer_info.title}}</view>
</view>
<view class="f-paragraph"
:style="{color:item.pay_type == 1? subColor: item.pay_type == 2? primaryColor: ''}">
{{statusType[item.pay_type]}}
</view>
</view>
<view class="flex-center" v-if="typeList[typeInd].id != 3">
<image mode="aspectFill" lazy-load class="avatar radius-24" :src="item.goods_cover"></image>
<view class="flex-1 ml-lg">
<view class="f-title c-title text-bold ellipsis" style="max-width: 498rpx;"> {{item.goods_name}}
</view>
<block v-if="typeList[typeInd].id == 1">
<view class="f-caption c-caption mt-sm"> 数量{{`${item.num}/${item.unit}`}} </view>
<view class="f-caption c-caption"> 配送周期{{item.send_cycle}} </view>
</block>
<block v-if="typeList[typeInd].id == 2">
<view class="f-caption c-caption mt-sm"> 租赁期限{{item.end_time}} 到期 </view>
<view class="f-caption c-caption"> 租赁面积{{item.area}} </view>
</block>
</view>
</view>
<view class="flex-between f-paragraph mt-md pt-md b-1px-t" v-if="typeList[typeInd].id == 1">
<view class="c-desc max-380 ellipsis">认养编号 {{item.claim_code}}</view>
<view class="flex-y-baseline c-title">总计<view class="f-title c-warning">¥{{item.pay_price}}</view>
</view>
</view>
<block v-if="typeList[typeInd].id == 3">
<view class="order-item flex-center" :class="[{'mt-md':aindex!=0}]"
v-for="(aitem,aindex) in item.order_goods" :key="aindex">
<image mode="aspectFill" lazy-load class="avatar box-shadow-mini radius-24"
:src="aitem.goods_cover">
</image>
<view class="flex-1 ml-lg">
<view class="f-paragraph c-title text-bold max-490 ellipsis"> {{aitem.goods_name}}
</view>
<view class="f-caption c-title" :class="[{'flex-center':aitem.refund_num*1>0}]">
<view class="ellipsis" :style="{maxWidth:aitem.refund_num*1>0?'300rpx':'490rpx'}">
{{aitem.spe_name}}
</view>
<view class="flex-1 c-warning text-right" v-if="aitem.refund_num*1>0">
已退x{{aitem.refund_num}}
</view>
</view>
<view class="flex-y-baseline mt-sm">
<view class="flex-1 f-paragraph c-warning">¥{{aitem.goods_price}} </view>
<view class="f-caption c-caption">x {{aitem.goods_num}} </view>
</view>
</view>
</view>
<view class="flex-between mt-lg pt-md b-1px-t">
<view class="c-title ml-sm mr-sm"> {{`${item.all_goods_num}`}}</view>
<view class="flex-y-baseline f-desc c-title"> 实付
<view class="f-title c-warning">¥{{item.true_price}}</view>
</view>
</view>
</block>
<view class="f-paragraph mt-md pt-md b-1px-t" v-if="activeIndex==1">
<view class="flex-between c-caption">
<view class="flex-warp">
<i class="iconfont icon-star-fill icon-font-color mr-sm"
:style="{backgroundImage: aindex < item.eva_info.star ? '-webkit-linear-gradient(90deg, #FDCD47, #FFC000)' : '-webkit-linear-gradient(90deg, #eee, #eee)'}"
v-for="(aitem,aindex) in 5" :key="aindex"></i>
</view>
<view>{{item.eva_info.create_time}}</view>
</view>
<view class="mt-sm mb-md f-paragraph c-paragraph">
<text decode="emsp" style="word-break:break-all;">{{item.eva_info.text || '没有填写评价哦'}}</text>
</view>
<view class="flex-warp mt-md" v-if="item.eva_info.imgs && item.eva_info.imgs.length > 0">
<block v-for="(aitem,aindex) in item.eva_info.imgs" :key="aindex">
<view class="eva-img radius-10 rel" v-if="aindex < 3">
<image @tap.stop="toPreviewImage(index,aindex)" mode="aspectFill" class="eva-img radius-10"
:src="aitem">
</image>
<view class="more f-caption c-base abs" v-if="aindex == 2 && item.eva_info.imgs.length > 3">
+{{item.eva_info.imgs.length - 3}}</view>
</view>
</block>
</view>
</view>
<view class="flex-between mt-lg">
<view></view>
<view class="flex-warp">
<view @tap.stop="toChangeItem(index,1)"
class="common-btn flex-center f-caption c-base radius-4 ml-lg"
:style="{background:primaryColor}" v-if="activeIndex==1">查看评价
</view>
<view @tap.stop="toChangeItem(index)" class="common-btn flex-center f-caption c-base radius-4 ml-lg"
:style="{background:activeIndex==0?primaryColor:subColor}">{{activeIndex==0?'去评价':'删除评价'}}
</view>
</view>
</view>
</view>
<load-more :noMore="list.current_page>=list.last_page&&list.data.length>0" :loading="loading" v-if="loading">
</load-more>
<abnor v-if="!loading&&list.data.length<=0&&list.current_page==1"></abnor>
<view class="space-footer"></view>
<common-popup @confirm="confirmChangeOrder" ref="del_item" title="删除评价" desc="请确认是否删除评价,删除后将无法恢复" text="确认删除"
:info="popupInfo">
</common-popup>
</view>
</template>
<script>
import {
mapState,
mapActions
} from "vuex"
import uniSegmentedControl from "@/components/uni-segmented-control.vue"
export default {
components: {
uniSegmentedControl
},
data() {
return {
typeInd: 0,
typeList: [{
id: 1,
title: '认养订单',
method: 'claim'
}, {
id: 2,
title: '土地订单',
method: 'land'
}, {
id: 3,
title: '商城订单',
method: 'shop'
}],
activeIndex: 0,
tabList: [{
id: 1,
title: '待评价',
number: 0
}, {
id: 2,
title: '已评价'
}],
statusType: {
'-1': '已取消',
1: '待支付',
2: '认养中',
3: '配送中',
7: '已完成',
},
param: {
page: 1
},
list: {
data: []
},
loading: true,
lockTap: false,
}
},
computed: mapState({
primaryColor: state => state.config.configInfo.primaryColor,
subColor: state => state.config.configInfo.subColor,
userInfo: state => state.user.userInfo,
}),
async onLoad() {
this.$util.showLoading()
await this.initIndex()
},
onUnload() {
this.$util.back()
},
onPullDownRefresh() {
// #ifndef APP-PLUS
uni.showNavigationBarLoading()
// #endif
this.initRefresh()
uni.stopPullDownRefresh()
},
onReachBottom() {
if (this.list.current_page >= this.list.last_page || this.loading) return
this.param.page = this.param.page + 1
this.loading = true
this.getList()
},
methods: {
...mapActions(['getUserInfo']),
async initIndex() {
await this.getList()
},
initRefresh() {
this.param.page = 1
this.initIndex()
},
async getList() {
let {
list: oldList,
typeInd,
typeList,
activeIndex,
tabList,
} = this
let {
id: type,
} = typeList[typeInd]
let param = this.$util.deepCopy(this.param)
param.type = type
let methodModel = activeIndex == 0 ? 'noEvaluateOrderList' : 'userEvaluateList'
let newList = await this.$api.mine[methodModel](param)
if (activeIndex == 1) {
newList.data = newList.data.map(item => {
let new_item = Object.assign({}, item.order_info, {
eva_info: item
});
delete new_item.eva_info.order_info
return new_item
})
}
if (this.param.page == 1) {
this.list = newList
} else {
newList.data = oldList.data.concat(newList.data)
this.list = newList
}
this.loading = false
if (activeIndex == 0) {
this.tabList[0].number = newList.total
}
this.$util.hideAll()
},
handerTabChange(index, key) {
this[key] = index;
if (key == 'typeInd') {
this.activeIndex = 0
}
this.$util.showLoading()
this.param.page = 1
this.list.data = []
this.getList()
},
toPreviewImage(index, aindex) {
let {
imgs: urls
} = this.list.data[index].eva_info
this.$util.previewImage({
current: urls[aindex],
urls
})
},
toChangeItem(index, type = 0) {
let {
activeIndex
} = this
if (activeIndex == 0 || type == 1) {
let {
id,
order_id,
eva_info = {
id: 0
}
} = this.list.data[index]
let {
id: eva_id
} = eva_info
let {
method
} = this.typeList[this.typeInd]
let param = type == 1 ? `&eva_id=${eva_id}` : ``
let url = `/mine/pages/evaluate/edit?id=${id}${param}&type=${method}`
this.$util.goUrl({
url
})
return
}
this.toChangeOrder(index, 'del_item')
},
// 删除评价
async toChangeOrder(index, key) {
let {
eva_info,
goods_cover = '',
} = this.list.data[index]
let {
id,
order_code,
} = eva_info
this.popupInfo = {
id,
name: `订单编号:${order_code}`,
image: goods_cover,
index,
refs_key: key,
}
this.$refs[key].open()
},
async confirmChangeOrder() {
let {
id,
index,
refs_key
} = this.popupInfo
if (this.lockTap) return;
this.lockTap = true;
this.$util.showLoading()
try {
await this.$api.mine.evaluateUpdate({
id,
status: -1
})
this.$util.hideAll()
this.list.data.splice(index, 1)
this.$util.showToast({
title: `删除成功`
})
this.tabList[0].number = this.tabList[0].number + 1
this.$util.back()
this.lockTap = false
this.$refs[refs_key].close()
} catch (e) {
setTimeout(() => {
this.lockTap = false
this.$util.hideAll()
}, 2000)
}
},
}
}
</script>
<style lang="scss">
.mine-evaluate-list {
.common-btn {
background: #CCCCCC;
}
}
</style>

View File

@@ -0,0 +1,182 @@
<template>
<view class="mine-evaluate-list">
<fixed>
<view class="flex-warp fill-base pd-lg">
<view @tap.stop="handerTabChange(index)" class="common-btn flex-center mr-md f-caption c-base radius-4"
:style="{background:activeIndex==index?primaryColor:''}" v-for="(item,index) in tabList"
:key="index">
{{item.title}} ({{item.number}})
</view>
</view>
</fixed>
<view class="flex-warp fill-base pd-lg" :class="[{'b-1px-t':index!=0}]" v-for="(item,index) in list.data"
:key="index">
<image mode="aspectFill" lazy-load class="avatar sm radius" :src="item.user_info.avatarUrl"></image>
<view class="flex-1 ml-lg">
<view class="flex-between">
<view class="f-paragraph c-title max-350 ellipsis">{{item.user_info.nickName}}</view>
<view class="f-icontext c-caption">{{item.create_time}}</view>
</view>
<view class="flex-warp">
<i class="iconfont icon-star-fill icon-font-color mr-sm"
:style="{backgroundImage: aindex < item.star ? '-webkit-linear-gradient(90deg, #FDCD47, #FFC000)' : '-webkit-linear-gradient(90deg, #eee, #eee)'}"
v-for="(aitem,aindex) in 5" :key="aindex"></i>
</view>
<view class="f-caption c-desc mt-md">
<text decode="emsp" style="word-break:break-all;">{{item.text || '该用户没有填写评价哦'}}</text>
</view>
<view class="flex-warp mt-md" v-if="item.imgs && item.imgs.length > 0">
<block v-for="(aitem,aindex) in item.imgs" :key="aindex">
<view class="eva-img sm radius-10 rel" v-if="aindex < 3">
<image @tap.stop="toPreviewImage(index,aindex)" mode="aspectFill" class="eva-img sm radius-10"
:src="aitem">
</image>
<view class="more f-caption c-base abs" v-if="aindex == 2 && item.imgs.length > 3">
+{{item.imgs.length - 3}}</view>
</view>
</block>
</view>
</view>
</view>
<load-more :noMore="list.current_page>=list.last_page&&list.data.length>0" :loading="loading" v-if="loading">
</load-more>
<abnor v-if="!loading&&list.data.length<=0&&list.current_page==1"></abnor>
<view class="space-footer"></view>
</view>
</template>
<script>
import {
mapState,
mapActions
} from "vuex"
export default {
components: {},
data() {
return {
options: {},
activeIndex: 0,
tabList: [{
id: 0,
title: '全部',
number: 0
}, {
id: 1,
title: '好评',
number: 0
}, {
id: 2,
title: '差评',
number: 0
}],
param: {
page: 1,
limit: 10
},
list: {
data: []
},
loading: true,
lockTap: false
}
},
computed: mapState({
primaryColor: state => state.config.configInfo.primaryColor,
subColor: state => state.config.configInfo.subColor,
userInfo: state => state.user.userInfo,
}),
async onLoad(options) {
this.options = options
this.$util.showLoading()
await this.initIndex()
},
onPullDownRefresh() {
// #ifndef APP-PLUS
uni.showNavigationBarLoading()
// #endif
this.initRefresh()
uni.stopPullDownRefresh()
},
onReachBottom() {
if (this.list.current_page >= this.list.last_page || this.loading) return
this.param.page = this.param.page + 1
this.loading = true
this.getList()
},
methods: {
...mapActions(['getUserInfo']),
async initIndex() {
await this.getList()
},
initRefresh() {
this.param.page = 1
this.initIndex()
},
async getList() {
let {
list: oldList,
tabList,
activeIndex
} = this
let {
id: goods_id,
type
} = this.options
let {
id: is_goods
} = tabList[activeIndex]
let param = Object.assign({}, this.param, {
goods_id,
type,
is_goods
});
let newList = await this.$api.mine.goodsEvaluateList(param);
if (this.param.page == 1) {
this.list = newList
} else {
newList.data = oldList.data.concat(newList.data)
this.list = newList
}
let count = {
0: 'all_count',
1: 'good_count',
2: 'bad_count'
}
for (let key in count) {
this.tabList[key].number = newList[count[key]]
}
this.loading = false
this.$util.hideAll()
},
handerTabChange(index) {
this.activeIndex = index;
this.$util.showLoading()
this.param.page = 1
this.list.data = []
this.getList()
},
toPreviewImage(index, aindex) {
let {
imgs: urls
} = this.list.data[index]
this.$util.previewImage({
current: urls[aindex],
urls
})
},
}
}
</script>
<style lang="scss">
.mine-evaluate-list {
.common-btn {
background: #CCCCCC;
}
}
</style>

View File

@@ -0,0 +1,193 @@
<template>
<view class="mine-pages-phone">
<uni-nav-bar :fixed="true" :shadow="false" :statusBar="true" :color="`#000`" backgroundColor="#fff">
<view class="flex-center" slot="left">
<view @tap="toHome"
:class="[{'back-user-ios': configInfo.isIos},{'back-user-android': !configInfo.isIos}]">
<view class="iconfont icon-home"></view>
<view class="back-user_text">回到首页</view>
</view>
</view>
</uni-nav-bar>
<view style="height:200rpx"></view>
<view class="flex-center flex-column">
<view class="title c-black">请输入邀请码</view>
<view class="confirm-btn radius-16">
<input @input="toGetFxInfo" v-model="subForm.fx_code" type="text"
class="item-input flex-y-center pl-lg pr-lg f-sm-title c-title" placeholder-class="c-placeholder"
:placeholder="rule[0].errorMsg" />
</view>
<view class="fx-user flex-center pd-md mt-md radius-16" :style="{border:`1rpx solid ${primaryColor}`}"
v-if="fx_info.id">
<image class="avatar md radius" :src="fx_info.avatarUrl"></image>
<view class="flex-1 ml-md">
<view class="f-title c-title max-476 ellipsis">{{fx_info.fx_name || fx_info.nickName}}</view>
<view class="f-caption c-caption">邀请你加入</view>
</view>
</view>
<view class="f-caption c-warning mt-md" v-if="isLoad && !fx_info.id">
{{subForm.fx_code.length == 7 ? '邀请码无效' :'邀请码为7位数'}}
</view>
<view @tap="submit" class="confirm-btn flex-center f-sm-title text-bold c-base radius-16"
:style="{background:subForm.fx_code.length > 0 ? primaryColor:'#CCE9DD'}">确定绑定
</view>
</view>
</view>
</template>
<script>
import {
mapState,
mapActions,
mapMutations
} from "vuex"
export default {
data() {
return {
isLoad: false,
options: {},
fx_info: {},
subForm: {
fx_code: ''
},
rule: [{
name: "fx_code",
checkType: "isNotNull",
errorMsg: "请输入邀请码",
regText: "邀请码"
}],
lockTap: false
}
},
computed: mapState({
primaryColor: state => state.config.configInfo.primaryColor,
subColor: state => state.config.configInfo.subColor,
configInfo: state => state.config.configInfo,
loginPage: state => state.user.loginPage,
}),
async onLoad(options) {
let {
phone
} = options
this.subForm.phone = phone
this.$util.setNavigationBarColor({
color: '#000000',
bg: '#ffffff'
})
},
methods: {
...mapActions(['getUserInfo']),
...mapMutations(['updateConfigItem']),
async initIndex() {},
async toGetFxInfo() {
let {
fx_code
} = this.subForm
if (fx_code.length == 7) {
this.fx_info = await this.$api.user.fxcodeUser({
fx_code
})
} else {
this.fx_info = {}
}
this.isLoad = fx_code.length >= 7
},
toHome() {
this.updateUserItem({
key: 'isShowLogin',
val: false
})
this.$util.goUrl({
url: this.loginPage,
openType: `switchTab`
})
},
//表单验证
validate(param) {
let validate = new this.$util.Validate();
this.rule.map(item => {
let {
name,
} = item
validate.add(param[name], item);
})
let message = validate.start();
return message;
},
async submit() {
let param = this.$util.deepCopy(this.subForm)
let msg = this.validate(param);
if (msg) {
this.$util.showToast({
title: msg
})
return
}
if (param.fx_code.length != 7) {
this.$util.showToast({
title: `邀请码为7位数`
})
return
}
if (this.lockTap) return
this.lockTap = true
this.$util.showLoading()
try {
await this.$api.user.bindReseller(param)
this.$util.hideAll()
this.$util.showToast({
title: `绑定成功`
})
this.lockTap = false
this.updateUserItem({
key: 'isShowLogin',
val: false
})
setTimeout(() => {
this.$util.goUrl({
url: this.loginPage,
openType: `switchTab`
})
}, 1000)
} catch (e) {
setTimeout(() => {
this.lockTap = false
this.$util.hideAll()
}, 2000)
}
}
}
}
</script>
<style lang="scss">
page {
background: #fff;
}
.mine-pages-phone {
.title {
font-size: 54rpx;
margin: 80rpx 0;
}
.confirm-btn {
width: 630rpx;
height: 110rpx;
background: #F7F7F7;
margin-top: 40rpx;
.item-input {
height: 110rpx;
}
}
.fx-user {
width: 630rpx;
}
}
</style>

View File

@@ -0,0 +1,231 @@
<template>
<view class="mine-notice">
<fixed>
<tab @change="handerTabChange" :list="tabList" :activeIndex="activeIndex" :activeColor="primaryColor"
:width="100/tabList.length + '%'" height="100rpx" msgRight="100rpx"></tab>
<view class="b-1px-b"></view>
</fixed>
<block v-for="(item,index) in list.data" :key="index">
<view class="item-day text-center f-icontext c-base radius-4" :class="[{'md':item.day.includes('-')}]"
v-if="index==0 || (index>0&&item.day!=list.data[index-1].day)">{{item.day}}</view>
<view @tap.stop="goDetail(index)" class="item-notice fill-base pd-lg mt-md ml-md mr-md radius-16">
<view class="flex-between">
<view class="f-title text-bold">{{item.title}}</view>
<view class="f-caption c-caption">{{item.hours}}</view>
</view>
<view class="flex-center mt-lg" v-if="activeIndex==0&&item.goods_cover">
<image class="cover radius-16" :src="item.goods_cover"></image>
<view class="flex-1 ml-md">
<!-- 您的订单已退款成功 -->
<view class="f-desc c-black text-bold">{{item.msg}}</view>
<view class="f-caption mt-md">
<view class="flex-y-center f-caption" :style="{color:primaryColor}" v-if="item.type==6">
点击查看详情<i class="iconfont icon-right"></i></view>
<view class="flex-y-center" v-if="item.order_code && item.type != 6">
<view class="c-caption">订单号</view>
<view :style="{color:primaryColor}"> {{item.order_code}}</view>
</view>
</view>
</view>
</view>
<view class="f-paragraph c-title mt-lg" v-if="activeIndex==0&&!item.goods_cover || activeIndex==1">
{{activeIndex==0?item.msg:item.sub_title}}
</view>
</view>
</block>
<load-more :noMore="list.current_page>=list.last_page&&list.data.length>0" :loading="loading" v-if="loading">
</load-more>
<abnor v-if="!loading&&list.data.length<=0&&list.current_page==1"></abnor>
<view class="space-footer"></view>
</view>
</template>
<script>
import {
mapState,
} from "vuex"
// #ifdef APP-PLUS
import skJGPush from "@/utils/jpush.js"
// #endif
export default {
components: {},
data() {
return {
options: {},
today: '',
cur_time: '',
activeIndex: 0,
tabList: [{
id: 0,
title: '系统公告',
number: 0
}, {
id: 2,
title: '服务通知',
number: 0
}],
param: {
page: 1,
},
list: {
data: []
},
loading: true,
popupInfo: {},
lockTap: false
}
},
computed: mapState({
primaryColor: state => state.config.configInfo.primaryColor,
subColor: state => state.config.configInfo.subColor,
userInfo: state => state.user.userInfo,
}),
onLoad(options) {
this.$util.showLoading()
this.options = options
this.initIndex()
},
onPullDownRefresh() {
// #ifndef APP-PLUS
uni.showNavigationBarLoading()
// #endif
this.initRefresh()
uni.stopPullDownRefresh()
},
onReachBottom() {
if (this.list.current_page >= this.list.last_page || this.loading) return
this.param.page = this.param.page + 1
this.loading = true
this.getList()
},
methods: {
initIndex() {
let cur_time = new Date(Math.ceil(new Date().getTime()))
this.today = this.$util.formatTime(cur_time, 'YY-M-D')
this.cur_time = this.$util.DateToUnix(this.today)
this.getList()
},
initRefresh() {
this.param.page = 1
this.initIndex()
},
handerTabChange(index) {
this.activeIndex = index
this.$util.showLoading()
this.param.page = 1
this.list.data = []
this.getList()
},
async getList() {
let {
list: oldList,
tabList,
activeIndex,
today,
cur_time
} = this
let param = this.$util.deepCopy(this.param)
let methodModel = activeIndex == 0 ? 'systemInfoList' : 'operateInfoList'
let newList = await this.$api.mine[methodModel](param);
if (this.param.page == 1) {
this.list = newList
} else {
newList.data = oldList.data.concat(newList.data)
this.list = newList
}
this.loading = false
let {
no_read_count,
operate_no_read_count
} = newList
this.tabList[0].number = no_read_count
this.tabList[1].number = operate_no_read_count
this.$util.hideAll()
// skJGPush.setBadge({
// badge: no_read_count
// })
},
// 详情
goDetail(index) {
let {
id,
type = 0,
obj_id = 0
} = this.list.data[index]
let {
activeIndex
} = this
let url = ''
if (activeIndex == 0) {
// 1提现成功2提现失败3商城下单4商场发货5土地下单6商城订单退款7认养到期可配送8认养下单9土地到期
// 10积分11兑换商品消耗积分12抽奖消耗积分13签到消耗积分14签到15秒杀提醒16储值
switch (type) {
case 3:
case 4:
url = `/shop/pages/order/detail?id=${obj_id}`
break;
case 5:
case 9:
url = `/land/pages/order/detail?id=${obj_id}`
break;
case 6:
url = `/shop/pages/refund/detail?id=${obj_id}`
break;
case 7:
url = `/claim/pages/order/detail?id=${obj_id}&tab=1`
break;
case 8:
url = `/claim/pages/order/detail?id=${obj_id}`
break;
case 15:
url = `/shop/pages/detail?id=${obj_id}`
break;
}
} else {
url = `/home/pages/article?id=${id}&type=3`
}
if (!url) return
this.$util.goUrl({
url
})
}
}
}
</script>
<style lang="scss">
.mine-notice {
.item-day {
width: 100rpx;
height: 44rpx;
line-height: 44rpx;
background: #D9D9D9;
margin: 20rpx auto;
}
.item-day.md {
width: 150rpx;
}
.item-notice {
.cover {
width: 150rpx;
height: 150rpx;
}
.ellipsis {
max-width: 480rpx;
}
.icon-right {
font-size: 24rpx;
}
}
}
</style>

View File

@@ -0,0 +1,87 @@
<template>
<view class="mine-pay-result">
<view class="space-body"></view>
<view class="flex-center flex-column">
<image mode="aspectFill" lazy-load class="result-img" src="/static/image/mine/pay-result.png"></image>
<view class="f-title c-title text-bold mt-lg">订单支付成功</view>
<view class="f-paragraph c-caption mt-sm">您可以在我的订单中查询订单详情或跟踪物流信息</view>
</view>
<view class="btn-list flex-center flex-column">
<view @tap.stop="goDetail" class="btn-item flex-center f-sm-title c-base radius"
:style="{background:primaryColor,border: `1rpx solid ${primaryColor}`}">查看订单</view>
<view @tap.stop="goHome" class="btn-item flex-center f-sm-title c-base mt-md radius"
:style="{color:primaryColor,border: `1rpx solid ${primaryColor}`}">返回首页</view>
</view>
</view>
</template>
<script>
import {
mapState,
mapActions
} from "vuex"
export default {
components: {},
data() {
return {
options: {},
}
},
computed: mapState({
primaryColor: state => state.config.configInfo.primaryColor,
subColor: state => state.config.configInfo.subColor,
userInfo: state => state.user.userInfo,
}),
onLoad(options) {
this.options = options
this.getUserInfo()
},
methods: {
...mapActions(['getUserInfo']),
goHome() {
let {
type
} = this.options
let url = `/pages/home`
this.$util.goUrl({
url,
openType: 'switchTab'
})
},
goDetail() {
let {
type
} = this.options
let tab = type != 'shop' ? 1 : 2
let url = `/${type}/pages/order/list?tab=${tab}`
this.$util.goUrl({
url,
openType: 'redirectTo'
})
}
}
}
</script>
<style lang="scss">
page {
background: #fff;
}
.mine-pay-result {
.result-img {
width: 204rpx;
height: 204rpx;
}
.btn-list {
margin-top: 100rpx;
.btn-item {
width: 580rpx;
height: 88rpx;
transform: rotateZ(360deg);
}
}
}
</style>

View File

@@ -0,0 +1,297 @@
<template>
<view class="mine-pay" v-if="isLoad">
<view
class="flex-center flex-column fill-base mt-md ml-md mr-md pd-lg f-paragraph c-title box-shadow radius-24">
<view class="flex-y-baseline f-sm-title">¥<view style="font-size: 60rpx;">{{orderInfo.pay_price}}</view>
</view>
<view>实付金额</view>
</view>
<view class="fill-base mt-md ml-md mr-md f-paragraph box-shadow radius-24"
v-if="orderInfo.page_type == 'breed'">
<view class="flex-between ml-md mr-md pl-sm pt-lg pb-lg">
<view class="item-text">订单备注</view>
<input v-model="text" type="text" class="flex-1 f-paragraph" maxlength="100"
placeholder-class="c-placeholder" placeholder="请输入订单备注" />
</view>
</view>
<view class="fill-base mt-md ml-md mr-md f-sm-title box-shadow radius-24">
<view @tap.stop="toChangeItem(index)" class="flex-between ml-md mr-md pl-sm pr-sm pt-lg pb-lg b-1px-b"
v-for="(item,index) in payList" :key="index">
<view class="pay-item flex-y-center"><i class="iconfont mr-md" :class="[item.icon]"
:style="{color:item.id==1?primaryColor:item.id==2?subColor:'#01AAF2'}"></i>
<view class="flex-y-baseline">{{item.title}}
<view class="f-paragraph c-caption ml-sm" v-if="item.id==2">余额{{userInfo.balance || 0}}
</view>
</view>
</view>
<i class="pay-icon iconfont c-caption"
:class="[{'icon-xuanze':payInd != index},{'icon-radio-fill':item.is_disabled || payInd == index}]"
:style="{color:payInd==index?primaryColor:''}"></i>
</view>
</view>
<view class="space-lg"></view>
<auth :needAuth="userInfo && !userInfo.nickName" :must="true" @go="toPay">
<view class="pay-btn flex-center f-title c-base radius" :style="{background:primaryColor}">立即支付</view>
</auth>
</view>
</template>
<script>
import {
mapState,
mapActions,
mapMutations
} from "vuex"
import parser from "@/components/jyf-Parser/index"
export default {
components: {
parser
},
data() {
return {
isLoad: false,
options: {},
// 1微信支付2余额支付3支付宝支付
payList: [{
id: 1,
title: '微信支付',
icon: 'icon-wechat-pay',
is_disabled: false
}
// #ifdef APP-PLUS
, {
id: 3,
title: '支付宝支付',
icon: 'icon-alipay',
is_disabled: false
}
// #endif
, {
id: 2,
title: '余额支付',
icon: 'icon-qianbao',
is_disabled: false
}
],
payInd: 0,
// #ifdef APP-PLUS
balanceInd: 2,
// #endif
// #ifndef APP-PLUS
balanceInd: 1,
// #endif
text: '',
tmplIds: [],
lockTap: false,
}
},
computed: mapState({
primaryColor: state => state.config.configInfo.primaryColor,
subColor: state => state.config.configInfo.subColor,
configInfo: state => state.config.configInfo,
userInfo: state => state.user.userInfo,
orderInfo: state => state.order.orderInfo,
}),
async onLoad() {
this.$util.showLoading()
this.initIndex()
},
methods: {
...mapActions(['getUserInfo']),
...mapMutations(['updateOrderItem']),
async initIndex(flag = false) {
await this.getUserInfo()
let {
balance
} = this.userInfo
let {
pay_price,
page_type,
send_type = 0
} = this.orderInfo
let is_disabled = balance * 1 < pay_price * 1
let {
balanceInd
} = this
this.payList[balanceInd].is_disabled = is_disabled
if (pay_price * 1 == 0) {
this.payList[0].is_disabled = true
// #ifdef APP-PLUS
this.payList[1].is_disabled = true
// #endif
this.payInd = balanceInd
}
let tmplIds = []
this.tmplIds = tmplIds
this.isLoad = true
this.$util.hideAll()
},
initRefresh() {
this.initIndex(true)
},
toChangeItem(index) {
if (index === 2 && this.payList[index].is_disabled) return
this.payInd = index
},
async toPay() {
// #ifdef MP-WEIXIN
let that = this;
let {
tmplIds
} = that
if (tmplIds && tmplIds.length > 0) {
uni.requestSubscribeMessage({
tmplIds,
complete(res) {
that.toConfirmPay()
console.log(res, "complete requestSubscribeMessage");
}
})
} else {
that.toConfirmPay()
}
// #endif
// #ifndef MP-WEIXIN
this.toConfirmPay()
// #endif
},
async toConfirmPay() {
let {
payList,
payInd,
text = ''
} = this
let orderInfo = this.$util.deepCopy(this.orderInfo)
let {
page_type,
} = orderInfo
let {
id: pay_model
} = payList[payInd]
let add_params = page_type == 'breed' ? {
pay_model,
text
} : {
pay_model
}
let param = Object.assign({}, orderInfo, add_params);
delete param.pay_price
delete param.page_type
if (this.lockTap) return
this.lockTap = true
this.$util.showLoading()
try {
let url = ['breed', 'claim_send', 'land_send'].includes(page_type) ? 1 : ''
let openType = ['breed', 'claim_send', 'land_send'].includes(page_type) ? 'navigateBack' : ''
let method_key = ['breed', 'claim_send'].includes(page_type) ? 'claim' : 'land'
let method = {
breed: 'breedOrder',
claim_send: 'sendOrderApply',
land_send: 'sendOrderApply',
}
let {
pay_list
} = await this.$api[method_key][method[page_type]](param)
this.$util.hideAll()
if (pay_list) {
try {
if (param.pay_model == 3) {
pay_list = {
orderInfo: pay_list,
provider: 'alipay'
}
}
await this.$util.pay(pay_list)
this.$util.showToast({
title: `支付成功`
})
if (page_type == 'breed') {
this.updateOrderItem({
key: 'haveOperItem',
val: true
})
}
setTimeout(() => {
this.$util.back()
console.log(url, openType, "===========")
this.$util.goUrl({
url,
openType
})
}, 1000)
this.lockTap = false
return
} catch (e) {
this.$util.showToast({
title: `支付失败`
})
setTimeout(() => {
this.$util.back()
this.$util.goUrl({
url,
openType
})
}, 1000)
this.lockTap = false
return
}
}
this.$util.showToast({
title: `支付成功`
})
if (page_type == 'breed') {
this.updateOrderItem({
key: 'haveOperItem',
val: true
})
}
setTimeout(() => {
console.log(url, openType, "=========333==")
this.$util.back()
this.$util.goUrl({
url,
openType
})
}, 1000)
} catch (e) {
setTimeout(() => {
this.lockTap = false
this.$util.hideAll()
}, 2000)
}
}
}
}
</script>
<style lang="scss">
.mine-pay {
.item-text {
width: 150rpx;
}
.pay-item {
.iconfont {
font-size: 50rpx;
}
}
.pay-icon {
font-size: 40rpx;
}
.pay-btn {
width: 622rpx;
height: 94rpx;
margin: 0 auto;
}
}
</style>

View File

@@ -0,0 +1,181 @@
<template>
<view class="mine-pages-phone flex-center flex-column">
<view class="title c-black">请输入验证码</view>
<view class="flex-y-center f-caption c-caption mt-lg">验证码已发送至<view class="ml-sm" :style="{color:primaryColor}">
{{subForm.phone}}
</view>
</view>
<view class="space-lg"></view>
<view class="space-lg"></view>
<view class="space-md"></view>
<view>
<xt-verify-code v-model="subForm.short_code" @confirm="confirm"></xt-verify-code>
</view>
<view class="flex-center f-caption c-caption mt-lg">
<view class="flex-center" v-if="authTime > 0">
<view class="c-title mr-sm">{{`${authTime}s`}}</view>
</view>
<view @tap="toResetCode" :style="{color:authTime > 0?'':primaryColor}">重新获取</view>
</view>
<view @tap="submit" class="confirm-btn flex-center f-sm-title text-bold c-base radius-16"
:style="{background:subForm.short_code.length > 0 ? primaryColor:'#CCE9DD'}">下一步
</view>
</view>
</template>
<script>
import {
mapState,
mapActions,
mapMutations
} from "vuex"
import xtVerifyCode from "@/mine/components/xt-verify-code"
export default {
components: {
xtVerifyCode
},
data() {
return {
isLoad: false,
options: {},
authTime: 60,
timer: null,
subForm: {
phone: '',
short_code: ''
},
rule: [{
name: "short_code",
checkType: "isNotNull",
errorMsg: "请输入短信验证码",
regText: "短信验证码"
}],
lockTap: false,
}
},
computed: mapState({
primaryColor: state => state.config.configInfo.primaryColor,
subColor: state => state.config.configInfo.subColor,
}),
async onLoad(options) {
let {
phone
} = options
this.subForm.phone = phone
this.$util.setNavigationBarColor({
color: '#000000',
bg: '#ffffff'
})
this.initIndex()
},
methods: {
...mapActions(['getUserInfo']),
...mapMutations(['updateUserItem']),
async initIndex() {
let time = 60
this.timer = setInterval(() => {
if (time === 0) {
clearTimeout(this.timer)
return
}
time--
this.authTime = time
}, 1000)
},
initRefresh() {
this.initIndex()
},
async toResetCode() {
let {
authTime
} = this
if (authTime) return
this.timer && clearTimeout(this.timer)
let {
phone
} = this.subForm
await this.$api.user.sendShortMsg({
phone
})
this.$util.showToast({
title: `验证码发送成功`
})
this.initRefresh()
},
confirm() {
},
//表单验证
validate(param) {
let validate = new this.$util.Validate();
this.rule.map(item => {
let {
name,
} = item
validate.add(param[name], item);
})
let message = validate.start();
return message;
},
async submit() {
let param = this.$util.deepCopy(this.subForm)
let msg = this.validate(param);
if (msg) {
this.$util.showToast({
title: msg
})
return
}
if (this.lockTap) return
this.lockTap = true
this.$util.showLoading()
try {
await this.$api.user.bindUserPhone(param)
this.$util.hideAll()
this.lockTap = false
this.timer && clearTimeout(this.timer)
setTimeout(() => {
this.$util.goUrl({
url: `/mine/pages/fx-code`,
openType: `reLaunch`
})
}, 1000)
} catch (e) {
setTimeout(() => {
this.lockTap = false
this.$util.hideAll()
}, 2000)
}
}
}
}
</script>
<style lang="scss">
page {
background: #fff;
}
.mine-pages-phone {
.title {
font-size: 54rpx;
margin-top: 80rpx;
}
.confirm-btn {
width: 630rpx;
height: 110rpx;
background: #F7F7F7;
margin-top: 40rpx;
.item-input {
height: 110rpx;
}
}
}
</style>

View File

@@ -0,0 +1,118 @@
<template>
<view class="mine-pages-phone flex-center flex-column">
<view class="title c-black">请输入手机号</view>
<view class="confirm-btn radius-16">
<input v-model="subForm.phone" type="text" class="item-input flex-y-center pl-lg pr-lg f-sm-title c-title"
placeholder-class="c-placeholder" :placeholder="rule[0].errorMsg" />
</view>
<view @tap="submit" class="confirm-btn flex-center f-sm-title text-bold c-base radius-16"
:style="{background:subForm.phone.length > 0 ? primaryColor:'#CCE9DD'}">下一步
</view>
</view>
</template>
<script>
import {
mapState,
mapActions,
mapMutations
} from "vuex"
export default {
data() {
return {
isLoad: false,
options: {},
subForm: {
phone: ''
},
rule: [{
name: "phone",
checkType: "isMobile",
errorMsg: "请输入手机号",
regText: "手机号"
}],
lockTap: false
}
},
computed: mapState({
primaryColor: state => state.config.configInfo.primaryColor,
subColor: state => state.config.configInfo.subColor,
}),
async onLoad(options) {},
methods: {
...mapActions(['getUserInfo']),
...mapMutations(['updateUserItem']),
async initIndex() {
},
//表单验证
validate(param) {
let validate = new this.$util.Validate();
this.rule.map(item => {
let {
name,
} = item
validate.add(param[name], item);
})
let message = validate.start();
return message;
},
async submit() {
let param = this.$util.deepCopy(this.subForm)
let msg = this.validate(param);
if (msg) {
this.$util.showToast({
title: msg
})
return
}
if (this.lockTap) return
this.lockTap = true
this.$util.showLoading()
try {
await this.$api.user.sendShortMsg(param)
this.$util.hideAll()
this.lockTap = false
setTimeout(() => {
this.$util.goUrl({
url: `/mine/pages/phone-code?phone=${param.phone}`
})
}, 1000)
} catch (e) {
setTimeout(() => {
this.lockTap = false
this.$util.hideAll()
}, 2000)
}
}
}
}
</script>
<style lang="scss">
page {
background: #fff;
}
.mine-pages-phone {
.title {
font-size: 54rpx;
margin: 80rpx 0;
}
.confirm-btn {
width: 630rpx;
height: 110rpx;
background: #F7F7F7;
margin-top: 40rpx;
.item-input {
height: 110rpx;
}
}
}
</style>

View File

@@ -0,0 +1,133 @@
<template>
<view class="mine-pages-setting">
<view class="flex-center flex-column pd-lg fill-base">
<view class="space-lg"></view>
<view class="space-lg"></view>
<image class="avatar radius" :src="user_info.avatarUrl"></image>
<view class="f-title c-caption mt-md" v-if="user_info.phone"> {{user_info.split_phone}} </view>
</view>
<view class="flex-between pd-lg fill-base f-paragraph" v-for="item in userInfoList">
<view>{{item.text}}</view>
<view class="c-caption">{{user_info[item.key]}}</view>
</view>
<view class="space-md"></view>
<view @tap.stop="goDetail(index,'infoList')" class="flex-between pd-lg fill-base f-paragraph"
v-for="(item,index) in infoList" :key="index">
<view>{{item.text}}</view>
<i class="iconfont icon-right"></i>
</view>
<view class="space-md"></view>
<view @tap.stop="goDetail(index,'aboutUsList')" class="flex-between pd-lg fill-base f-paragraph"
v-for="(item,index) in aboutUsList" :key="index">
<view>{{item.text}}</view>
<i class="iconfont icon-right"></i>
</view>
<view class="space-max-footer"></view>
<fix-bottom-button @confirm="toLoginOut" :text="[{ text: '退出登录', type: 'confirm' }]" bgColor="#fff">
</fix-bottom-button>
</view>
</template>
<script>
import {
mapState,
mapActions,
mapMutations
} from "vuex"
import siteInfo from '@/siteinfo.js';
export default {
data() {
return {
isLoad: false,
options: {},
userInfoList: [{
text: '昵称',
key: 'nickName'
}, {
text: '注册时间',
key: 'create_date'
}],
infoList: [{
text: '用户隐私协议',
url: 1
}, {
text: '个人信息保护指引',
url: 2
}],
aboutUsList: [{
text: '关于我们',
url: '/mine/pages/about-us'
}],
user_info: {}
}
},
computed: mapState({
primaryColor: state => state.config.configInfo.primaryColor,
subColor: state => state.config.configInfo.subColor,
userInfo: state => state.user.userInfo,
}),
async onLoad() {
this.initIndex()
},
methods: {
...mapActions(['getUserInfo']),
...mapMutations(['updateConfigItem', 'updateUserItem']),
async initIndex() {
this.user_info = this.$util.deepCopy(this.userInfo)
},
goDetail(index, key) {
let {
siteroot
} = siteInfo
let {
url
} = this[key][index]
if (key == 'infoList') {
let href = siteroot.split('index.php')[0]
let page = url == 1 ? 'protocol' : 'information'
url = `${href}${page}.html`
}
this.$util.goUrl(key == 'infoList' ? {
url,
openType: 'web'
} : {
url
})
},
toLoginOut() {
let arr = ['autograph', 'userInfo', 'appLogin']
arr.map(key => {
uni.setStorageSync(key, '')
this.updateUserItem({
key,
val: ''
})
})
this.$util.showToast({
title: `退出登录`
})
this.updateUserItem({
key: 'isShowLogin',
val: true
})
setTimeout(() => {
this.$util.goUrl({
url: `/pages/login`,
openType: `reLaunch`
})
}, 1000)
}
}
}
</script>
<style lang="scss">
.mine-pages-setting {
.iconfont {
color: #999
}
}
</style>