yshop3.1正式发布
This commit is contained in:
@ -4,12 +4,7 @@
|
||||
<swiper indicatorDots="true">
|
||||
<block v-for="(item, infoIndex) in info" :key="infoIndex">
|
||||
<swiper-item>
|
||||
<image
|
||||
class="slide-image"
|
||||
:src="item.wap_poster"
|
||||
mode="widthFix"
|
||||
show-menu-by-longpress
|
||||
/>
|
||||
<image class="slide-image" :src="item.wap_poster" mode="widthFix" show-menu-by-longpress />
|
||||
</swiper-item>
|
||||
</block>
|
||||
</swiper>
|
||||
@ -18,143 +13,143 @@
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
// import { swiper, swiperSlide } from "vue-awesome-swiper";
|
||||
import { getSpreadImg } from "@/api/user";
|
||||
// import { swiper, swiperSlide } from "vue-awesome-swiper";
|
||||
import {
|
||||
getSpreadImg
|
||||
} from "@/api/user";
|
||||
|
||||
export default {
|
||||
name: "Poster",
|
||||
components: {
|
||||
// swiper,
|
||||
// swiperSlide
|
||||
},
|
||||
props: {},
|
||||
data: function() {
|
||||
return {
|
||||
swiperPosters: {
|
||||
speed: 1000,
|
||||
effect: "coverflow",
|
||||
slidesPerView: "auto",
|
||||
centeredSlides: true,
|
||||
coverflowEffect: {
|
||||
rotate: 0, // 旋转的角度
|
||||
stretch: -20, // 拉伸 图片间左右的间距和密集度
|
||||
depth: 100, // 深度 切换图片间上下的间距和密集度
|
||||
modifier: 3, // 修正值 该值越大前面的效果越明显
|
||||
slideShadows: false // 页面阴影效果
|
||||
export default {
|
||||
name: "Poster",
|
||||
components: {
|
||||
// swiper,
|
||||
// swiperSlide
|
||||
},
|
||||
props: {},
|
||||
data: function () {
|
||||
return {
|
||||
swiperPosters: {
|
||||
speed: 1000,
|
||||
effect: "coverflow",
|
||||
slidesPerView: "auto",
|
||||
centeredSlides: true,
|
||||
coverflowEffect: {
|
||||
rotate: 0, // 旋转的角度
|
||||
stretch: -20, // 拉伸 图片间左右的间距和密集度
|
||||
depth: 100, // 深度 切换图片间上下的间距和密集度
|
||||
modifier: 3, // 修正值 该值越大前面的效果越明显
|
||||
slideShadows: false // 页面阴影效果
|
||||
},
|
||||
observer: true,
|
||||
observeParents: true
|
||||
},
|
||||
observer: true,
|
||||
observeParents: true
|
||||
},
|
||||
info: [],
|
||||
activeIndex: 0
|
||||
};
|
||||
},
|
||||
mounted: function() {
|
||||
this.getIndex();
|
||||
let that = this;
|
||||
// this.swiper.on("slideChange", function() {
|
||||
// that.activeIndex = that.swiper.activeIndex;
|
||||
// });
|
||||
},
|
||||
computed: {
|
||||
swiper() {
|
||||
// return this.$refs.mySwiper.swiper;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getIndex: function() {
|
||||
info: [],
|
||||
activeIndex: 0
|
||||
};
|
||||
},
|
||||
mounted: function () {
|
||||
this.getIndex();
|
||||
let that = this;
|
||||
let from = {};
|
||||
if (this.$deviceType == "app") {
|
||||
from.from = "app";
|
||||
}
|
||||
getSpreadImg(from).then(
|
||||
res => {
|
||||
that.info = res.data;
|
||||
},
|
||||
err => {
|
||||
uni.showToast({
|
||||
title: err.msg || err.response.data.msg|| err.response.data.message,
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
}
|
||||
);
|
||||
// this.swiper.on("slideChange", function() {
|
||||
// that.activeIndex = that.swiper.activeIndex;
|
||||
// });
|
||||
},
|
||||
downloadIamge: function(imgsrc, name) {
|
||||
var that = this;
|
||||
this.isDown = true;
|
||||
var downloadUrl = imgsrc;
|
||||
|
||||
if (!wx.saveImageToPhotosAlbum) {
|
||||
uni.showModal({
|
||||
title: "提示",
|
||||
content:
|
||||
"当前微信版本过低,无法使用该功能,请升级到最新微信版本后重试。"
|
||||
});
|
||||
that.openDialogVisible = true;
|
||||
|
||||
return;
|
||||
computed: {
|
||||
swiper() {
|
||||
// return this.$refs.mySwiper.swiper;
|
||||
}
|
||||
|
||||
// 可以通过 wx.getSetting 先查询一下用户是否授权了 "scope.writePhotosAlbum" 这个 scope
|
||||
wx.getSetting({
|
||||
success(res) {
|
||||
if (!res.authSetting["scope.writePhotosAlbum"]) {
|
||||
that.openDialogVisible = true;
|
||||
|
||||
// 接口调用询问
|
||||
wx.authorize({
|
||||
scope: "scope.writePhotosAlbum",
|
||||
success() {
|
||||
that.downloadImage(downloadUrl);
|
||||
},
|
||||
fail() {
|
||||
// 用户拒绝了授权
|
||||
// 打开设置页面
|
||||
wx.openSetting({
|
||||
success: function(data) {},
|
||||
fail: function(data) {}
|
||||
});
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getIndex: function () {
|
||||
let that = this;
|
||||
getSpreadImg({
|
||||
from: this.$deviceType == 'weixin' || this.$deviceType == 'weixinh5' ? 'uniappH5' : this.$deviceType
|
||||
}).then(
|
||||
res => {
|
||||
that.info = res.data;
|
||||
},
|
||||
err => {
|
||||
uni.showToast({
|
||||
title: err.msg || err.response.data.msg || err.response.data.message,
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
} else {
|
||||
that.downloadImage(downloadUrl);
|
||||
}
|
||||
},
|
||||
fail(res) {
|
||||
);
|
||||
},
|
||||
downloadIamge: function (imgsrc, name) {
|
||||
var that = this;
|
||||
this.isDown = true;
|
||||
var downloadUrl = imgsrc;
|
||||
|
||||
if (!wx.saveImageToPhotosAlbum) {
|
||||
uni.showModal({
|
||||
title: "提示",
|
||||
content: "当前微信版本过低,无法使用该功能,请升级到最新微信版本后重试。"
|
||||
});
|
||||
that.openDialogVisible = true;
|
||||
|
||||
return;
|
||||
}
|
||||
});
|
||||
},
|
||||
saveImg: function() {
|
||||
this.downloadIamge(
|
||||
this.info[this.activeIndex].wap_poster,
|
||||
"poster" + this.activeIndex
|
||||
);
|
||||
|
||||
// 可以通过 wx.getSetting 先查询一下用户是否授权了 "scope.writePhotosAlbum" 这个 scope
|
||||
wx.getSetting({
|
||||
success(res) {
|
||||
if (!res.authSetting["scope.writePhotosAlbum"]) {
|
||||
that.openDialogVisible = true;
|
||||
|
||||
// 接口调用询问
|
||||
wx.authorize({
|
||||
scope: "scope.writePhotosAlbum",
|
||||
success() {
|
||||
that.downloadImage(downloadUrl);
|
||||
},
|
||||
fail() {
|
||||
// 用户拒绝了授权
|
||||
// 打开设置页面
|
||||
wx.openSetting({
|
||||
success: function (data) {},
|
||||
fail: function (data) {}
|
||||
});
|
||||
}
|
||||
});
|
||||
} else {
|
||||
that.downloadImage(downloadUrl);
|
||||
}
|
||||
},
|
||||
fail(res) {
|
||||
that.openDialogVisible = true;
|
||||
}
|
||||
});
|
||||
},
|
||||
saveImg: function () {
|
||||
this.downloadIamge(
|
||||
this.info[this.activeIndex].wap_poster,
|
||||
"poster" + this.activeIndex
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
page {
|
||||
height: 100%;
|
||||
}
|
||||
.distribution-posters {
|
||||
height: 100%;
|
||||
}
|
||||
<style lang="less">
|
||||
page {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.banenr {
|
||||
height: 100%;
|
||||
}
|
||||
.distribution-posters {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.banner swiper {
|
||||
height: 100%;
|
||||
}
|
||||
.banenr {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.banner .slide-image {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
}
|
||||
.banner swiper {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.banner .slide-image {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -1,17 +1,20 @@
|
||||
<template>
|
||||
<view class="cash-withdrawal">
|
||||
<view class="nav acea-row">
|
||||
<view
|
||||
v-for="(item, navListIndex) in navList"
|
||||
class="item font-color-red"
|
||||
@click="swichNav(navListIndex, item)"
|
||||
:key="navListIndex"
|
||||
>
|
||||
<!-- <view class="nav acea-row">
|
||||
<view v-for="(item, navListIndex) in navList" class="item font-color-red" @click="swichNav(navListIndex, item)"
|
||||
:key="navListIndex">
|
||||
<view class="line bg-color-red" :class="currentTab === navListIndex ? 'on' : ''"></view>
|
||||
<view class="iconfont" :class="item.icon + ' ' + (currentTab === navListIndex ? 'on' : '')"></view>
|
||||
<view>{{ item.name }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view> -->
|
||||
|
||||
<div class="pos-order-list">
|
||||
<view class="nav acea-row row-around row-middle">
|
||||
<view v-for="(item, navListIndex) in navList" class="item" :class="currentTab === navListIndex ? 'on' : ''"
|
||||
@click="swichNav(navListIndex, item)" :key="navListIndex">{{item.name}}</view>
|
||||
</view>
|
||||
</div>
|
||||
<view class="wrapper">
|
||||
<view :hidden="currentTab !== 0" class="list">
|
||||
<view class="item acea-row row-between-wrapper">
|
||||
@ -55,158 +58,198 @@
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import { getBank, postCashInfo } from "@/api/user";
|
||||
import { required } from "@/utils/validate";
|
||||
import { validatorDefaultCatch } from "@/utils/dialog";
|
||||
import {
|
||||
getBank,
|
||||
postCashInfo
|
||||
} from "@/api/user";
|
||||
import {
|
||||
required
|
||||
} from "@/utils/validate";
|
||||
import {
|
||||
validatorDefaultCatch
|
||||
} from "@/utils/dialog";
|
||||
|
||||
export default {
|
||||
name: "UserCash",
|
||||
components: {},
|
||||
props: {},
|
||||
data: function() {
|
||||
return {
|
||||
navList: [
|
||||
{ name: "微信", type: "weixin", icon: "icon-weixin2" },
|
||||
{ name: "支付宝", type: "alipay", icon: "icon-icon34" }
|
||||
],
|
||||
post: {
|
||||
extract_type: "weixin",
|
||||
alipay_code: "",
|
||||
money: "",
|
||||
name: "",
|
||||
bankname: "",
|
||||
cardnum: "",
|
||||
weixin: ""
|
||||
export default {
|
||||
name: "UserCash",
|
||||
components: {},
|
||||
props: {},
|
||||
data: function () {
|
||||
return {
|
||||
navList: [{
|
||||
name: "微信",
|
||||
type: "weixin",
|
||||
icon: "icon-weixin2"
|
||||
},
|
||||
{
|
||||
name: "支付宝",
|
||||
type: "alipay",
|
||||
icon: "icon-icon34"
|
||||
}
|
||||
],
|
||||
post: {
|
||||
extract_type: "weixin",
|
||||
alipay_code: "",
|
||||
money: "",
|
||||
name: "",
|
||||
bankname: "",
|
||||
cardnum: "",
|
||||
weixin: ""
|
||||
},
|
||||
currentTab: 0,
|
||||
minPrice: 0,
|
||||
banks: [],
|
||||
commissionCount: 0
|
||||
};
|
||||
},
|
||||
mounted: function () {
|
||||
this.getBank();
|
||||
},
|
||||
methods: {
|
||||
swichNav: function (index, item) {
|
||||
console.log(item);
|
||||
this.currentTab = index;
|
||||
this.post.extract_type = item.type;
|
||||
},
|
||||
currentTab: 0,
|
||||
minPrice: 0,
|
||||
banks: [],
|
||||
commissionCount: 0
|
||||
};
|
||||
},
|
||||
mounted: function() {
|
||||
this.getBank();
|
||||
},
|
||||
methods: {
|
||||
swichNav: function(index, item) {
|
||||
console.log(item);
|
||||
this.currentTab = index;
|
||||
this.post.extract_type = item.type;
|
||||
},
|
||||
getBank: function() {
|
||||
let that = this;
|
||||
getBank().then(
|
||||
res => {
|
||||
that.banks = res.data.extractBank;
|
||||
that.minPrice = res.data.minPrice;
|
||||
that.commissionCount = res.data.commissionCount;
|
||||
},
|
||||
function(err) {
|
||||
getBank: function () {
|
||||
let that = this;
|
||||
getBank().then(
|
||||
res => {
|
||||
that.banks = res.data.extractBank;
|
||||
that.minPrice = res.data.minPrice;
|
||||
that.commissionCount = res.data.commissionCount;
|
||||
},
|
||||
function (err) {
|
||||
uni.showToast({
|
||||
title: err.msg || err.response.data.msg || err.response.data.message,
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
}
|
||||
);
|
||||
},
|
||||
async submitted() {
|
||||
let bankname = this.post.bankname,
|
||||
alipay_code = this.post.alipay_code,
|
||||
money = this.post.money,
|
||||
name = this.post.name,
|
||||
cardnum = this.post.cardnum,
|
||||
weixin = this.post.weixin,
|
||||
that = this;
|
||||
// console.log(parseFloat(money))
|
||||
if (
|
||||
parseFloat(money) > parseFloat(that.commissionCount) ||
|
||||
parseFloat(that.commissionCount) == 0
|
||||
) {
|
||||
uni.showToast({
|
||||
title: err.msg || err.response.data.msg|| err.response.data.message,
|
||||
title: "余额不足",
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
return
|
||||
}
|
||||
);
|
||||
},
|
||||
async submitted() {
|
||||
let bankname = this.post.bankname,
|
||||
alipay_code = this.post.alipay_code,
|
||||
money = this.post.money,
|
||||
name = this.post.name,
|
||||
cardnum = this.post.cardnum,
|
||||
weixin = this.post.weixin,
|
||||
that = this;
|
||||
// console.log(parseFloat(money))
|
||||
if (
|
||||
parseFloat(money) > parseFloat(that.commissionCount) ||
|
||||
parseFloat(that.commissionCount) == 0
|
||||
)
|
||||
return that.$dialog.message("余额不足");
|
||||
if (parseFloat(money) < parseFloat(that.minPrice))
|
||||
return that.$dialog.message("最低提现金额" + that.minPrice);
|
||||
//console.log(that.post.extract_type)
|
||||
switch (that.post.extract_type) {
|
||||
case "alipay":
|
||||
// if (!name) {
|
||||
// uni.showToast({
|
||||
// title: "请输入支付宝用户名",
|
||||
// icon: "none",
|
||||
// duration: 2000
|
||||
// });
|
||||
// return;
|
||||
// }
|
||||
// if (!alipay_code) {
|
||||
// uni.showToast({
|
||||
// title: "请输入支付宝账号",
|
||||
// icon: "none",
|
||||
// duration: 2000
|
||||
// });
|
||||
// return;
|
||||
// }
|
||||
// if (!money) {
|
||||
// uni.showToast({
|
||||
// title: "请输入提现金额",
|
||||
// icon: "none",
|
||||
// duration: 2000
|
||||
// });
|
||||
// return;
|
||||
// }
|
||||
try {
|
||||
await this.$validator({
|
||||
name: [required(required.message("支付宝用户名"))],
|
||||
alipay_code: [required(required.message("支付宝账号"))],
|
||||
money: [required(required.message("提现金额"))]
|
||||
}).validate({ name, alipay_code, money });
|
||||
let save = {
|
||||
extractType: that.post.extract_type,
|
||||
alipayCode: alipay_code,
|
||||
name: name,
|
||||
money: money
|
||||
};
|
||||
that.save(save);
|
||||
} catch (e) {
|
||||
return validatorDefaultCatch(e);
|
||||
if (parseFloat(money) < parseFloat(that.minPrice)) {
|
||||
uni.showToast({
|
||||
title: "最低提现金额" + that.minPrice,
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
return
|
||||
}
|
||||
//console.log(that.post.extract_type)
|
||||
switch (that.post.extract_type) {
|
||||
case "alipay":
|
||||
// if (!name) {
|
||||
// uni.showToast({
|
||||
// title: "请输入支付宝用户名",
|
||||
// icon: "none",
|
||||
// duration: 2000
|
||||
// });
|
||||
// return;
|
||||
// }
|
||||
// if (!alipay_code) {
|
||||
// uni.showToast({
|
||||
// title: "请输入支付宝账号",
|
||||
// icon: "none",
|
||||
// duration: 2000
|
||||
// });
|
||||
// return;
|
||||
// }
|
||||
// if (!money) {
|
||||
// uni.showToast({
|
||||
// title: "请输入提现金额",
|
||||
// icon: "none",
|
||||
// duration: 2000
|
||||
// });
|
||||
// return;
|
||||
// }
|
||||
try {
|
||||
await this.$validator({
|
||||
name: [required(required.message("支付宝用户名"))],
|
||||
alipay_code: [required(required.message("支付宝账号"))],
|
||||
money: [required(required.message("提现金额"))]
|
||||
}).validate({
|
||||
name,
|
||||
alipay_code,
|
||||
money
|
||||
});
|
||||
let save = {
|
||||
extractType: that.post.extract_type,
|
||||
alipayCode: alipay_code,
|
||||
name: name,
|
||||
money: money
|
||||
};
|
||||
that.save(save);
|
||||
} catch (e) {
|
||||
return validatorDefaultCatch(e);
|
||||
}
|
||||
break;
|
||||
case "weixin":
|
||||
try {
|
||||
await this.$validator({
|
||||
weixin: [required(required.message("提现微信号"))],
|
||||
money: [required(required.message("提现金额"))]
|
||||
}).validate({
|
||||
weixin,
|
||||
money
|
||||
});
|
||||
let save = {
|
||||
extractType: that.post.extract_type,
|
||||
weixin: weixin,
|
||||
money: money
|
||||
};
|
||||
that.save(save);
|
||||
} catch (e) {
|
||||
return validatorDefaultCatch(e);
|
||||
}
|
||||
break;
|
||||
}
|
||||
},
|
||||
save: function (info) {
|
||||
postCashInfo(info).then(
|
||||
res => {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
this.$yrouter.push({
|
||||
path: "/pages/user/promotion/CashAudit/index"
|
||||
});
|
||||
},
|
||||
err => {
|
||||
uni.showToast({
|
||||
title: err.msg || err.response.data.msg || err.response.data.message,
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
}
|
||||
break;
|
||||
case "weixin":
|
||||
try {
|
||||
await this.$validator({
|
||||
weixin: [required(required.message("提现微信号"))],
|
||||
money: [required(required.message("提现金额"))]
|
||||
}).validate({ weixin, money });
|
||||
let save = {
|
||||
extractType: that.post.extract_type,
|
||||
weixin: weixin,
|
||||
money: money
|
||||
};
|
||||
that.save(save);
|
||||
} catch (e) {
|
||||
return validatorDefaultCatch(e);
|
||||
}
|
||||
break;
|
||||
);
|
||||
}
|
||||
},
|
||||
save: function(info) {
|
||||
postCashInfo(info).then(
|
||||
res => {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
this.router.push({ path: "/user/audit" });
|
||||
},
|
||||
err => {
|
||||
uni.showToast({
|
||||
title: err.msg || err.response.data.msg|| err.response.data.message,
|
||||
icon: "none",
|
||||
duration: 2000
|
||||
});
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
</script>
|
||||
<style lang="less">
|
||||
.cash-withdrawal .pos-order-list .nav .item.on {
|
||||
color: #eb3729
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -20,7 +20,6 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view class="bnt bg-color-red" @click="toCash">立即提现</view> -->
|
||||
<view class="list acea-row row-between-wrapper">
|
||||
<view class="item acea-row row-center-wrapper row-column" @click="goPoster()">
|
||||
<text class="iconfont icon-erweima"></text>
|
||||
|
||||
Reference in New Issue
Block a user