123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969 |
- <template>
- <view class="content">
- <header-title :title="'收款码'+$test.$test"></header-title>
- <view class="main">
- <view class="box-pack-between ft32 item flex-y-center">
- <text>收款码 <text style="color:red">*</text> <text class="tips">(扫码/相册选取)</text></text>
- <image @click="qrcode" class="qrupimg" data-type="1" src="../../static/images/saoma.png" mode=""></image>
- </view>
- <view class="qr_content box-pack-between">
- <view></view>
- <view>
- <view class="qr_content_img" v-for="(item,index) of qr_arr" :key="index">
- <image class="qr_content_img_li" :src="item.img" mode=""></image>
- <image @click="qr_del" :data-index="index" class="qr_content_img_del" src="../../static/images/shanchu.png" mode=""></image>
- </view>
- </view>
- </view>
- <!-- <block v-if="moshi==2"> -->
- <FlowPool :thismoshi="moshi" :rule_arr_val="ruleArr" :this_moshi_type="moshi_type" :list_way="list_way" @ondel="binddel"
- @oncheck="bindcheck" @onTime='bindtime' @confirm="bindConfirm" @bindlevel="bindlevel"></FlowPool>
- <!-- </block> -->
- <view v-if="moshi==1">
- <view class="box-pack-between ft32 item">
- <text>{{$test.$test}}场景 </text>
- <view class="add-home flex-center ft24">
- <picker @change="bindPickerChange" :range-key="'name'" :range="allwayList">
- 添加
- </picker>
- </view>
- </view>
- <view class="item-bg" v-if="arr.length>0">
- <view class="box-pack-between mar64 flex-y-center" v-for="(item,index) of arr" :key='item.id'>
- <view class="flex-y-center flex-grow-1 pdr-20">
- <text style="margin-right: 10rpx;">{{item.name}}</text>
- <input class="flex-grow-1" type="text" @input="getScene" :data-index="index" placeholder="请填写链接或内容"
- :value="item.way_power" maxlength="5000" />
- </view>
- <image class="item-del" @click="delScene" :data-index='index' src="../../static/images/del.png" mode=""></image>
- </view>
- </view>
- </view>
- <view class="">
- <view class="box-pack-between ft32 item">
- <text>配置中转页</text>
- <view class="flex-center ft24">
- <switch @change="bindMidState" :checked="mid_state==1?true:false" style="transform:scale(0.7)" />
- </view>
- </view>
- <!-- is_mid -->
- <view class="item-bg" v-if="mid_state==1?true:false">
- <view class="box-pack-between mgr57">
- <view class="flex-row">
- <text class="item-bg-32">中转页标题</text>
- <input type="text" @input="bindMidTitle" :value="mid_title" placeholder="请填写中转页标题" />
- </view>
- </view>
- <block v-if="Advertising.length>0">
- <view class="box-pack-between mgr57">
- <text class="item-bg-32" :data-index="Advertising[Adver_index].id">广告方式</text>
- <!-- <input style="display: none;" name="id" :value="Advertising[Adver_index].id" /> -->
- <picker @change="bindPickerAdvertising" :range-key="'name'" :range="Advertising">
- <text>{{Advertising[Adver_index].name}} <text class="iconfont icon-prev"></text></text>
- </picker>
- </view>
- <view class="box-pack-between flex-y-center" v-if="Advertising[Adver_index].name=='自定义引导页'">
- <text class="item-bg-32">广告引导页</text>
- <image @click="ChooseImage" data-type="2" v-if="mid_img" class="upimg" :data-url="Advertising[Adver_index].url"
- :src="URL+mid_img"></image>
- <image @click="ChooseImage" data-type="2" v-else class="upimg" src="../../static/images/upimg.png" mode=""></image>
- </view>
- <view class="box-pack-between flex-y-center" v-else-if="Advertising[Adver_index].name=='安全认证'">
- <text class="item-bg-32">广告引导页</text>
- <image mode="aspectFill" data-url="../../merchant/static/images/ali_ua.png" class="upimg" src="../../merchant/static/images/ali_ua.png"></image>
- <image mode="aspectFill" data-url="../../merchant/static/images/wx_ua.png" class="upimg" src="../../merchant/static/images/wx_ua.png"></image>
- <image mode="aspectFill" data-url="../../merchant/static/images/web_ua.png" class="upimg" src="../../merchant/static/images/web_ua.png"></image>
- </view>
- <view class="box-pack-between flex-y-center" v-else>
- <text class="item-bg-32">广告引导页</text>
- <image @click="Choose_img" mode="aspectFill" :data-url="URL+Advertising[Adver_index].url" class="upimg" :src="URL+Advertising[Adver_index].url"></image>
- </view>
- </block>
- </view>
- <text style="padding:0 40rpx;font-size: 12px;color: #999;">ps:{{$test.$test}}微信/支付宝钱包收款码,请勿关闭中转页</text>
- </view>
- <view class="box-pack-between ft32 item" v-if="mid_state==1?false:true">
- <text>开启遮盖指引</text>
- <view class="flex-center ft24">
- <switch :checked="hj_state==1?true:false" @change="bindHj" style="transform:scale(0.7)" />
- </view>
- </view>
- <view class="box-pack-between ft32 descp ">
- <textarea :value="description" @input="binddesc" maxlength="200" placeholder-class="desc-placeholder" :placeholder="$test.$test+'备注'"
- name='description' />
- </view>
-
- <view class="box-pack-between ft32 item">
- <view class="flex-center">
- <text>加入换量记录池</text>
- </view>
- <view class=" flex-center ft24">
- <switch name="is_exchange" @change="bindHl" :checked="is_exchange=='Y'?true:false" style="transform:scale(0.7)" />
- </view>
- </view>
- <view class="hg200rpx">
-
- </view>
-
- <view class="bottom-bar">
- <block v-if="card_num">
- <button @click="ScCode" type="2" class="btn2 flex-center">
- 确定修改
- </button>
- </block>
-
- <block v-else>
- <button @click="bangCode" type="1" class="btn1 flex-center">
- 绑定二维码
- </button>
- <button @click="ScCode" type="2" class="btn2 flex-center">
- 生成二维码
- </button>
- </block>
- </view>
- </view>
-
- </view>
-
-
- </template>
- <script>
- import HeaderTitle from '@/components/header/header-title.vue';
- import FlowPool from '@/components/flow-pool/flow-pool.vue';
- // #ifdef H5
- import getWXSign from "@/static/js/config.js";
- // #endif
-
- export default {
- components: {
- HeaderTitle,
- FlowPool,
- },
- data() {
- /*
- @param allwayList=[] 赋能平台
- @param arr 赋能内容
- @param result 绑定二维码链接
- @param url 二维码跳转链接
- @param URL 前缀链接
- @param card_num 卡号
- @param Advertising=[] 引导页数组
- @param Adver_index 引导页数组下标
- @param mid_type 判断引导页 中转类型
- @param mid_img 引导页自定义图片
- @param mid_state 引导页开启1 关闭2
- @param mid_title 引导页标题
- @param info 编辑返回数据
- @param qr_arr=[] 二维码内容
- */
- return {
-
- $test:this.$test.$test,
- act_index_time: 0,
- allwayList: [],
- arr: [],
- result: "",
- img_file: "",
- url: "",
- URL: getApp().globalData.URL,
- card_num: "",
- Advertising: [],
- Adver_index: 0,
- mid_type: "",
- mid_img: "",
- mid_state: 1,
- mid_title:"",
- hj_state:2,
- info: {},
- qr_arr: [],
- description:"",
- is_exchange:'N',
-
- moshi:1,
- moshi_type:2,
- list_way:[],
- ruleArr:[],
- powerpool_id:"",
- level_arr:[1,2,3],
- level:"",
- rule:"",
-
- }
- },
- onLoad(e) {
- uni.removeStorageSync("list_way");
- this.card_num = e.card_num;
- uni.setNavigationBarTitle({
- title:`收款码${this.$test.$test}`
- })
- if (!this.card_num) {
- this.allmuban();
- }
- this.allways();
- this.level=this.level_arr.join(",");
- },
-
- onShow() {
- // var aaa="https://payapp.weixin.qq.com"
- // console.log(aaa.length,"aaa")
-
- if(uni.getStorageSync("list_way")){
- this.list_way=uni.getStorageSync("list_way");
- if(this.way_index==3){
- for(let i of this.list_way){
- if(i.checked){
- this.powerpool_id=i.id
- }
- }
- }
- }
- },
-
- onHide(e) {
-
- },
-
- methods: {
- /*
- * @param bindMidState 中转页开关
- * @param Choose_img 预览图片
- * @param allmuban 中转页设置方式
- * @param getScene 赋能场景输入监听
- * @param delScene 赋能场景删除
- * @param bindPickerAdvertising 中转页选择确认
- * @param bindPickerChange 赋能场景确认
- * @param allways 赋能场景数据加载
- * @param qr_del 删除收款码
- * @param qrcode 扫码收款码
- * @param edit_detail 编辑内容
- * @param ScCode 生成二维码/修改二维码
- * @param Submit 保存/编辑
- * @param ChooseImage 上传图片
- * @param https 保存的公共方法
- * @param bangCode 绑定二维码
- * @param
- */
- // 流量池
- bindcheck(index) {
- uni.removeStorageSync("list_way");
- this.moshi = index;
- },
-
- binddel(index){
- this.list_way.splice(index, 1);
- },
- bindtime(index) {
- console.log("000",index)
- this.list_way=[];
- uni.removeStorageSync("list_way");
- this.moshi_type=index==1?1:2;
- this.way_index=index;
- if(index==1){
- uni.navigateTo({
- url: "../public/index"
- })
- }
- // 默认流量池
- if(index==3){
- uni.navigateTo({
- url: "../public/index?type=2"
- })
- }
- },
-
- // 获取时间
- bindConfirm(rule){
- console.log(rule,"aff")
- this.rule=rule;
- },
-
- bindlevel(e){
- console.log(e,"bindlevel")
- var level=[];
- for(var i of e){
- level.push(i.level)
- }
- this.level=level.join(",");
- },
- // 流量池end
-
- bindMidTitle(e){
- this.mid_title= e.detail.value;
- },
-
- bindMidState(e) {
- this.mid_state = e.target.value?1:2;
- },
-
- bindHj(e){
- this.hj_state = e.target.value?1:2;
- },
-
- bindHl(e){
- console.log( e.target.value)
- this.is_exchange = e.target.value?"Y":"N";
- },
-
-
- Choose_img(e) {
- var url = e.currentTarget.dataset.url
- uni.previewImage({
- urls: [url],
- })
- },
-
- binddesc(e){
- this.description = e.detail.value
- },
-
-
- allmuban() {
- this.request({
- url: "funeng/allmuban",
- }).then(res => {
- console.log(res, "res")
- if (res.code === '200') {
- res.data.push({
- name: "自定义引导页",
- id: "0",
- });
- if (this.card_num) {
- for (let i in res.data) {
- if (res.data[i].id == this.mid_type) {
- this.Adver_index = i;
- }
- }
- }
- this.Advertising = res.data;
- }
- }).catch((res) => {});
- },
- getScene(e) {
- var index = e.currentTarget.dataset.index;
- this.arr[index].way_power = e.detail.value;
- },
-
- delScene(e) {
- var index = Number(e.currentTarget.dataset.index);
- this.arr.splice(index,1);
- },
- bindPickerAdvertising(e) {
- this.Adver_index = e.detail.value;
- this.mid_img = "";
- },
- bindPickerChange: function(e) {
- console.log(e,this.allwayList, "bindPickerChange",)
- if (this.arr.length > 0) {
- for (let i of this.arr) {
- if (i.id == this.allwayList[e.target.value].id) {
- uni.showToast({
- title: "场景重复",
- icon: 'none'
- })
- return
- }
- }
- }
- this.arr.push({
- id:this.allwayList[e.target.value].id,
- name:this.allwayList[e.target.value].name,
- super_id:this.allwayList[e.target.value].super_id,
- });
- },
-
- allways() {
- this.request({
- url: "funeng/allways",
- data: {},
- }).then(res => {
- console.log(res, "res")
- if (res.code === '200') {
- this.allwayList=res.data;
- this.arr.push({
- id: res.data[0].id,
- name:res.data[0].name,
- super_id:res.data[0].super_id,
- });
- if (this.card_num) {
- this.edit_detail();
- }
- }
- }).catch((res) => {});
- },
- qr_del(e) {
- var index = e.currentTarget.dataset.index;
- this.qr_arr.splice(index, 1)
- },
- qrcode(e) {
- // #ifdef MP-WEIXIN
- uni.scanCode({
- scanType:['barCode', 'qrCode','datamatrix','pdf41'],
- success: (res) => {
- console.log('条码内容:',res,res.result);
- var result = res.result,
- qr_arr = this.qr_arr;
- console.log('内容:',result.substr(0, 28));
- if (result.substr(0, 3) == "wxp" || result.substr(0, 28) =="https://payapp.weixin.qq.com" ) {
- uni.showModal({
- title: '提示',
- content: '因接口调整,暂不支持微信收款码',
- showCancel: false,
- cancelText: '取消',
- confirmText: '确定',
- success: res => {},
- fail: () => {},
- complete: () => {}
- });
- return
- qr_arr.push({
- url: result,
- img: "../../static/images/pay_wx.png",
- type: 1
- })
- } else if (result.substr(0, 17) == "HTTPS://QR.ALIPAY" || result.substr(0, 17) == "https://qr.alipay") {
- qr_arr.push({
- url: result,
- img: "../../static/images/pay_ali.png",
- type: 2
- })
- } else if(result.substr(0, 17) =="https://i.qianbao")
- {
- qr_arr.push({
- url: result,
- img: "../../static/images/qq.com",
- type: 5
- })
- }
- else {
- qr_arr.push({
- url: result,
- img: "../../static/images/pay_jh.png",
- type: 3
- })
- }
- this.qr_arr = uniqeByKeys(qr_arr, ['type']);
- console.log(this.qr_arr, "qr_arr")
- //将对象元素转换成字符串以作比较
- function obj2key(obj, keys) {
- var n = keys.length,
- key = [];
- while (n--) {
- key.push(obj[keys[n]]);
- }
- return key.join('|');
- }
- //去重操作
- function uniqeByKeys(array, keys) {
- var arr = [];
- var hash = {};
- for (var i = 0, j = array.length; i < j; i++) {
- var k = obj2key(array[i], keys);
- if (!(k in hash)) {
- hash[k] = true;
- arr.push(array[i]);
- }
- }
- return arr;
- }
- },
- })
- // #endif
-
- // #ifdef H5
- getWXSign().then(res => {
- console.log('wx_getLocation');
- this.$wx.scanQRCode({
- needResult: 1, // 默认为0,扫描结果由微信处理,1则直接返回扫描结果,
- scanType: ["qrCode", "barCode"], // 可以指定扫二维码还是一维码,默认二者都有
- success: (res) => {
- console.log(res, "qrCode")
- var result = res.resultStr,
- qr_arr = this.qr_arr;
- if (result.substr(0, 3) == "wxp") {
- qr_arr.push({
- url: result,
- img: "../../static/images/pay_wx.png",
- type: 1
- })
- } else if (result.substr(0, 17) == "HTTPS://QR.ALIPAY" || result.substr(0, 10) == "https://qr.alipay") {
- qr_arr.push({
- url: result,
- img: "../../static/images/pay_ali.png",
- type: 2
- })
- }
- else if(result.substr(0, 17) =="https://i.qianbao"){
- qr_arr.push({
- url: result,
- img: "../../static/images/qq.com",
- type: 5
- })
- }else {
- qr_arr.push({
- url: result,
- img: "../../static/images/pay_jh.png",
- type: 3
- })
- }
- this.qr_arr = uniqeByKeys(qr_arr, ['type']);
- console.log(this.qr_arr, "qr_arr")
- //将对象元素转换成字符串以作比较
- function obj2key(obj, keys) {
- var n = keys.length,
- key = [];
- while (n--) {
- key.push(obj[keys[n]]);
- }
- return key.join('|');
- }
- //去重操作
- function uniqeByKeys(array, keys) {
- var arr = [];
- var hash = {};
- for (var i = 0, j = array.length; i < j; i++) {
- var k = obj2key(array[i], keys);
- if (!(k in hash)) {
- hash[k] = true;
- arr.push(array[i]);
- }
- }
- return arr;
- }
- }
- })
- })
- // #endif
- },
- edit_detail(e) {
- this.request({
- url: "funeng/edit_detail",
- data: {
- card_num: this.card_num,
- },
- }).then(res => {
- console.log(res, "res")
- if (res.code === '200') {
- this.info = res.data;
- // this.img_file = res.data.img_file;
- this.description= res.data.description;
-
- this.arr = res.data.funeng;
-
- this.url = res.data.url;
-
- this.mid_img = res.data.mid_img;
-
- this.mid_type = res.data.mid_type;
-
- this.mid_state = res.data.mid_state;
-
- this.mid_title = res.data.mid_title;
-
- this.hj_state=res.data.hj_state;
-
- this.is_exchange=res.data.is_exchange;
-
- var qr_arr= res.data.urls;
-
- this.moshi = res.data.moshi;
-
- this.moshi_type=res.data.moshi_type;
-
- this.ruleArr=res.data.rule_arr;
-
- console.log(this.moshi_type,"moshi_type")
-
- if(this.moshi==2){
- if(this.moshi_type==2){
- var a = []
- for(let i of res.data.rule_arr){
- a.push(i.type)
- }
- // 去除重复的数
- var b = []
- for (var i = 0; i < a.length; i++) {
- if (b.indexOf(a[i]) === -1) {
- b.push(a[i])
- }
- }
- this.level=b.join(",");
- this.powerpool_id=res.data.powerpool_id;
- }
- for(let i of res.data.powerpool){
- i.checked=true;
- }
- this.list_way=res.data.powerpool;
- }
-
- for(let i in qr_arr){
- if(qr_arr[i].pay_company==1){
- qr_arr[i].type=1;
- qr_arr[i].img="../../static/images/pay_wx.png";
- }
-
- if(qr_arr[i].pay_company==2){
- qr_arr[i].type=2;
- qr_arr[i].img="../../static/images/pay_ali.png";
- }
-
- if(qr_arr[i].pay_company==5){
- qr_arr[i].type=5;
- qr_arr[i].img="../../static/images/qq.png";
- }
-
- if(qr_arr[i].pay_company==3||qr_arr[i].pay_company==4){
- qr_arr[i].type=3;
- qr_arr[i].img="../../static/images/pay_jh.png";
- }
- }
-
- this.qr_arr=qr_arr;
- this.allmuban();
- }
- }).catch((res) => {});
- },
- bangCode(e) {
- console.log(e, "bangCode")
- // #ifdef MP-WEIXIN
- uni.scanCode({
- success: (res) => {
- console.log('条码类型:' + res.scanType);
- console.log('条码内容:' + res.result);
- var params = (() => {
- var search = res.result; //获取location的search属性,保存在search中
- var params = {}; //创建空对象params
- if (search != "") { //如果search不是空字符串
- search.slice(1).split("?").forEach( //?username=zhangdong&pwd=123456;//search去开头?,按&切割为数组,forEach
- function(val) {
- var arr = val.split("="); //将当前元素值按=切割,保存在arr中
- params[arr[0]] = arr[1]; //向params中添加一个元素,属性名为arr[0],值为arr[1]
- }
- );
- }
- return params; //返回params
- })();
- this.result = params.card_num;
- this.https(1)
- }
- });
- // #endif
- // #ifdef H5
- getWXSign().then(res => {
- console.log('wx_getLocation');
- this.$wx.scanQRCode({
- needResult: 1, // 默认为0,扫描结果由微信处理,1则直接返回扫描结果,
- scanType: ["qrCode", "barCode"], // 可以指定扫二维码还是一维码,默认二者都有
- success: (res) => {
- console.log(res, "qrCode")
- // this.result = res.resultStr;
- var params = (() => {
- var search = res.resultStr; //获取location的search属性,保存在search中
- var params = {}; //创建空对象params
- if (search != "") { //如果search不是空字符串
- search.slice(1).split("?").forEach( //?username=zhangdong&pwd=123456;//search去开头?,按&切割为数组,forEach
- function(val) {
- var arr = val.split("="); //将当前元素值按=切割,保存在arr中
- params[arr[0]] = arr[1]; //向params中添加一个元素,属性名为arr[0],值为arr[1]
- }
- );
- }
- return params; //返回params
- })();
- this.result = params.card_num;
- this.https(1)
- }
- })
- })
- // #endif
- },
- ScCode(e) {
- this.https(2)
- },
-
- https(type) {
- let arr = this.arr,
- qr_arr=this.qr_arr,
- ul=[],
- way_id = [],
- way_power = [];
- for (let i of arr) {
- way_id.push(i.id);
- way_power.push(i.way_power)
- }
- for (let i of qr_arr) {
- ul.push(i.url);
- }
- var powerpool_id ="";
- if(this.moshi_type==1){
- var powerpool_arr = [];
- for (let i of this.list_way) {
- if (i.checked) {
- powerpool_arr.push(i.id);
- }
- }
- powerpool_id=powerpool_arr.join(",");
- }else{
- powerpool_id=this.powerpool_id;
- }
- if (way_power.length <= 0) {
- uni.showToast({
- title: "场景为空",
- icon: 'none'
- })
- return
- }
- if (!ul) {
- uni.showToast({
- title: "收款图片为空",
- icon: 'none'
- })
- return
- }
-
- let data = {
- token: uni.getStorageSync("token"),
- type: 1,
- paycode_type: 1,
-
- // 1图片2链接
- // paycode_img: this.img_file,
- // img_file: this.img_file,
-
- paycode_num:1,
-
- url_arr:ul.join(","),
-
- url:ul.join(","),
-
- way_id: way_id.join(","),
-
- way_power: way_power.join(","),
-
- save_type: type,
-
-
- qrcode: this.result,
-
- hj_state:this.hj_state,
-
- mid_state: this.mid_state,
-
- mid_title:this.mid_title,
-
- mid_type:this.Advertising[this.Adver_index].id,
-
- mid_img: this.Advertising[this.Adver_index].id == "0" ? this.mid_img : this.Advertising[this.Adver_index].thumb,
-
- description: this.description,
-
- is_exchange:this.is_exchange,
-
- moshi:this.moshi,
-
- moshi_type:this.moshi_type,
-
- powerpool_id:powerpool_id,
-
- level:this.level,
-
- rule:this.rule,
- }
-
- let url;
-
- this.card_num ? (data.code = this.info.code, url = "funeng/save_edit") : url = "funeng/paycode";
-
- //请求验证码
- this.request({
- url,
- data,
- }).then(res => {
- console.log(res, "res")
- if (res.code === '200') {
- this.card_num ? (
- uni.showToast({
- title: "设置成功",
- icon: 'none'
- }),
- setTimeout(() => {
- uni.navigateBack({
- delta: 1
- })
- }, 2e3)
- ) : (
- uni.showToast({
- title: "生成成功",
- icon: 'none'
- }),
- uni.redirectTo({
- url: "code?type=1" + '&card_num=' + res.data.card_num
- })
- )
- }
- }).catch((res) => {
- uni.showToast({
- title: res.message,
- icon: 'none'
- })
- });
- },
- ChooseImage(e) {
- console.log(e, "rrr")
- let type = e.currentTarget.dataset.type;
- uni.chooseImage({
- count: 1, //默认9
- sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
- sourceType: ['album'], //从相册选择
- success: (res) => {
- res.tempFilePaths.forEach((v, i) => {
- console.log(v)
- this.Upload({
- url: "Spread/upload_img",
- data: {
- url: v,
- type: type == 1 ? 1 : 0,
- token: uni.getStorageSync("token"),
- }
- }).then(res => {
- if (type == 1) {
- this.img_file = res.file
- this.url = res.url
- } else {
- this.mid_img = res.file
- }
- console.log(res, "res")
- }).catch(err => {
- console.log(err, "err")
- uni.showToast({
- title: err.message,
- icon: 'none'
- })
- });
- })
- },
- });
- },
- }
- }
- </script>
- <style>
- .qr_content {
- padding: 0 40rpx;
- }
- .qr_content_img {
- display: inline-block;
- position: relative;
- }
- .qr_content_img .qr_content_img_li {
- margin-left: 20rpx;
- width: 120rpx;
- height: 120rpx;
- }
- .qr_content_img_del {
- width: 40rpx;
- height: 40rpx;
- position: absolute;
- top: 0;
- right: 0;
- }
- .tr {
- text-align: right;
- }
- .pdr-20 {
- padding-right: 20rpx;
- }
- .item {
- padding: 32rpx 40rpx;
- }
- .upimg {
- width: 126rpx;
- height: 126rpx;
- }
- .add-home {
- color: #FFFFFF;
- width: 126rpx;
- height: 54rpx;
- background: linear-gradient(315deg, #3387ff 2%, #569bff 99%);
- border-radius: 8rpx;
- box-shadow: 0px 0px 8rpx 0px rgba(51, 135, 255, 0.2);
- }
- .item-bg {
- width: 670rpx;
- /* height: 298rpx; */
- background: #f6f8fe;
- border-radius: 12rpx;
- margin: 0 auto;
- font-size: 28rpx;
- font-family: PingFang SC, PingFang SC-Regular;
- font-weight: 400;
- color: #333333;
- padding: 36rpx 32rpx;
- }
- .item-del {
- width: 40rpx;
- height: 40rpx;
- }
- .mar64 {
- margin-bottom: 64rpx;
- }
-
- .item-bg .mar64:last-child {
- margin-bottom: 0rpx;
- }
- .hg200rpx {
- height: 100rpx;
- }
- .mgr57 {
- margin-bottom: 57rpx;
- }
- .item-bg-32 {
- margin-right: 32rpx;
- }
- .qrupimg {
- width: 80rpx;
- height: 80rpx;
- }
- .tips{
- font-size: 26rpx;
- color: #999;
- }
-
- </style>
|