You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

2168 lines
74 KiB

<template>
<scroll-view class="createCommodity" :style="{ height: phoneHight }" :scroll-y="true" :scroll-x="false">
<far-bottom></far-bottom>
<!-- 商品信息区域 -->
<view class="main">
<view class="mianPackage">
<picker mode="selector" :value="newTypeIndex" :range="newTypeList" range-key="name" @change="changeNewType" :disabled="slectDis">
<view class="dis-flex inputView diy-nav-list border-line border-bottom">
<view><text class="titleTetx">商品类型</text></view>
<view v-if="!!newTypeList[newTypeIndex] && !!newTypeList[newTypeIndex].name">
<text class="contentTetx verMid">{{ newTypeList[newTypeIndex].name }}</text>
<image :src="imgfixUrls + 'merchant/right.svg'" class="rightImg verMid"></image>
</view>
<!-- <view v-if="!!typeList[type] && !!typeList[type].name">
<text class="contentTetx verMid">{{ typeList[type].name }}</text>
<image :src="imgfixUrls + 'merchant/right.svg'" class="rightImg verMid"></image>
</view> -->
</view>
</picker>
<view class="dis-flex inputView diy-nav-list border-line border-bottom" @click="showInput('请点击输入商品名称')">
<view>
<text class="titleTetx">
商品名称
<text class="colorRed">*</text>
</text>
</view>
<view>
<text class="contentTetx verMid">{{ goodsNameText }}</text>
<image :src="imgfixUrls + 'merchant/right.svg'" class="rightImg verMid"></image>
</view>
</view>
<!-- <view class="dis-flex inputView diy-nav-list border-line border-bottom">
<view><text class="titleTetx">商品单位</text></view>
<view><input placeholder="请输入商品单位" class="inputMain" v-model="goodsInfo.goods.unit" /></view>
</view> -->
<picker mode="selector" :value="newCateIndex" :range="newCateList" range-key="name" @change="changeNewCate">
<view class="dis-flex inputView diy-nav-list border-line border-bottom">
<view><text class="titleTetx">商品分类</text></view>
<view>
<text class="contentTetx verMid">{{ newCateText }}</text>
<image :src="imgfixUrls + 'merchant/right.svg'" class="rightImg verMid"></image>
</view>
</view>
</picker>
<!-- <picker mode="multiSelector" :value="cateTwo" :range="cateLists" range-key="name" @change="changeCateTwo" v-if="!!typeList[type]&&typeList[type].value == 'groupon'"
@columnchange="watchCateTwo">
<view class="dis-flex inputView diy-nav-list border-line border-bottom">
<view><text class="titleTetx">商品分类</text></view>
<view>
<text class="contentTetx verMid">{{ cateText }}</text>
<image :src="imgfixUrls + 'merchant/right.svg" class="rightImg verMid"></image>
</view>
</view>
</picker> -->
<view class="dis-flex inputView diy-nav-list border-line border-bottom">
<view><text class="titleTetx">活动开始时间</text></view>
<view>
<view class="pickerPackage" @tap="dataTimeShow1">
<text class="contentTetx verMid">{{ starttimeText }}</text>
</view>
<image :src="imgfixUrls + 'merchant/right.svg'" class="rightImg verMid"></image>
</view>
</view>
<view class="dis-flex inputView diy-nav-list border-line border-bottom">
<view><text class="titleTetx">活动结束时间</text></view>
<view>
<view class="pickerPackage" @tap="dataTimeShow2">
<text class="contentTetx verMid">{{ endtimeText }}</text>
</view>
<image :src="imgfixUrls + 'merchant/right.svg'" class="rightImg verMid"></image>
</view>
</view>
<view class="uploadView diy-nav-list border-line border-bottom">
<view><text class="uploadTetx verMid">缩略图</text></view>
<view class="verMid uploadButton">
<!-- 图片预览循环模板 -->
<view class="imgPreview" v-if="thumb != ''">
<image :src="thumb" />
<image :src="imgfixUrls + 'merchant/close.png'" class="close" @click="closeImg(1)" />
</view>
<!-- 图片预览循环模板 -->
<view class="userImgUpdata" @click="updataImg(1, 1)" v-else>
<image :src="imgfixUrls + 'merchant/addImg.svg'" />
</view>
<view class="f-20 col-9" v-if="thumb == ''">建议尺寸:640X640</view>
</view>
</view>
<view class="uploadView">
<view><text class="uploadTetx verMid">轮播图</text></view>
<view class="verMid uploadButton">
<!-- 图片预览循环模板 -->
<block v-for="(item, index) in thumbs" class="verMid">
<view class="imgPreview verMid" v-if="thumbs.length != '0'">
<image :src="item" />
<image :src="imgfixUrls + 'merchant/close.png'" class="close" @click="closeImg(2, index)" />
</view>
</block>
<!-- 图片预览循环模板 -->
<view class="userImgUpdata verMid" @click="updataImg(2, 6)" v-if="thumbs.length < 7">
<image :src="imgfixUrls + 'merchant/addImg.svg'" />
</view>
<view class="f-20 col-9" v-if="thumbs.length == 0">建议尺寸:750X560</view>
</view>
</view>
</view>
</view>
<!-- 商品信息区域 -->
<!-- 商品规格区域 -->
<view class="main marT20" v-if="!isSpecBox">
<view class="mianPackage">
<view class="dis-flex inputView diy-nav-list border-line border-bottom" @click="specsPopShow" v-if="!!typeList[type]&&typeList[type].value != 'bargain'">
<view><text class="titleTetx">商品规格</text></view>
<view>
<text class="contentTetx verMid">{{ specsText }}</text>
<image :src="imgfixUrls + 'merchant/right.svg'" class="rightImg verMid"></image>
</view>
</view>
<picker mode="selector" :value="is_describe_tip" :range="noticeList" @change="changenotice">
<view class="dis-flex inputView diy-nav-list border-line border-bottom">
<view><text class="titleTetx">是否开启购买须知提醒</text></view>
<view>
<text class="contentTetx verMid">{{ noticeList[is_describe_tip] }}</text>
<image :src="imgfixUrls + 'merchant/right.svg'" class="rightImg verMid"></image>
</view>
</view>
</picker>
<picker mode="selector" :value="isladderVel" :range="isladder" range-key="name" @change="changeladder" v-if="goodsInfo.type == 'rush'">
<view class="dis-flex inputView diy-nav-list border-line border-bottom">
<view><text class="titleTetx">是否启用阶梯价</text></view>
<view>
<text class="contentTetx verMid">{{ isladder[isladderVel].name }}</text>
<image :src="imgfixUrls + 'merchant/right.svg'" class="rightImg verMid"></image>
</view>
</view>
</picker>
<view class="dis-flex inputView diy-nav-list border-line border-bottom" @click="ladderPopShow" v-if="goodsInfo.type == 'rush' && isladderVel == 1">
<view><text class="titleTetx">商品阶梯价</text></view>
<view>
<text class="contentTetx verMid">阶梯价设置</text>
<image :src="imgfixUrls + 'merchant/right.svg'" class="rightImg verMid"></image>
</view>
</view>
<view class="dis-flex inputView diy-nav-list border-line border-bottom" @click="optionsPopShow" v-if="goodsInfo.goods.optionstatus != '0' && (!!typeList[type]&&typeList[type].value != 'bargain')">
<view><text class="titleTetx">子规格详情</text></view>
<view>
<text class="contentTetx verMid">价格,库存</text>
<image :src="imgfixUrls + 'merchant/right.svg'" class="rightImg verMid"></image>
</view>
</view>
<view class="dis-flex inputView diy-nav-list border-line border-bottom" @click="showPresettagsPop">
<view><text class="titleTetx">商品标签</text></view>
<view>
<text class="contentTetx verMid">{{ presettagsText }}</text>
<image :src="imgfixUrls + 'merchant/right.svg'" class="rightImg verMid"></image>
</view>
</view>
<view class="dis-flex inputView diy-nav-list border-line border-bottom" @click="showRichtext">
<view><text class="titleTetx">商品详情</text></view>
<view>
<text class="contentTetx verMid">商品详情富文本</text>
<image :src="imgfixUrls + 'merchant/right.svg'" class="rightImg verMid"></image>
</view>
</view>
<view class="dis-flex inputView diy-nav-list border-line border-bottom" @click="shownoticetext" v-if="goodsInfo['goods'].is_describe_tip == 1">
<view><text class="titleTetx">购买须知</text></view>
<view>
<text class="contentTetx verMid">购买须知富文本</text>
<image :src="imgfixUrls + 'merchant/right.svg'" class="rightImg verMid"></image>
</view>
</view>
<view class="dis-flex inputView diy-nav-list border-line border-bottom" v-if="!!typeList[type]&&typeList[type].value == 'bargain'"
@click="rulePopShow">
<view><text class="titleTetx">砍价规则</text></view>
<view>
<text class="contentTetx verMid">请添加砍价规则</text>
<image :src="imgfixUrls + 'merchant/right.svg'" class="rightImg verMid"></image>
</view>
</view>
<picker mode="selector" :value="goodsInfo.goods.usestatus" :range="usestatusList" range-key="name" @change="changeUsestatus">
<view class="dis-flex inputView diy-nav-list border-line border-bottom">
<view><text class="titleTetx">消费方式</text></view>
<view>
<text class="contentTetx verMid">{{ usestatusText }}</text>
<image :src="imgfixUrls + 'merchant/right.svg'" class="rightImg verMid"></image>
</view>
</view>
</picker>
<picker mode="selector" :value="express" :range="expressList" range-key="name" @change="changeExpress" v-if="goodsInfo.goods.usestatus == '1' || goodsInfo.goods.usestatus == '2'">
<view class="dis-flex inputView diy-nav-list border-line border-bottom">
<view><text class="titleTetx">快递模板</text></view>
<view>
<text class="contentTetx verMid">{{ expresseText }}</text>
<image :src="imgfixUrls + 'merchant/right.svg'" class="rightImg verMid"></image>
</view>
</view>
</picker>
<picker mode="selector" :value="cutoffstatus" :range="cutoffstatusList" range-key="name" @change="changeCutoffstatus"
v-if="goodsInfo.goods.usestatus == '0' || goodsInfo.goods.usestatus == '2'">
<view class="dis-flex inputView diy-nav-list border-line border-bottom">
<view><text class="titleTetx">截止时间类型</text></view>
<view>
<text class="contentTetx verMid">{{ cutoffstatusText }}</text>
<image :src="imgfixUrls + 'merchant/right.svg'" class="rightImg verMid"></image>
</view>
</view>
</picker>
<view class="dis-flex inputView diy-nav-list border-line border-bottom" v-if="goodsInfo.goods.cutoffstatus == '1' && (goodsInfo.goods.usestatus == '0' || goodsInfo.goods.usestatus == '2')">
<view><text class="titleTetx">购买后有效天数</text></view>
<view><input placeholder="请输入购买后有效天数(天)" class="inputMain" type="number" v-model="goodsInfo.goods.cutoffday" /></view>
</view>
<view class="dis-flex inputView" v-if="goodsInfo.goods.cutoffstatus == '0' && (goodsInfo.goods.usestatus == '0' || goodsInfo.goods.usestatus == '2')"
@tap="dataTimeShow3">
<view><text class="titleTetx">消费截止时间</text></view>
<view>
<text class="contentTetx verMid">{{ closetimeText }}</text>
<image :src="imgfixUrls + 'merchant/right.svg'" class="rightImg verMid"></image>
</view>
</view>
<view class="dis-flex inputView diy-nav-list border-line border-bottom">
<view>
<text class="titleTetx">
{{ priceText }}
<text class="colorRed">*</text>
</text>
</view>
<view><input placeholder="请输入价格(元)" class="inputMain" type="digit" v-model="goodsInfo.goods.price"
@blur="handleprice" /></view>
</view>
<view class="dis-flex inputView diy-nav-list border-line border-bottom" v-if="!!typeList[type]&&typeList[type].value == 'fightgroup'">
<view>
<text class="titleTetx">
单购价
<text class="colorRed">*</text>
</text>
</view>
<view><input placeholder="请输入价格(元)" class="inputMain" type="digit" v-model="goodsInfo.goods.aloneprice"
@blur="handlealoneprice" /></view>
</view>
<view class="dis-flex inputView diy-nav-list border-line border-bottom">
<view>
<text class="titleTetx">
商品市场价
<text class="colorRed">*</text>
</text>
</view>
<view><input placeholder="请输入商品市场价(元)" class="inputMain" type="digit" v-model="goodsInfo.goods.oldprice"
@blur="handleoldprice" /></view>
</view>
<view class="dis-flex inputView diy-nav-list border-line border-bottom" v-if="!!typeList[type]&&(typeList[type].value != 'bargain' && typeList[type].value != 'fightgroup')">
<view>
<text class="titleTetx">
核销尾款
</text>
</view>
<view><input placeholder="请输入核销尾款(元)" class="inputMain" type="digit" v-model="goodsInfo.goods.retainage"
@blur="handleretainage" /></view>
</view>
<view class="dis-flex inputView diy-nav-list border-line border-bottom">
<view>
<text class="titleTetx">
预约时间
</text>
</view>
<view><input placeholder="请输入预约时间(时)" class="inputMain" type="number" v-model="goodsInfo.goods.appointment" /></view>
</view>
<view class="dis-flex inputView diy-nav-list border-line border-bottom" v-if="!!typeList[type]&&typeList[type].value != 'bargain'">
<view>
<text class="titleTetx">
单人限购
</text>
</view>
<view><input placeholder="请输入单人限购(次)" class="inputMain" type="number" v-model="goodsInfo.goods.op_one_limit" /></view>
</view>
<view class="dis-flex inputView diy-nav-list border-line border-bottom">
<view>
<text class="titleTetx">
商品库存
<text class="colorRed">*</text>
</text>
</view>
<view><input placeholder="请输入商品库存" class="inputMain" type="number" v-model="goodsInfo.goods.num" /></view>
</view>
<view class="dis-flex inputView diy-nav-list border-line border-bottom" v-if="!!typeList[type]&&typeList[type].value == 'fightgroup'">
<view>
<text class="titleTetx">
组团人数
<text class="colorRed">*</text>
</text>
</view>
<view><input placeholder="请输入组团人数(人)" class="inputMain" type="number" v-model="goodsInfo.goods.peoplenum"
@blur="handlepeoplenum" /></view>
</view>
<view class="dis-flex inputView diy-nav-list border-line border-bottom" v-if="!!typeList[type]&&typeList[type].value == 'fightgroup'">
<view>
<text class="titleTetx">
组团时间
<text class="colorRed">*</text>
</text>
</view>
<view><input placeholder="请输入组团时间(小时)" class="inputMain" type="number" v-model="goodsInfo.goods.grouptime" /></view>
</view>
<view class="dis-flex inputView diy-nav-list border-line border-bottom" v-if="!!typeList[type]&&typeList[type].value == 'bargain'">
<view>
<text class="titleTetx">
好友帮砍限制数量
<text class="colorRed">*</text>
</text>
</view>
<view><input placeholder="请输入好友帮砍限制数量(人)" class="inputMain" type="number" v-model="goodsInfo.goods.helplimit" /></view>
</view>
<view class="dis-flex inputView diy-nav-list border-line border-bottom" v-if="!!typeList[type]&&typeList[type].value == 'bargain'">
<view>
<text class="titleTetx">
每天帮砍人数限制
<text class="colorRed">*</text>
</text>
</view>
<view><input placeholder="请输入每天帮砍好友人数限制(人)" class="inputMain" type="number" v-model="goodsInfo.goods.dayhelpcount" /></view>
</view>
<view class="dis-flex inputView diy-nav-list border-line border-bottom" v-if="!!typeList[type]&&typeList[type].value == 'bargain'">
<view>
<text class="titleTetx">
每人可砍价次数
<text class="colorRed">*</text>
</text>
</view>
<view><input placeholder="请输入每人可砍价次数(次)" class="inputMain" type="number" v-model="goodsInfo.goods.onlytimes" /></view>
</view>
<view class="dis-flex inputView diy-nav-list border-line border-bottom" v-if="!!typeList[type]&&typeList[type].value == 'bargain'">
<view>
<text class="titleTetx">
允许参与人数
<text class="colorRed">*</text>
</text>
</view>
<view><input placeholder="请输入允许参与人数(人)" class="inputMain" type="number" v-model="goodsInfo.goods.joinlimit" /></view>
</view>
</view>
</view>
<!-- 商品规格区域 -->
<view class="main marT20">
<view class="mianPackage">
<picker mode="selector" :value="status" :range="statusList" range-key="name" @change="changeStatus">
<view class="dis-flex inputView">
<view><text class="titleTetx">商品状态</text></view>
<view>
<text class="contentTetx verMid">{{ statusText }}</text>
<image :src="imgfixUrls + 'merchant/right.svg'" class="rightImg verMid"></image>
</view>
</view>
</picker>
</view>
</view>
<view class="submitButton marT20Auto" v-if="bengF == 0 && !specsShow" @click.stop.prevent="saveGoods" :class="submitType == 1 ? 'pointerNone;' : ''"><text>提交</text></view>
<view class="submitButton marT20Auto" v-if="bengF == 1" :class="submitType == 1 ? 'pointerNone;' : ''"><text>提交</text></view>
<view class="full"></view>
<inputPop :inputShow="inputShow" @closeInputPop="closeInputPop" :titleText="showTitleText" @returnText="returnText"
:texts="goodsInfo.goods.name"></inputPop>
<!-- 标签弹框 -->
<PopManager :show="presettagsShow" :type="presettagsType">
<view class="presettagsView" :style="{ height: phoneHight }">
<view class="presettagsView_body">
<view v-for="(item, index) in presettagsList" @click="checkPresettags(item)" :class="goodsInfo.goods.tag.indexOf(item.id) != -1 ? 'presettagsCMb' : 'presettagsMb'">
<text>{{ item.title }}</text>
</view>
</view>
<view class="submitSpecs iy-nav-list border-line border-top" @click.stop.prevent="closePresettags"><text>确定</text></view>
</view>
</PopManager>
<!-- 标签弹框 -->
<!-- 商品详情富文本弹窗 -->
<PopManager :show="richText" type="center" @clickmask="richText = false">
<view class="b-f" style="width: 80vw;height: 80vh;border-radius: 10upx;overflow: auto;" v-if="goodsInfo.goods.detail || goodsInfo.goods.detail == ''">
<jinEdit placeholder="请输入内容" @editOk="editOk" uploadFileUrl="/#" :html="goodsInfo.goods.detail"></jinEdit>
</view>
</PopManager>
<!-- 富文本弹窗 -->
<!-- 购买须知富文本弹窗 -->
<PopManager :show="noticeText" type="center" @clickmask="noticeText = false">
<view class="b-f" style="width: 80vw;height: 80vh;border-radius: 10upx;overflow: auto;" v-if="goodsInfo.goods.describe || goodsInfo.goods.describe == ''">
<jinEdit placeholder="请输入内容" @editOk="noticeOk" uploadFileUrl="/#" :html="goodsInfo.goods.describe"></jinEdit>
</view>
</PopManager>
<!-- 富文本弹窗 -->
<!-- 砍价规则 -->
<PopManager :show="ruleShow" :type="presettagsType">
<view class="ruleView" :style="{ height: phoneHight }">
<view class="presettagsView_title dis-flex">
<view>
<view @click="pushRule" class="addRuleButton"><text>添加一条规则 +</text></view>
</view>
<view class="closePresettags" @click="closeRule">
<image :src="imgfixUrls + 'merchant/close.png'"></image>
</view>
</view>
<view class="presettagsView_Tips">
<view class="tipsPackage">
<view><text>规则说明:</text></view>
<view>
<text class="ruleTitle">
1.价格大于栏请
<text class="colorRed">从大到小</text>
设置
</text>
</view>
<view>
<text class="ruleTitle">
2.砍价范围请按照
<text class="colorRed">第一个空小于第二个空</text>
设置
</text>
</view>
<view>
<text class="ruleTitle">
例:设置的两条规则为:100,5,10和50,2,3。当商品当前金额大于100元时,每个好友砍价金额为5-10的随机数;当商品金额被砍到100元以下50元以上时,每个好友砍价金额为2-3的随机数;当商品金额被砍到50元以下时,未找到匹配的规则项,每个好友砍价金额为会按照默认的0.5-1元取随机数。
</text>
</view>
</view>
</view>
<view class="ruleView_body">
<view class="rulePackage">
<!-- 规则循环模板 -->
<scroll-view scroll-y :scroll-x="false" class="mbView">
<view class="ruleMb" v-for="(item, index) in goodsInfo.goods.rules">
<view class="ruleMbPackage">
<view>
<view class="disInline verMid ruleTitle"><text>当前价格大于</text></view>
<input placeholder="请输入" type="digit" class="disInline ruleInput verMid" v-model="item.rule_pice" />
</view>
<view>
<view class="disInline verMid ruleTitle"><text>砍价范围从</text></view>
<input placeholder="请输入" type="digit" class="disInline ruleInput verMid" v-model="item.rule_start" />
</view>
<view>
<view class="disInline verMid ruleTitle"><text>到</text></view>
<input placeholder="请输入" type="digit" class="disInline ruleInput verMid" v-model="item.rule_end" />
</view>
</view>
<!-- 规则循环模板 -->
</view>
</scroll-view>
</view>
</view>
</view>
</PopManager>
<!-- 砍价规则 -->
<!-- 规格弹窗 -->
<!-- <PopManager :show="specsShow" :type="presettagsType"> -->
<view class="specsView" :style="{ height: phoneHight }" v-if="specsShow">
<view class="presettagsView_title dis-flex">
<view class="c-ff4444 f-20">
温馨提示:多规格与阶梯价不能同时设置!
</view>
<view class="closePresettags" @click="closeSpecs">
<image :src="imgfixUrls + 'merchant/close.png'"></image>
</view>
</view>
<!-- 规格循环模板 -->
<scroll-view style="height: 70vh;" :scroll-y="true">
<view class="specsMb" v-for="(item, index) in specList">
<view class="specsMbPackage">
<view class="specsMbTitle dis-flex iy-nav-list border-line border-bottom">
<view>
<image :src="imgfixUrls + 'centerMerchant/clerkjian.png'" class="verMid specImg" @click="cleanSpecs(index, undefined)"></image>
<text class="titleTetx verMid marL10">规格名称</text>
</view>
<view><input placeholder="请输入规格名称" class="specInput textRight" v-model="item.title" /></view>
</view>
<view class="addBranchMb" v-for="(itemss, indexss) in item.items">
<view class="addBranchMbPackage dis-flex iy-nav-list border-line border-bottom">
<view>
<image :src="imgfixUrls + 'centerMerchant/clerkjian.png'" class="verMid specImg" @click="cleanSpecs(index, indexss,itemss,item)"></image>
<text class="titleTetx verMid marL10">规格名称</text>
</view>
<view><input placeholder="请输入规格名称" class="specInput textRight" v-model="itemss.title" /></view>
</view>
</view>
<view class="addBranchButton" @click="addBranchSpecs(index)">
<view class="addBranchPackage"><text>+ 添加子规格</text></view>
</view>
</view>
</view>
<!-- 规格循环模板 -->
</scroll-view>
<view class="specsAddButton marT20" @click="addSpecs" v-if="specList.length < 6"><text>+ 添加规格</text></view>
<view class="submitSpecs iy-nav-list border-line border-top" @click.stop.prevent="submitSpecs"><text>确定</text></view>
</view>
<!-- </PopManager> -->
<!-- 规格弹窗 -->
<!-- 子规格详情 -->
<!-- <PopManager :show="optionsShow" :type="presettagsType"> -->
<view class="specsView" :style="{ height: phoneHight,overflow: 'hidden' }" v-if="optionsShow">
<view class="presettagsView_title dis-flex">
<view></view>
<view class="closePresettags" @click="closeOptions">
<image :src="imgfixUrls + 'merchant/close.png'"></image>
</view>
</view>
<scroll-view style="height: 80vh;" :scroll-y="true">
<!-- 子规格模板 -->
<view class="optionsMb" v-for="(item, index) in goodsInfo.goods.options">
<view class="optionsMbPackage">
<view class="dis-flex inputView diy-nav-list border-line border-bottom">
<view><text class="titleTetx">规格</text></view>
<view>
<text class="contentTetx verMid">{{ item.title }}</text>
</view>
</view>
<view class="dis-flex inputView diy-nav-list border-line border-bottom">
<view><text class="titleTetx">价格</text></view>
<view><input placeholder="请输入" class="inputMain" type="digit" v-model="item.price" /></view>
</view>
<view class="dis-flex inputView ">
<view><text class="titleTetx">库存</text></view>
<view><input placeholder="请输入" class="inputMain" type="number" v-model="item.stock" /></view>
</view>
</view>
</view>
</scroll-view>
<view class="submitSpecs iy-nav-list border-line border-top" @click="closeOptions"><text>确定</text></view>
</view>
<!-- 子规格模板 -->
<!-- 阶梯价设置 -->
<view class="specsView" :style="{ height: phoneHight,overflow: 'hidden',position:'fixed',zIndex:'999' }" v-if="ladderShow">
<view class="presettagsView_title dis-flex">
<view class="c-ff4444 f-20">
温馨提示:多规格与阶梯价不能同时设置!
</view>
<view class="closePresettags" @click="closelist">
<image :src="imgfixUrls + 'merchant/close.png'"></image>
</view>
</view>
<view style="overflow: auto;height: 920upx;">
<view class="b-f" style="padding: 0 20upx;margin-bottom: 30upx;" v-for="(item,index) in goodsInfo.goods.lp_set">
<view class="dis-flex">
<view class="dis-flex" style="flex: 0.3;padding: 22upx 0;">
<image :src="imgfixUrls + 'centerMerchant/clerkjian.png'" style="width: 30upx;height: 30upx;flex: 0.15;margin-top: 3upx;"
class="verMid specImg" @click="cleanladder(index)"></image>
<view class="f-26 t-l col-9" style="flex: 0.8;">
价格
</view>
</view>
<view style="flex: 0.7;">
<input v-if="ladderShow" placeholder="请输入阶梯价格" class="inputMain" style="width: 500upx;"
type="digit" v-model="item.price" />
</view>
</view>
<view class="dis-flex">
<view class="dis-flex" style="flex: 0.3;padding: 22upx 0;">
<view class="f-26 t-l col-9" style="flex: 0.8;padding-left: 40upx;">
会员价
</view>
</view>
<view style="flex: 0.7;">
<input v-if="ladderShow" placeholder="请输入会员阶梯价" class="inputMain" style="width: 500upx;"
type="digit" v-model="item.vip_price" />
</view>
</view>
<view class="dis-flex">
<view class="dis-flex" style="flex: 0.3;padding: 22upx 0;">
<view class="f-26 t-l col-9" style="flex: 0.8;padding-left: 40upx;">
最大销售量
</view>
</view>
<view style="flex: 0.7;">
<input v-if="ladderShow" placeholder="请输入最大销售量" class="inputMain" style="width: 500upx;"
type="number" v-model="item.max" />
</view>
</view>
</view>
</view>
<view class="f-26 submitSpec" @click="addladder"><text>+ 添加阶梯价</text></view>
<view class="submitSpecs iy-nav-list border-line border-top" @click="closeladder"><text>确定</text></view>
</view>
<!-- </PopManager> -->
<!-- 子规格详情 -->
<w-picker :visible.sync="visible1" mode="date" startYear="2017" endYear="2029" :value="starttimeText" :current="starttimeText !== '请选择开始时间'?false:true"
fields="second" @confirm="checkStar($event,'date')" @cancel="onCancel" ref="dateTime"></w-picker>
<w-picker :visible.sync="visible3" mode="date" startYear="2017" endYear="2029" :value="endtimeText" :current="endtimeText !== '请选择结束时间'?false:true"
fields="second" @confirm="checkEnd($event,'date')" ref="dateTime1"></w-picker>
<w-picker :visible.sync="visible2" mode="date" startYear="2017" endYear="2029" :value="closetimeText" :current="closetimeText !== '请选择截止时间'?false:true"
fields="second" @confirm="checkClose($event,'date')" ref="dateTime2"></w-picker>
<!-- <w-picker mode="dateTime" :visible.sync="visible1" startYear="2019" endYear="2030" step="1" :current="true" @confirm="checkStar" ref="dateTime"></w-picker> -->
<!-- <w-picker mode="dateTime" :visible.sync="visible3" startYear="2019" endYear="2030" step="1" :current="true" @confirm="checkEnd" ref="dateTime1"></w-picker>
<w-picker mode="dateTime" :visible.sync="visible2" startYear="2019" endYear="2030" step="1" :current="true" @confirm="checkClose" ref="dateTime2"></w-picker> -->
</scroll-view>
</template>
<script>
import App from '@/common/js/app.js';
// #ifdef H5
import wxApi from '@/common/js/wxApi.js';
// #endif
import inputPop from '@/components/template/inputPop';
import PopManager from '@/components/template/PopManager';
import wPicker from '@/components/w-picker/w-picker.vue';
import jinEdit from '@/components/jin-edit/jin-edit.vue';
export default {
components: {
inputPop,
PopManager,
wPicker,
jinEdit
},
data() {
return {
priceText: '抢购价',
closetimeText: '',
submitType: 0,
bengF: '0',
adopt: true,
publicList: ['name', 'price', 'oldprice', 'num'],
rushList: ['retainage', 'op_one_limit'],
fightgroupList: ['peoplenum', 'grouptime', 'op_one_limit', 'aloneprice'],
bargainList: ['helplimit', 'dayhelpcount', 'onlytimes', 'joinlimit'],
slectDis: null,
statusText: '',
startValue: [],
endValue: [],
endtimeText: '请选择结束时间',
starttimeText: '请选择开始时间',
optionsShow: false,
specList: [],
specsText: '单规格',
specsShow: false,
ruleShow: false,
cateLists: [],
status: 0,
statusList: [{
id: 0,
name: '下架'
},
{
id: 1,
name: '上架'
}
],
cutoffstatusText: '请选择截止时间类型',
cutoffstatus: 0,
cutoffstatusList: [{
id: 0,
name: '固定时间'
},
{
id: 1,
name: '购买后有效期'
}
],
expresseText: '请选择快递模板',
express: 0,
expressList: [],
usestatusText: '请选择消费方式',
usestatusList: [{
id: 0,
name: '到店消费'
},
{
id: 1,
name: '快递上门'
},
{
id: 2,
name: '同时支持快递与核销'
}
],
presettagsText: '',
presettagsArrary: [],
presettagsList: [],
presettagsType: 'bottom',
presettagsShow: false,
thumb: '',
thumbs: [],
cateText: '请选择商品分类',
cateList: [],
goodsNameText: '请输入商品名称',
returnTexts: '',
showTitleText: '',
inputShow: false,
inputShowType: 'center',
typeList: [],
type: 0,
newTypeList: [
{name: "技能培训", cc_id: 1, value: "技能培训"},
{name: "资格考试", cc_id: 2, value: "资格考试"},
{name: "学历提升", cc_id: 3, value: "学历提升"},
{name: "岗前培训", cc_id: 4, value: "岗前培训"}
],
newTypeIndex: 0,
cate: [0],
isladderVel: [0],
isladder: ['关闭', '打开'],
isnotice:0,
noticeList:['关闭', '打开'],
cateTwo: [0, 0],
goodsInfo: {
type: '',
storeid: '',
id: '',
goods: {
lp_status: 0,
lp_set: [{
max: "",
price: "",
vip_price: ""
}]
}
},
phoneHight: null,
scrollHeight: null,
typeText: '抢购',
id: '',
startTime: '',
endTime: '',
graceEditorMenuShow1: false,
graceEditorTitle1: '',
graceEditorItems1: [],
graceEditorFoucsIndex1: 0,
graceEditorMenuShow: false,
graceEditorTitle: '',
graceEditorItems: [],
graceEditorFoucsIndex: 0,
isSpecBox: false,
placeholder: '开始输入...',
// editorCtx:''
richText: false,
noticeText: false,
richTextVter: '',
visible1: false,
visible2: false,
visible3: false,
flag: false,
ladderShow: false,
is_describe_tip:0,
newCateList: [],
newCateIndex: 0,
newCateText: '请选择商品分类'
};
},
onLoad(e) {
let _this = this;
// #ifdef H5
wxApi.wxRegister();
// #endif
if (uni.getSystemInfoSync().system.indexOf('Android') === -1) {
_this.flag = true;
} else {
_this.flag = false;
}
uni.getSystemInfo({
success(res) {
_this.phoneHight = res.windowHeight + 'px';
_this.scrollHeight = res.windowHeight - 30 + 'px';
_this.secollSpecHeight = res.windowHeight - 180 + 'px';
}
});
// if (!!e.type) {//商品类型是否可以重新选择
// _this.slectDis = true;
// } else {
// _this.slectDis = false;
// }
(_this.goodsInfo.type = e.type), (_this.goodsInfo.storeid = uni.getStorageSync('checkStoreid'));
(_this.goodsInfo.id = e.id), _this.init(_this.goodsInfo.type, uni.getStorageSync('checkStoreid'), _this.goodsInfo.id);
if (!!e.cc_id) {
console.log(e.cc_id, '21324253463645')
_this.newTypeIndex = e.cc_id-1;
_this.goodsInfo.goods.cc_id = e.cc_id;
}
},
computed: {},
methods: {
changenotice(e) {
this.goodsInfo['goods'].is_describe_tip = e.detail.value;
this.is_describe_tip = Number(e.detail.value);
console.log(e,this.goodsInfo['goods'].is_describe_tip);
this.flag= !this.flag;
this.flag= !this.flag;
},
changeladder(e) {
console.log(e);
this.isladderVel = e.detail.value;
},
cleanladder(index) {
this.goodsInfo.goods.lp_set.splice(index, 1)
},
addladder() {
let ladder = {
max: '',
price: '',
vip_price: ''
};
if (this.goodsInfo.goods.lp_set.length == 5) {
uni.showToast({
icon: 'none',
title: '最多设置5个阶梯价'
});
return
}
this.goodsInfo.goods.lp_set.push(ladder);
},
closelist(){
this.goodsInfo.goods.lp_set = [];
this.ladderShow = false;
},
closeladder() {
console.log(this.goodsInfo.goods.lp_set)
for (let i = 0; i < this.goodsInfo.goods.lp_set.length; i++) {
for (let key in this.goodsInfo.goods.lp_set[i]) {
if (!this.goodsInfo.goods.lp_set[i][key]) {
uni.showToast({
icon: 'none',
title: '请完善阶梯信息'
});
return
}
}
if (i > 0) {
console.log(this.goodsInfo.goods.lp_set[i].max, '111111111111111111', this.goodsInfo.goods.lp_set[i - 1].max)
if (Number(this.goodsInfo.goods.lp_set[i].max) < Number(this.goodsInfo.goods.lp_set[i - 1].max) || this.goodsInfo.goods.lp_set[i].max == this.goodsInfo.goods.lp_set[i - 1].max) {
App.showError("每一个阶梯销售量需大于上一个阶梯销售量");
return
}
console.log(this.goodsInfo.goods.lp_set[i].vip_price, '111111111111111111', this.goodsInfo.goods.lp_set[i - 1].vip_price)
if (Number(this.goodsInfo.goods.lp_set[i].vip_price) < Number(this.goodsInfo.goods.lp_set[i - 1].vip_price) || this.goodsInfo.goods.lp_set[i].vip_price == this.goodsInfo.goods.lp_set[i - 1].vip_price ) {
App.showError("每一个阶会员价需大于上一个会员价");
return
}
console.log(this.goodsInfo.goods.lp_set[i].price,'<<<<<',this.goodsInfo.goods.lp_set[i - 1].price)
if (Number(this.goodsInfo.goods.lp_set[i].price) < Number(this.goodsInfo.goods.lp_set[i - 1].price)) {
App.showError("每一个价格需大于或等于上一个价格");
return
}
}
};
this.ladderShow = false;
},
ladderPopShow() {
this.ladderShow = true;
},
onCancel() {},
noticeOk(res) {
console.log('shabi', res.html);
this.goodsInfo.goods.describe = res.html;
this.noticeText = false;
},
editOk(res) {
console.log('shabi', res.html);
this.richTextVter = res.html;
this.richText = false;
},
handlepeoplenum(e) {
let _this = this
console.info('peoplenum', Number(_this.goodsInfo.goods.peoplenum))
if (Number(_this.goodsInfo.goods.peoplenum) < 2) {
uni.showToast({
icon: "none",
title: '拼团人数最小为2',
duration: 2000
});
_this.goodsInfo.goods.peoplenum = 2
}
},
handleprice(e) {
let _this = this
_this.goodsInfo.goods.price = _this.goodsInfo.goods.price.match(/^\d*(\.?\d{0,2})/g)[0] || null;
},
handlealoneprice(e) {
let _this = this
_this.goodsInfo.goods.aloneprice = _this.goodsInfo.goods.aloneprice.match(/^\d*(\.?\d{0,2})/g)[0] || null;
},
handleoldprice(e) {
let _this = this
_this.goodsInfo.goods.oldprice = _this.goodsInfo.goods.oldprice.match(/^\d*(\.?\d{0,2})/g)[0] || null;
},
handleretainage(e) {
let _this = this
_this.goodsInfo.goods.retainage = _this.goodsInfo.goods.retainage.match(/^\d*(\.?\d{0,2})/g)[0] || null;
},
dataTimeShow1() {
let _this = this;
// _this.$refs.dateTime.show();
_this.visible1 = !_this.visible1;
},
dataTimeShow2() {
let _this = this;
_this.visible3 = !_this.visible3;
},
dataTimeShow3() {
let _this = this;
// _this.$refs.dateTime2.show();
_this.visible2 = !_this.visible2;
},
checkStar(e) {
console.log(e);
// uni.showToast({
// title:e.result
// })
// alert(e.result);
let _this = this;
_this.starttimeText = e.result;
let time = _this.getDataTime(e.result);
_this.$set(_this.goodsInfo.goods, 'starttime', _this.getDataTime(e.result));
// _this.goodsInfo.goods.starttime = _this.getDataTime(e.result);
},
checkEnd(e) {
let _this = this;
_this.endtimeText = e.result;
_this.$set(_this.goodsInfo.goods, 'endtime', _this.getDataTime(e.result))
// _this.goodsInfo.goods.endtime = _this.getDataTime(e.result);
},
checkClose(e) {
let _this = this;
_this.closetimeText = e.result;
_this.$set(_this.goodsInfo.goods, 'cutofftime', _this.getDataTime(e.result))
// _this.goodsInfo.goods.cutofftime = _this.getDataTime(e.result);
},
// 时间转时间戳
getDataTime(timeValue) {
let ontime;
if (this.flag) {
ontime = timeValue.replace(/-/g, '/');
} else {
ontime = timeValue;
}
let date = new Date(ontime);
let time = date.getTime();
return time;
},
// 时间戳转时间
getTimeData(dataValue) {
let date = new Date(dataValue);
let Y = date.getFullYear().toString() + '-';
let M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1).toString() + '-';
let D = (date.getDate() + 1 < 10 ? '0' + date.getDate() : date.getDate()).toString() + ' ';
let h = (date.getHours() + 1 < 10 ? '0' + date.getHours() : date.getHours()).toString() + ':';
let m = (date.getMinutes() + 1 < 10 ? '0' + date.getMinutes() : date.getMinutes()).toString() + ':';
let s = (date.getSeconds() + 1 < 10 ? '0' + date.getSeconds() : date.getSeconds()).toString();
let year = date.getFullYear().toString();
let month = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1).toString();
let day = (date.getDate() + 1 < 10 ? '0' + date.getDate() : date.getDate()).toString();
let hour = (date.getHours() + 1 < 10 ? '0' + date.getHours() : date.getHours()).toString();
let min = (date.getMinutes() + 1 < 10 ? '0' + date.getMinutes() : date.getMinutes()).toString();
let second = (date.getSeconds() + 1 < 10 ? '0' + date.getSeconds() : date.getSeconds()).toString();
let valueArry = [];
valueArry.push(year);
valueArry.push(month);
valueArry.push(day);
valueArry.push(hour);
valueArry.push(min);
valueArry.push(second);
return {
label: Y + M + D + h + m + s,
value: valueArry
};
},
closeOptions() {
let _this = this;
_this.optionsShow = false;
_this.isSpecBox = false;
},
optionsPopShow() {
let _this = this;
_this.optionsShow = true;
_this.isSpecBox = true;
},
// 提交规格
submitSpecs() {
let _this = this;
let ok = false;
let ok2 = false;
console.log(_this.specList);
for (let i = 0; i < _this.specList.length; i++) {
if (_this.specList[i].title == '' || _this.specList[i].items.length == 0) {
ok = false;
uni.showToast({
icon: 'none',
title: '请填写规格名称'
});
return;
} else if (_this.specList[i].title != '' || _this.specList[i].items.length != 0) {
for (let a = 0; a < _this.specList[i].items.length; a++) {
if (_this.specList[i].items[a].title != '') {
ok2 = true;
} else if (_this.specList[i].items[a].title == '') {
ok2 = false;
uni.showToast({
icon: 'none',
title: '请填写规格名称'
});
return;
}
}
}
}
function encode(str) {
// 对字符串进行编码
var arry = JSON.stringify(str);
let base = new _this.$util.Base64();
let encode = base.encode(arry);
return encode;
}
let spec = encode(_this.specList);
let options = [];
if (!!_this.goodsInfo.goods.options && _this.goodsInfo.goods.options.length != 0) {
options = encode(_this.goodsInfo.goods.options);
} else {
options = [];
}
let data = {
spec: spec,
options: options
};
App._post_form('&p=Store&do=specToOption', data, res => {
_this.goodsInfo.goods.options = res.data;
_this.goodsInfo.goods.spec = JSON.parse(JSON.stringify(_this.specList));
if (_this.goodsInfo.goods.spec.length != 0) {
_this.goodsInfo.goods.optionstatus = 1;
_this.specsText = '多规格';
} else if (_this.goodsInfo.goods.spec.length == 0) {
_this.goodsInfo.goods.optionstatus = 0;
_this.specsText = '单规格';
}
setTimeout(() => {
_this.specsShow = false;
_this.isSpecBox = false;
});
console.log()
});
},
// 添加子规格
addBranchSpecs(indexs) {
let _this = this;
console.info('specList', _this.specList);
let aa = {
id: 0,
title: ''
};
_this.specList[indexs].items.push(aa);
},
// 添加规格
addSpecs() {
let _this = this;
let aa = {
id: 0,
title: '',
items: []
};
_this.specList.push(aa);
},
closeSpecs() {
let _this = this;
_this.specList = JSON.parse(JSON.stringify(_this.goodsInfo.goods.spec));
_this.specsShow = false;
_this.isSpecBox = false;
},
specsPopShow() {
let _this = this;
_this.specsShow = true;
_this.isSpecBox = true;
},
// 添加规则
pushRule() {
let _this = this;
let obj = {
rule_pice: '',
rule_start: '',
rule_end: ''
};
_this.goodsInfo.goods.rules.push(obj);
},
// 关闭砍价弹框接口
closeRule() {
let _this = this;
_this.ruleShow = false;
},
// 打开砍价规则弹框
rulePopShow() {
let _this = this;
_this.ruleShow = true;
},
// 表单验证
submitTest(strings) {
let _this = this;
console.log(strings, '-------------');
let adopt = true;
if (strings == '' || strings == 'null') {
adopt = false;
uni.showToast({
icon: 'none',
title: '请完善商品信息',
duration: 2000
});
}
return adopt;
},
// 提交
saveGoods() {
if ((this.goodsInfo.goods.grouptime == 0 || this.goodsInfo.goods.grouptime == '0:00') && this.goodsInfo.type ==
'fightgroup') {
uni.showToast({
title: '组团时间不能小于0',
icon: 'none'
});
return
};
// if(this.goodsInfo.goods.lp_status == 1 && )
let _this = this;
_this.bengF = 1;
setTimeout(() => {
_this.submitType = 0;
}, 3000)
if (_this.submitType === 1) return
function encode(str) {
// 对字符串进行编码
var arry = JSON.stringify(str);
let base = new _this.$util.Base64();
let encode = base.encode(arry);
return encode;
}
let data = {
aloneprice: _this.goodsInfo.goods.aloneprice,
type: _this.goodsInfo.type,
cc_id: _this.goodsInfo.goods.cc_id,
storeid: _this.goodsInfo.storeid,
id: _this.goodsInfo.id || '',
name: _this.goodsInfo.goods.name,
unit: _this.goodsInfo.goods.unit,
cateid: _this.goodsInfo.goods.cateid,// 旧商品分类
cc_child_id: _this.goodsInfo.goods.cc_child_id,// 新商品分类
starttime: _this.goodsInfo.goods.starttime,
endtime: _this.goodsInfo.goods.endtime,
thumb: _this.goodsInfo.goods.thumb,
thumbs: _this.goodsInfo.goods.thumbs,
optionstatus: _this.goodsInfo.goods.optionstatus,
price: _this.goodsInfo.goods.price,
oldprice: _this.goodsInfo.goods.oldprice,
retainage: _this.goodsInfo.goods.retainage,
appointment: _this.goodsInfo.goods.appointment,
tag: _this.goodsInfo.goods.tag,
op_one_limit: _this.goodsInfo.goods.op_one_limit,
num: _this.goodsInfo.goods.num,
usestatus: _this.goodsInfo.goods.usestatus,
expressid: _this.goodsInfo.goods.expressid,
cutoffstatus: _this.goodsInfo.goods.cutoffstatus,
cutofftime: _this.goodsInfo.goods.cutofftime,
cutoffday: _this.goodsInfo.goods.cutoffday,
describe: _this.goodsInfo.goods.describe,
detail: _this.goodsInfo.goods.detail,
status: _this.goodsInfo.goods.status,
spec: _this.goodsInfo.goods.spec,
options: _this.goodsInfo.goods.options,
rules: _this.goodsInfo.goods.rules,
helplimit: _this.goodsInfo.goods.helplimit,
dayhelpcount: _this.goodsInfo.goods.dayhelpcount,
joinlimit: _this.goodsInfo.goods.joinlimit,
onlytimes: _this.goodsInfo.goods.onlytimes,
grouptime: _this.goodsInfo.goods.grouptime,
peoplenum: _this.goodsInfo.goods.peoplenum,
detail: _this.richTextVter,
describe: _this.goodsInfo.goods.describe,
lp_status: _this.isladderVel,
is_describe_tip:_this.goodsInfo['goods'].is_describe_tip
};
if (data.optionstatus == '0') {} else if (data.optionstatus == '1') {
data.spec = encode(data.spec);
data.options = encode(data.options);
}
if (data.type == 'bargain' && data.rules.length != 0) {
data.rules = encode(data.rules);
}
if(data.cc_child_id==""){
uni.showToast({
title:'请选择商品分类',
icon:'none'
})
return;
}
if (_this.isladderVel == 1 && _this.goodsInfo.type == 'rush') {
// _this.goodsInfo.goods.lp_set
for (let i = 0; i < _this.goodsInfo.goods.lp_set.length; i++) {
for (let k in _this.goodsInfo.goods.lp_set[i]) {
if (!_this.goodsInfo.goods.lp_set[i][k]) {
uni.showToast({
icon: 'none',
title: '请完善阶梯价信息'
});
return
}
}
};
data.lp_set = JSON.stringify(_this.goodsInfo.goods.lp_set);
}
console.log(_this.publicList);
// 公用验证
for (let i = 0; i < _this.publicList.length; i++) {
_this.adopt = _this.submitTest(data[_this.publicList[i]]);
if (_this.adopt == false) {
console.info('请求终止');
_this.bengF = 0;
return;
}
}
// if (data.type == 'rush' || data.type == 'groupon') {
// for (let i = 0; i < _this.rushList.length; i++) {
// _this.adopt = _this.submitTest(data[_this.rushList[i]]);
// if (_this.adopt == false) {
// console.info('请求终止');
// return;
// }
// }
// }
// if (data.type == 'fightgroup') {
// for (let i = 0; i < _this.fightgroupList.length; i++) {
// _this.adopt = _this.submitTest(data[_this.fightgroupList[i]]);
// if (_this.adopt == false) {
// console.info('请求终止');
// return;
// }
// }
// }
// if (data.type == 'bargain') {
// for (let i = 0; i < _this.bargainList.length; i++) {
// _this.adopt = _this.submitTest(data[_this.bargainList[i]]);
// if (_this.adopt == false) {
// console.info('请求终止');
// return;
// }
// }
// }
_this.submitType = 1;
App._post_form('&p=Store&do=saveGoods', data, res => {
if (res.errno === 0) {
App.showSuccess('保存成功', () => {
_this.submitType = 0;
// App.navigationTo({
// url: 'pages/subPages/merchant/merchantOrder/merchantOrder'
// });
uni.navigateBack({
delta: 1
})
})
}
});
setTimeout(() => {
_this.bengF = 0;
}, 1500)
},
// 选择二级分类
changeCateTwo(e) {
let _this = this;
console.info('value', e.detail.value);
_this.goodsInfo.goods.cateid = _this.cateList[e.detail.value[0]].id;
let twoList = _this.cateLists[1];
_this.goodsInfo.goods.cateid = twoList[e.detail.value[1]].id;
if (twoList[e.detail.value[1]].name == '暂无分类') {
_this.cateText = _this.cateList[e.detail.value[0]].name;
} else {
_this.cateText = _this.cateList[e.detail.value[0]].name + '|' + twoList[e.detail.value[1]].name;
}
},
// 删除规格
cleanSpecs(index, indexss, items, item) {
let _this = this;
if (indexss != undefined) {
_this.specList.map(itemss => {
if (itemss.title == item.title) {
itemss.items.map((nums, i) => {
if (nums.title == items.title) {
itemss.items.splice(i, 1);
}
})
}
})
} else {
console.info(2);
for (let i = 0; i < _this.specList.length; i++) {
if (i == index) {
_this.specList.splice(i, 1);
}
}
}
},
// 二级分类联动
// watchCateTwo(e) {
// let _this = this;
// let bArr = [];
// if (e.detail.column == 0) {
// for (let i = 0; i < _this.cateList.length; i++) {
// if (e.detail.value == i) {
// if (_this.cateList[i].twolevel.length != 0) {
// for (let a = 0; a < _this.cateList[i].twolevel.length; a++) {
// let bObj = {
// name: '',
// id: ''
// };
// bObj.name = _this.cateList[i].twolevel[a].name;
// bObj.id = _this.cateList[i].twolevel[a].id;
// bArr.push(bObj);
// }
// } else {
// let bObj = {};
// bObj = {
// name: '暂无分类',
// id: ''
// };
// bArr.push(bObj);
// }
// _this.cateLists.splice(1, 1, bArr);
// console.info(_this.cateLists);
// }
// }
// }
// },
changeStatus(e) {
let _this = this;
_this.status = e.detail.value;
_this.statusText = _this.statusList[e.detail.value].name;
_this.goodsInfo.goods.status = _this.statusList[e.detail.value].id;
console.info(_this.status);
console.info(_this.statusText);
console.info(_this.goodsInfo.goods.status);
},
changeCutoffstatus(e) {
let _this = this;
_this.cutoffstatus = e.detail.value;
_this.cutoffstatusText = _this.cutoffstatusList[e.detail.value].name;
_this.goodsInfo.goods.cutoffstatus = _this.cutoffstatusList[e.detail.value].id;
},
// 选择快递模板
changeExpress(e) {
let _this = this;
_this.expresse = e.detail.value;
_this.expresseText = _this.expressList[e.detail.value].name;
_this.goodsInfo.goods.expressid = _this.expressList[e.detail.value].id;
},
// 选择消费方式
changeUsestatus(e) {
let _this = this;
_this.goodsInfo.goods.usestatus = _this.usestatusList[e.detail.value].id;
_this.usestatusText = _this.usestatusList[e.detail.value].name;
},
// 选择标签
checkPresettags(item) {
let _this = this;
_this.presettagsText = '';
if (_this.goodsInfo.goods.tag.indexOf(item.id) != -1) {
for (let i = 0; i < _this.goodsInfo.goods.tag.length; i++) {
if (_this.goodsInfo.goods.tag[i] == item.id) {
_this.goodsInfo.goods.tag.splice(i, 1);
_this.presettagsArrary.splice(i, 1);
}
}
} else {
_this.goodsInfo.goods.tag.push(item.id);
_this.presettagsArrary.push(item.title);
}
if (_this.presettagsArrary.length == 0) {
_this.presettagsText = '请选择标签';
} else if (_this.presettagsArrary.length != 0) {
for (let i = 0; i < _this.presettagsArrary.length; i++) {
if (i != _this.presettagsArrary.length - 1) {
_this.presettagsText += _this.presettagsArrary[i] + '|';
} else if (i == _this.presettagsArrary.length - 1) {
_this.presettagsText += _this.presettagsArrary[i];
}
}
}
},
// 关闭标签弹窗
closePresettags() {
let _this = this;
_this.presettagsShow = false;
},
// 打开标签弹窗
showPresettagsPop() {
let _this = this;
_this.presettagsShow = true;
},
shownoticetext() {
this.noticeText = true;
},
showRichtext() {
this.richText = true;
},
closeImg(type, index) {
let _this = this;
if (type == 1) {
_this.thumb = '';
_this.goodsInfo.goods.thumb = '';
} else if (type == 2) {
for (let i = 0; i < _this.thumbs.length; i++) {
if (i == index) {
_this.thumbs.splice(i, 1);
_this.goodsInfo.goods.thumbs.splice(i, 1);
}
}
}
},
async updataImg(type, num) {
let _this = this;
// #ifdef H5
if(App.getClientType() == 2){
let res = await App.browser_upload(6);
for (let i = 0; i < res.tempFilePaths.length; i++) {
let aa = await App._upLoad(res.tempFilePaths[i]);
if (type == 1) {
_this.thumb = aa.data.img;
_this.goodsInfo.goods.thumb = aa.data.img;
}
if (type == 2) {
_this.thumbs.push(aa.data.img);
_this.goodsInfo.goods.thumbs.push(aa.data.img);
}
}
return
}
wxApi.choseImage(res => {
wxApi.uoloadIg(res.localIds[0], data => {
if (data.errMsg === 'uploadImage:ok') {
uni.showLoading({});
let requestData = {
upload_type: 2,
id: data.serverId
};
App._post_form(
'&do=uploadFiles',
requestData,
res => {
if (res.errno === 0) {
if (type == 1) {
_this.thumb = res.data.img;
_this.goodsInfo.goods.thumb = res.data.img;
}
if (type == 2) {
_this.thumbs.push(res.data.img);
_this.goodsInfo.goods.thumbs.push(res.data.img);
}
}
},
false,
() => {
uni.hideLoading();
}
);
} else {
uni.hideLoading();
App.showError('上传失败');
}
});
});
// #endif
// #ifndef H5
wx.chooseImage({
count: num,
sourceType: ['album', 'camera'],
success: async function(res) {
console.info(res);
for (let i = 0; i < res.tempFilePaths.length; i++) {
let aa = await App._upLoad(res.tempFilePaths[i]);
if (type == 1) {
_this.thumb = aa.data.img;
_this.goodsInfo.goods.thumb = aa.data.img;
}
if (type == 2) {
_this.thumbs.push(aa.data.img);
_this.goodsInfo.goods.thumbs.push(aa.data.img);
}
}
}
});
// #endif
},
changeCutofftime(e) {
let _this = this;
_this.goodsInfo.goods.cutofftime = e.detail.value;
},
// 更改商品分类
changeCate(e) {
let _this = this;
_this.cate = e.detail.value;
_this.goodsInfo.goods.cateid = _this.cateList[e.detail.value].id;
_this.cateText = _this.cateList[e.detail.value].name;
},
// 获取输入弹框返回值
returnText(e) {
let _this = this;
_this.goodsInfo.goods.name = e;
if (e != '') {
_this.goodsNameText = e;
} else if (e == '') {
_this.goodsNameText = '请输入商品名称';
}
_this.inputShow = false;
},
// 打开输入弹框
showInput(titleText) {
let _this = this;
_this.showTitleText = titleText;
_this.inputShow = true;
},
// 关闭输入弹框
closeInputPop() {
let _this = this;
_this.inputShow = false;
},
// 更改商品类型
changeType(e) {
let _this = this;
_this.cateLists = [];
_this.presettagsArrary = [];
_this.goodsInfo.cateid = '';
_this.type = e.detail.value;
_this.goodsInfo.type = _this.typeList[e.detail.value].value;
_this.cate = 0;
_this.cateTwo = [0, 0];
_this.cateText = '请选择商品分类';
_this.startValue = [];
_this.endValue = [];
_this.createGoods(_this.goodsInfo.type || '', _this.goodsInfo.storeid || '', _this.goodsInfo.id || '');
},
init(type, storeid, id) {
let _this = this;
_this.createGoods(type, storeid, id);
},
// 获取商品以及设置信息
createGoods(type, storeid, id) {
let _this = this;
console.info('type', type);
let data = {
type: _this.goodsInfo.type || type || '',
storeid: _this.goodsInfo.storeid || storeid || '',
id: _this.goodsInfo.id || id || ''
};
App._post_form('&p=Store&do=createGoods', data, res => {
_this.newTypeList = res.data.cultivate_class;
_this.goodsInfo['goods'] = res.data.goods;
if(!_this.goodsInfo.goods.is_describe_tip){
_this.goodsInfo.goods.is_describe_tip = 0;
}else{
_this.is_describe_tip = Number(_this.goodsInfo.goods.is_describe_tip);
}
// debugger
_this.isladderVel = res.data.goods.lp_status;
if (!_this.goodsInfo.goods.lp_status) {
_this.isladderVel = 0;
}
_this.richTextVter = res.data.goods.detail;
// _this.$set(_this.goodsInfo.goods,'detail',res.data.goods.detail);
if (res.data.goods.name) {
res.data.cate.map(item => {
if (item.id == res.data.goods.cateid) {
console.log(item.name);
_this.cateText = item.name;
}
})
}
// 处理类型列表
if (_this.typeList.length == 0) {
for (let i = 0; i < res.data.type.length; i++) {
let name = '';
if (res.data.type[i] == 'rush') {
name = '抢购';
} else if (res.data.type[i] == 'groupon') {
name = '团购';
} else if (res.data.type[i] == 'fightgroup') {
name = '拼团';
} else if (res.data.type[i] == 'bargain') {
name = '砍价';
}
let aa = {
name: name,
value: res.data.type[i]
};
_this.typeList.push(aa);
}
}
// 初始化商品类型
if (!!type) {
for (let i = 0; i < _this.typeList.length; i++) {
if (type == _this.typeList[i].value) {
_this.type = i;
_this.goodsInfo.type = _this.typeList[i].value;
}
}
} else if (type == undefined) {
console.info('type');
_this.type = 0;
console.info('typeList', _this.typeList);
_this.goodsInfo.type = _this.typeList[0].value;
_this.createGoods(_this.typeList[0].value, _this.storeid, _this.id)
return;
}
// 初始化新商品分类
if(_this.goodsInfo.goods.cc_id){
_this.newTypeList.map((item, index)=>{
if(_this.goodsInfo.goods.cc_id == item.cc_id){
_this.newTypeIndex = index;
_this.getNewCateList(index, '回填');// 初始化新商品二级分类
}
})
}else{
// _this.goodsInfo.goods.cc_id = _this.newTypeList[0].cc_id;
}
// 处理时间
_this.goodsInfo.goods.starttime = res.data.goods.starttime * 1000;
_this.goodsInfo.goods.endtime = res.data.goods.endtime * 1000;
_this.goodsInfo.goods.cutofftime = res.data.goods.cutofftime * 1000;
// 处理商品图片
_this.thumb = res.data.goods.thumb;
_this.thumbs = JSON.parse(JSON.stringify(res.data.goods.thumbs));
// 处理规格
let specArry = JSON.stringify(res.data.goods.spec);
_this.specList = JSON.parse(specArry);
//处理分类列表
_this.cateList = res.data.cate;
_this.isladder = [{
name: '关闭'
},
{
name: '打开'
}
]
// 处理商品标签列表
_this.presettagsList = res.data.presettags;
// 处理快递模板列表
_this.expressList = res.data.express;
// 初始化商品名称
if (res.data.goods.name == '') {
_this.goodsNameText = '请输入商品名称';
} else if (res.data.goods.name != '') {
_this.goodsNameText = res.data.goods.name;
}
// 初始化商品分类
if (!res.data.goods.name) {
if (res.data.cate.length > 0) {
_this.cate = 0;
_this.goodsInfo.goods.cateid = res.data.cate[0].id;
_this.cateText = res.data.cate[0].name;
}
}
// 初始化活动开始结束时间
if (res.data.goods.starttime == '') {
_this.goodsInfo.goods.starttime = '';
_this.starttimeText = '请选择开始时间';
_this.startValue = [];
} else if (res.data.goods.starttime != '') {
_this.starttimeText = _this.getTimeData(res.data.goods.starttime).label;
let aa = _this.getTimeData(res.data.goods.starttime).value;
for (let i = 0; i < aa.length; i++) {
_this.startValue.push(aa[i]);
}
console.info('startValue', _this.startValue);
}
if (res.data.goods.endtime == '') {
_this.goodsInfo.goods.endtime = '';
_this.endtimeText = '请选择结束时间';
_this.endValue = [];
} else if (res.data.goods.endtime != '') {
_this.endtimeText = _this.getTimeData(res.data.goods.endtime).label;
let aa = _this.getTimeData(res.data.goods.endtime).value;
for (let i = 0; i < aa.length; i++) {
_this.endValue.push(aa[i]);
}
}
// 初始化截止时间
if (res.data.goods.cutofftime == '') {
_this.goodsInfo.goods.cutofftime = '';
_this.closetimeText = '请选择截止时间';
_this.endValue = [];
} else if (res.data.goods.endtime != '') {
_this.closetimeText = _this.getTimeData(res.data.goods.cutofftime).label;
}
//初始化商品规格
if (res.data.goods.optionstatus != '0') {
_this.specsText = '多规格';
} else if (res.data.goods.optionstatus == '0') {
_this.specsText = '单规格';
}
// 初始化商品标签
if (_this.goodsInfo.goods.tag.length == 0) {
_this.presettagsText = '请选择标签';
} else if (_this.goodsInfo.goods.tag.length != 0) {
for (let i = 0; i < res.data.goods.tag.length; i++) {
for (let a = 0; a < _this.presettagsList.length; a++) {
if (res.data.goods.tag[i] == _this.presettagsList[a].id) {
_this.presettagsArrary.push(_this.presettagsList[a].title);
}
}
}
for (let a = 0; a < _this.presettagsArrary.length; a++) {
if (a != _this.presettagsArrary.length - 1) {
_this.presettagsText += _this.presettagsArrary[a] + '|';
} else if (a == _this.presettagsArrary.length - 1) {
_this.presettagsText += _this.presettagsArrary[a];
}
}
}
// 初始化消费方式
if (res.data.goods.usestatus == '') {
_this.goodsInfo.goods.usestatus = _this.usestatusList[0].id;
_this.usestatusText = _this.usestatusList[0].name;
console.info('usestatus', _this.goodsInfo.goods.usestatus);
console.info('usestatusText', _this.usestatusText);
} else if (res.data.goods.usestatus != '') {
_this.goodsInfo.goods.usestatus = res.data.goods.usestatus;
_this.usestatusText = _this.usestatusList[res.data.goods.usestatus].name;
}
// 初始化截止时间类型
if (res.data.goods.cutoffstatus == 0) {
_this.goodsInfo.goods.cutoffstatus = 0;
_this.cutoffstatus = 0;
_this.cutoffstatusText = _this.cutoffstatusList[_this.cutoffstatus].name;
} else if (res.data.goods.cutoffstatus == 1) {
_this.goodsInfo.goods.cutoffstatus = 1;
_this.cutoffstatus = 1;
_this.cutoffstatusText = _this.cutoffstatusList[_this.cutoffstatus].name;
}
// 初始化快递模板
// expressid
if (res.data.goods.expressid == '') {
_this.express = 0;
_this.goodsInfo.goods.expressid = _this.expressList[0].id;
_this.expresseText = _this.expressList[0].name;
} else if (res.data.goods.expressid != '' && res.data.goods.expressid.length !== 0) {
for (let i = 0; i < _this.expressList.length; i++) {
if (res.data.goods.expressid == _this.expressList[i].id) {
_this.express = i;
_this.goodsInfo.goods.expressid = _this.expressList[i].id;
_this.expresseText = _this.expressList[i].name;
}
}
}
console.info('statusList', _this.statusList)
// 初始化商品状态
if (res.data.goods.status == '') {
_this.goodsInfo.goods.status = _this.statusList[0].id;
_this.statusText = _this.statusList[0].name;
_this.status = 0;
} else if (res.data.goods.status != '') {
let aa = Number(res.data.goods.status);
_this.goodsInfo.goods.status = _this.statusList[aa].id;
_this.statusText = _this.statusList[aa].name;
_this.status = aa;
}
if (res.data.goods.type == 'rush' || _this.goodsInfo.type == 'rush') {
_this.priceText = '抢购价';
}
if (res.data.goods.type == 'groupon' || _this.goodsInfo.type == 'groupon') {
_this.priceText = '团购价';
}
if (res.data.goods.type == 'fightgroup' || _this.goodsInfo.type == 'fightgroup') {
_this.priceText = '组团价';
}
if (res.data.goods.type == 'bargain' || _this.goodsInfo.type == 'bargain') {
_this.priceText = '底价';
}
if (!_this.goodsInfo.goods.lp_set) {
_this.goodsInfo.goods.lp_set = [{
max: '',
price: '',
vip_price: ''
}];
}
});
},
// 购买须知
showGraceEditorMenu1: function() {
this.graceEditorMenuShow1 = true;
},
graceEditorAddItem1: function(e) {
var _self = this;
this.graceEditorMenuShow1 = false;
var type = e.currentTarget.dataset.type;
if (type == 'img') {
uni.chooseImage({
success: function(e) {
var imgs = e.tempFilePaths;
for (let i = 0; i < imgs.length; i++) {
_self.graceEditorItems1.push({
type: type,
content: imgs[i],
status: 'needUpload'
});
}
}
});
} else if (type == 'link') {
this.graceEditorItems1.push({
type: type,
content: 'http://'
});
} else {
this.graceEditorItems1.push({
type: type,
content: ''
});
}
},
graceEditorInput1: function(e) {
var index = e.currentTarget.dataset.index;
var val = e.detail.value;
if (val == '') {
this.graceEditorItems1.splice(index, 1);
return;
} else {
this.graceEditorItems1[index].content = val;
}
},
deleteItem1: function(e) {
var _self = this;
var index = e.currentTarget.dataset.index;
uni.showModal({
title: '提示',
content: '确定要删除项目吗?',
success: function(e) {
if (e.confirm) {
_self.graceEditorItems1.splice(index, 1);
}
}
});
},
// 收集数据并提交 包含图片上传
submit: function() {
// 分析临时图片然后上传
var tmpImgs = [];
for (let i = 0; i < this.graceEditorItems1.length; i++) {
if (this.graceEditorItems1[i].type == 'img' && this.graceEditorItems1[i].status == 'needUpload') {
tmpImgs.push(i);
}
}
if (tmpImgs.length > 0) {
this.upLoadImg1(0, tmpImgs);
}
// 没有图片项目直接提交
else {
this.getDataAndSubmit1();
}
},
// 收集数据提交
getDataAndSubmit1: function() {
if (this.graceEditorTitle1 == '') {
uni.showToast({
title: '请填写标题',
icon: 'none'
});
return;
}
if (this.graceEditorItems1.length < 1) {
uni.showToast({
title: '请填写内容',
icon: 'none'
});
return;
}
// 标题数据保存在 graceEditorTitle1 内
console.log('标题 : ' + this.graceEditorTitle1);
// 内容数据保存在 graceEditorItems1 内,可以将其序列化后发送给后端api
console.log('内容 : ' + this.graceEditorItems1);
//
console.log('内容 : ' + JSON.stringify(this.graceEditorItems1));
},
// 上传图片
upLoadImg1: function(step, tmpImgs) {
var _self = this;
uni.showLoading({
title: '图片上传中'
});
var uploadTask = uni.uploadFile({
url: 'https://unidemo.dcloud.net.cn/upload',
filePath: _self.graceEditorItems1[tmpImgs[step]].content,
fileType: 'image',
name: 'data',
success: function(uploadFileRes) {
console.log(uploadFileRes);
uploadFileRes = JSON.parse(uploadFileRes.data);
//图片上传成功后返回服务器端路径,记录这个路径
_self.graceEditorItems1[tmpImgs[step]].content = '上传成功服务器返回的图片地址,根据api情况自己写';
step++;
// 继续上传
if (step < tmpImgs.length) {
_self.upLoadImg1(step, tmpImgs);
}
// 图片上传成功,收集数据提交给 api后端
else {
_self.getDataAndSubmit1();
}
},
complete: function() {
uni.hideLoading();
}
});
},
gotoInfo: function() {
uni.navigateTo({
url: './editerInfo'
});
},
// 商品详情
showGraceEditorMenu: function() {
this.graceEditorMenuShow = true;
},
graceEditorAddItem: function(e) {
var _self = this;
this.graceEditorMenuShow = false;
var type = e.currentTarget.dataset.type;
if (type == 'img') {
uni.chooseImage({
success: function(e) {
var imgs = e.tempFilePaths;
for (let i = 0; i < imgs.length; i++) {
_self.graceEditorItems.push({
type: type,
content: imgs[i],
status: 'needUpload'
});
}
}
});
} else if (type == 'link') {
this.graceEditorItems.push({
type: type,
content: 'http://'
});
} else {
this.graceEditorItems.push({
type: type,
content: ''
});
}
},
graceEditorInput: function(e) {
var index = e.currentTarget.dataset.index;
var val = e.detail.value;
if (val == '') {
this.graceEditorItems.splice(index, 1);
return;
} else {
this.graceEditorItems[index].content = val;
}
},
deleteItem: function(e) {
var _self = this;
var index = e.currentTarget.dataset.index;
uni.showModal({
title: '提示',
content: '确定要删除项目吗?',
success: function(e) {
if (e.confirm) {
_self.graceEditorItems.splice(index, 1);
}
}
});
},
// 收集数据并提交 包含图片上传
submit: function() {
// 分析临时图片然后上传
var tmpImgs = [];
for (let i = 0; i < this.graceEditorItems.length; i++) {
if (this.graceEditorItems[i].type == 'img' && this.graceEditorItems[i].status == 'needUpload') {
tmpImgs.push(i);
}
}
if (tmpImgs.length > 0) {
this.upLoadImg(0, tmpImgs);
}
// 没有图片项目直接提交
else {
this.getDataAndSubmit();
}
},
// 收集数据提交
getDataAndSubmit: function() {
if (this.graceEditorTitle == '') {
uni.showToast({
title: '请填写标题',
icon: 'none'
});
return;
}
if (this.graceEditorItems.length < 1) {
uni.showToast({
title: '请填写内容',
icon: 'none'
});
return;
}
// 标题数据保存在 graceEditorTitle1 内
console.log('标题 : ' + this.graceEditorTitle);
// 内容数据保存在 graceEditorItems1 内,可以将其序列化后发送给后端api
console.log('内容 : ' + this.graceEditorItems);
//
console.log('内容 : ' + JSON.stringify(this.graceEditorItems));
},
// 上传图片
upLoadImg: function(step, tmpImgs) {
var _self = this;
uni.showLoading({
title: '图片上传中'
});
var uploadTask = uni.uploadFile({
url: 'https://unidemo.dcloud.net.cn/upload',
filePath: _self.graceEditorItems[tmpImgs[step]].content,
fileType: 'image',
name: 'data',
success: function(uploadFileRes) {
console.log(uploadFileRes);
uploadFileRes = JSON.parse(uploadFileRes.data);
//图片上传成功后返回服务器端路径,记录这个路径
_self.graceEditorItems[tmpImgs[step]].content = '上传成功服务器返回的图片地址,根据api情况自己写';
step++;
// 继续上传
if (step < tmpImgs.length) {
_self.upLoadImg(step, tmpImgs);
}
// 图片上传成功,收集数据提交给 api后端
else {
_self.getDataAndSubmit();
}
},
complete: function() {
uni.hideLoading();
}
});
},
gotoInfo: function() {
uni.navigateTo({
url: './editerInfo'
});
},
changeNewType(e){
let _this = this;
// _this.cateLists = [];
// _this.presettagsArrary = [];
// _this.goodsInfo.cateid = '';
_this.newTypeIndex = e.detail.value;
// _this.goodsInfo.type = _this.newTypeList[e.detail.value].value;
_this.goodsInfo.type = 'rush';
_this.goodsInfo.goods.cc_id = _this.newTypeList[e.detail.value].cc_id;
// _this.cate = 0;
// _this.cateTwo = [0, 0];
// _this.cateText = '请选择商品分类';
_this.startValue = [];
_this.endValue = [];
// _this.createGoods(_this.goodsInfo.type || '', _this.goodsInfo.storeid || '', _this.goodsInfo.id || '');
_this.getNewCateList(e.detail.value);
},
getNewCateList(index, type){
App._post_form(
`&p=cultivateClass&do=getCultivateClassChildList`,
{cc_id: this.newTypeList[index].cc_id, storeid: this.goodsInfo.storeid},
res => {
if(res.data.length>0){
this.newCateList = res.data;
if(this.goodsInfo.goods.cc_child_id && type == '回填'){
setTimeout(()=>{
this.newCateList.map((item, index)=>{
if(this.goodsInfo.goods.cc_child_id == item.id){
this.newCateIndex = index;
this.newCateText = this.newCateList[index].name;
}
})
}, 500)
}else{
this.newCateIndex = 0;
this.goodsInfo.goods.cc_child_id = '';
this.newCateText = '请选择商品分类';
}
}
},
false,
() => {}
);
},
changeNewCate(e){
this.newCateIndex = e.detail.value;
this.goodsInfo.goods.cc_child_id = this.newCateList[e.detail.value].id;
this.newCateText = this.newCateList[e.detail.value].name;
},
}
};
</script>
<style lang="less">
@import 'index.less';
.ruleTitle {
font-size: 28rpx;
}
.imgPreview {
display: inline-block;
overflow: hidden;
width: 157upx;
height: 157upx;
background: gray;
margin-right: 37upx;
margin-bottom: 10upx;
border-radius: 10upx;
>image {
width: 157upx;
height: 157upx;
}
}
.close {
width: 32upx !important;
height: 32upx !important;
position: relative;
bottom: 150upx;
left: 120upx;
z-index: 30;
}
.uploadButton {
width: 400upx;
}
.userImgUpdata {
display: inline-block;
}
.pointerNone {
pointer-events: none !important;
}
</style>