123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482 |
- <template>
- <view class="center">
- <view class="product" v-for="(item, index) in productList">
- <view class="product-top flex">
- <image class="product-image" :src="item.image" mode=""></image>
- <view class="product-info">
- <view class="title">{{ item.store_name }}</view>
- <view class="title buyId">x{{ item.num }}</view>
- <view class="title buyName">¥{{ item.price * 1 * item.num }}</view>
- </view>
- </view>
- <view class="product-bottom flex">
- <view class="product-bottom-left">购买数量</view>
- <view class="product-bottom-right">
- <uni-number-box class="step" :isMin="true" :value="num" :min="0" :max="100" @eventChange="numberChange(item, arguments)"></uni-number-box>
- </view>
- </view>
- </view>
- <view class="main" v-if="bank">
- <view class="main-tip">请向以下银行账号自行转账</view>
- <view class="tc-item flex">
- <view class="tcitem-name">姓名</view>
- <view class="ali-name">{{ bank.bank_name }}</view>
- <image class="tcitem-image" src="../../static/img/copy.png" mode="" @click="copy(bank.bank_name)"></image>
- </view>
- <view class="tc-item flex">
- <view class="tcitem-name">银行</view>
- <view class="ali-name">{{ bank.bank }}</view>
- <image class="tcitem-image" src="../../static/img/copy.png" mode="" @click="copy(bank.bank)"></image>
- </view>
- <view class="tc-item flex">
- <view class="tcitem-name">开户行</view>
- <view class="ali-name">{{ bank.sub_branch }}</view>
- <image @click="copy(bank.sub_branch)" class="tcitem-image" src="../../static/img/copy.png" mode=""></image>
- </view>
- <view class="tc-item flex">
- <view class="tcitem-name">账号</view>
- <view class="ali-name">{{ bank.bank_number }}</view>
- <image class="tcitem-image" src="../../static/img/copy.png" mode="" @click="copy(bank.bank_number)"></image>
- </view>
- <view class="tc-item flex">
- <view class="tcitem-name">说明</view>
- <view class="ali-name" style="color: #FD3B39;">请务必上传付款截图,否则不发货</view>
- <view class="tcitem-image"></view>
- </view>
- <view class="tc-item">
- <view class="upload-title" style="color: #9d9d9d;">二维码</view>
- <view class="upload-main" @click="lookimg(bank.code)"><image class="upload-image" :src="bank.code" mode="aspectFit"></image></view>
- </view>
- </view>
- <view class="upload">
- <view class="upload-title">上传支付截图</view>
- <view class="upload-main">
- <image class="upload-image" src="../../static/img/add.png" mode="" v-if="!image" @click="uploads()"></image>
- <image class="upload-image" :src="image" mode="" @click="uploads()" v-if="image"></image>
- <view class="upload-font">点击上传支付截图</view>
- </view>
- </view>
- <view class="contentBottomHeight"></view>
- <view class="bottom flex">
- <view class="bottom-item" @click.stop="openKf()">
- <image class="bi-image" src="../../static/img/kf.png" mode=""></image>
- <view class="bottom-font">联系客服</view>
- </view>
- <view class="btn" @click.stop="buy()">完成上传</view>
- </view>
- <uni-popup ref="popupkf" type="center">
- <view class="popup-box">
- <view class="img"><image src="../../static/img/img009.png" mode=""></image></view>
- <view class="mian">
- <view class="delivery">
- <view class="title">已经为您定制专属客服</view>
- <image src="../../static/img/img010.png" mode=""></image>
- </view>
- <view class="nocancel">客服VX:{{ text }}</view>
- <view class="comfirm-box">
- <view class="cancel" @click="cancel">取消</view>
- <view class="comfirm" @click="copy(text)">复制微信</view>
- </view>
- </view>
- </view>
- </uni-popup>
- </view>
- </template>
- <script>
- import uniCountdowns from '@/components/uni-countdown/uni-countdowns.vue';
- import uniCopy from '@/components/js_sdk/xb-copy/uni-copy.js';
- import { upload, bank } from '@/api/order.js';
- import { getProducts, purchase } from '@/api/product.js';
- import { timeComputed } from '@/utils/rocessor.js';
- import uniNumberBox from '@/components/uni-number-box.vue';
- export default {
- components: {
- uniCountdowns,
- uniNumberBox
- },
- data() {
- return {
- num: 0,
- type: 1,
- productList: [],
- buyList: {},
- tabCurrentIndex: 0,
- bank: '',
- image: '',
- text: '123456'
- };
- },
- onLoad(option) {
- this.id = option.ordid;
- this.loadData();
- if (option.type) {
- this.type = option.type;
- }
- },
- methods: {
- uploads() {
- upload({
- filename: ''
- }).then(data => {
- this.image = data[0].url;
- console.log(this.image);
- });
- },
- loadData() {
- getProducts({ pages: 1, limit: 1000 }).then(({ data }) => {
- data.forEach(e => {
- e.num = 0;
- console.log(e, '123456');
- });
- this.productList = data;
- });
- bank({}).then(({ data }) => {
- this.bank = data;
- });
- },
- nav(url) {
- uni.navigateTo({
- url
- });
- },
- copy(value) {
- let obj = this;
- let content = value; //需要复制的内容
- console.log('复制的内容:', content);
- // content = typeof content === 'string' ? content : content.toString(); // 复制内容,必须字符串,数字需要转换为字符串
- const result = uniCopy(content);
- if (result === false) {
- uni.showToast({
- title: '不支持'
- });
- } else {
- uni.showToast({
- title: '复制成功',
- icon: 'none'
- });
- }
- },
- tocall() {
- let num = this.zfb != '' ? this.zfb.phone : this.wx != '' ? this.wx.phone : this.bank.phone;
- console.log(num);
- uni.makePhoneCall({
- phoneNumber: num //仅为示例
- });
- },
- // 查看大图
- lookimg(src) {
- console.log(src);
- let arr = [src];
- uni.previewImage({
- current: src,
- urls: arr
- });
- },
- //swiper 切换
- changeTab(e) {
- this.tabCurrentIndex = e.target.current;
- },
- toBack() {
- uni.navigateBack({});
- },
- change(num) {
- this.tabCurrentIndex = num * 1;
- },
- // 打开客服
- openKf() {
- this.$refs.popupkf.open();
- },
- // 关闭客服
- cancel() {
- this.$refs.popupkf.close();
- },
- // 购买数量变化
- numberChange(e, num) {
- const obj = this;
- obj.buyList[e.id] = num[0].number;
- e.num = num[0].number;
- if (num[0].number == 0) {
- Reflect.deleteProperty(obj.buyList, e.id);
- }
- console.log(obj.buyList);
- },
- buy() {
- console.log(this.buyList);
- if (this.buyList === {}) {
- console.log(111);
- return this.$api.msg('请选择进货商品');
- }
- if (this.image == '') {
- return this.$api.msg('请上传支付凭证');
- }
- purchase({ image: this.image, product_id: this.buyList }).then(e => {
- uni.navigateTo({
- url: '/pages/shop/sucess?type=2'
- });
- });
- }
- }
- };
- </script>
- <style lang="less">
- .center {
- background: #f8f6f6;
- min-height: 100%;
- height: auto;
- }
- .product-top {
- margin-top: 20rpx;
- padding: 35rpx 35rpx 40rpx 35rpx;
- background-color: #ffffff;
- justify-content: flex-start;
- align-items: flex-start;
- border-bottom: 1px solid #eeeeee;
- .product-image {
- width: 210rpx;
- height: 210rpx;
- border-radius: 10rpx;
- }
- .product-info {
- margin-left: 26rpx;
- padding-top: 10rpx;
- line-height: 1;
- .title {
- font-size: 35rpx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #333333;
- }
- .buyId {
- font-size: 26rpx;
- font-weight: 500;
- color: #999999;
- margin-top: 30rpx;
- }
- .buyName {
- margin-top: 82rpx;
- color: #fd3b39;
- }
- }
- }
- .product-bottom {
- padding: 30rpx 24rpx 24rpx;
- background: #ffffff;
- .product-bottom-left {
- font-size: 28rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #333333;
- }
- }
- .main {
- margin-top: 20rpx;
- padding: 30rpx 0 40rpx;
- background: #ffffff;
- .main-tip {
- padding: 0 30rpx;
- font-size: 30rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #999999;
- }
- }
- .tc-item {
- padding: 50rpx 30rpx 0;
- line-height: 1;
- .tcitem-name {
- width: 100rpx;
- font-size: 30rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #999999;
- }
- .ali-name {
- width: 440rpx;
- font-size: 30rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #333333;
- }
- .tcitem-image {
- width: 26rpx;
- height: 28rpx;
- }
- }
- .upload-image {
- width: 160rpx;
- height: 160rpx;
- border-radius: 10rpx;
- }
- .upload-title {
- font-size: 30rpx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #333333;
- }
- .upload-main {
- padding-top: 32rpx;
- display: flex;
- justify-content: center;
- align-items: center;
- flex-direction: column;
- .upload-font {
- margin-top: 24rpx;
- font-size: 30rpx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #333333;
- }
- }
- .upload {
- margin-top: 20rpx;
- padding: 34rpx 30rpx 40rpx 30rpx;
- background: #ffffff;
- }
- .bottom {
- position: fixed;
- bottom: 0;
- background: #ffffff;
- width: 750rpx;
- height: 146rpx;
- justify-content: flex-start;
- .bottom-item {
- margin-left: 30rpx;
- display: flex;
- flex-direction: column;
- align-items: center;
- .bi-image {
- width: 38rpx;
- height: 34rpx;
- }
- .bottom-font {
- margin-top: 14rpx;
- font-size: 24rpx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #333333;
- }
- .bottom-num {
- line-height: 1;
- font-size: 24rpx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #333333;
- }
- }
- .shu {
- margin-left: 20rpx;
- width: 2px;
- height: 74rpx;
- background: #c0bfc0;
- }
- .btn {
- margin-left: 20rpx;
- width: 570rpx;
- height: 80rpx;
- background: #fd3b39;
- border-radius: 20rpx;
- text-align: center;
- font-size: 34rpx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #ffffff;
- line-height: 80rpx;
- }
- }
- // 文章页底部高度撑开
- .contentBottomHeight {
- height: 150rpx;
- }
- .popup-box {
- width: 522rpx;
- height: 605rpx;
- background-color: #ffffff;
- border-radius: 20rpx;
- position: relative;
- .img {
- position: relative;
- top: -56rpx;
- left: 0;
- width: 522rpx;
- height: 132rpx;
- display: flex;
- justify-content: center;
- image {
- border-radius: 20rpx 20rpx 0 0;
- width: 450rpx;
- height: 132rpx;
- }
- }
- .mian {
- margin-top: -44rpx;
- display: flex;
- flex-direction: column;
- align-items: center;
- // padding: 32rpx 32rpx;
- background-color: #ffffff;
- border-radius: 0 0 20rpx 20rpx;
- text-align: center;
- .delivery {
- font-size: 40rpx;
- color: #333333;
- display: flex;
- align-items: center;
- flex-direction: column;
- .title {
- }
- image {
- margin-top: 48rpx;
- width: 172rpx;
- height: 160rpx;
- }
- }
- .nocancel {
- font-size: 32rpx;
- color: #333333;
- margin-top: 14rpx;
- }
- .comfirm-box {
- margin-top: 52rpx;
- display: flex;
- // margin-bottom: 32rpx;
- // justify-content: space-around;
- .cancel {
- display: flex;
- align-items: center;
- justify-content: center;
- width: 197rpx;
- height: 74rpx;
- border: 1px solid #dcc786;
- border-radius: 38rpx;
- font-size: 32rpx;
- color: #605128;
- }
- .comfirm {
- margin-left: 32rpx;
- display: flex;
- align-items: center;
- justify-content: center;
- width: 197rpx;
- height: 74rpx;
- background: linear-gradient(-90deg, #d1ba77 0%, #f7e8ad 100%);
- border-radius: 38px;
- font-size: 32rpx;
- color: #605128;
- }
- }
- }
- }
- </style>
|