eadit.vue 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134
  1. <template>
  2. <view class="content">
  3. <view class="kk"></view>
  4. <view class="box" style="padding-bottom: 0;">
  5. <view class="title">基础信息</view>
  6. <view class="line">
  7. <view class="lineLeft">
  8. <span class="linexx">*</span> <span>活动名称</span>
  9. </view>
  10. <view class="lineRight">
  11. <input type="text" v-model="activityName" placeholder="请输入" class="lineRightInput" placeholder-class="inputPlace">
  12. </view>
  13. </view>
  14. <view class="line">
  15. <view class="lineLeft">
  16. <span class="linexx">*</span> <span>报名时间</span>
  17. </view>
  18. <view class="lineRight timelineRight">
  19. <picker mode="date" :value="startTime" @change="bindTimeChangeStart">
  20. <view class="dateViewno" v-if="!startTime">开始时间</view>
  21. <view class="dateView" v-else>{{startTime}}</view>
  22. </picker>
  23. <view class="timeHx">-</view>
  24. <picker mode="date" :value="endTime" @change="bindTimeChangeendTime" :start='startTime'>
  25. <view class="dateViewno" v-if="!endTime">结束时间</view>
  26. <view class="dateView" v-else>{{endTime}}</view>
  27. </picker>
  28. </view>
  29. </view>
  30. <view class="line" style="border: none;">
  31. <view class="lineLeft">
  32. <span class="linexx">*</span> <span>活动门店</span>
  33. </view>
  34. <view class="lineRight shopckBox">
  35. <view class="shopListNo" v-if="!shopNames">请选择活动门店,可多选</view>
  36. <view class="shopListY" v-if="shopNames">{{shopNames}}</view>
  37. <view class="addshop" @click="addShop">添加</view>
  38. </view>
  39. </view>
  40. </view>
  41. <view class="kk"></view>
  42. <view class="box" style="padding-bottom: 5rpx;">
  43. <view class="title">活动发放券包</view>
  44. <view class="line linecoupon" @click="gocouponShow">
  45. <view class="lineLeft">
  46. <span>选择券包</span>
  47. </view>
  48. <view class="lineRight" style="display: flex;">
  49. {{couponPackageData?couponPackageData.name:'请选择'}}
  50. <image src="../../static/img/jt2.png" mode="widthFix" style="width: 16rpx;margin-top: 4rpx;margin-left: 10rpx;"></image>
  51. </view>
  52. </view>
  53. <view class="linecouponCont" v-for="item in packageDetailList">
  54. <view class="linecouponContLeft">
  55. <view class="couponType" v-if="item.discountType==1">满减券</view>
  56. <view class="couponType" v-if="item.discountType==2">商品券</view>
  57. <view class="couponType" v-if="item.discountType==3">服务券</view>
  58. <view class="couponName">{{item.actName}}</view>
  59. </view>
  60. <view class="couponNum">x{{item.actQty}}</view>
  61. </view>
  62. </view>
  63. <view class="kk"></view>
  64. <view class="box" style="padding-bottom: 0;">
  65. <view class="title">报名信息</view>
  66. <view class="line">
  67. <view class="lineLeft">
  68. <span class="linexx">*</span> <span>报名凭证</span>
  69. </view>
  70. <view class="lineRight clWhereBox">
  71. <view class="clWhereLine" :class="{clWhereActive:clWhereString.indexOf(1)!=-1}">手机号</view>
  72. <view class="clWhereLine" :class="{clWhereActive:clWhereString.indexOf(2)!=-1}" @click="clWhere(2)">车牌号</view>
  73. <view class="clWhereLine" :class="{clWhereActive:clWhereString.indexOf(3)!=-1}" @click="clWhere(3)">姓名</view>
  74. <view class="clWhereLine" :class="{clWhereActive:clWhereString.indexOf(4)!=-1}" @click="clWhere(4)">单位</view>
  75. </view>
  76. </view>
  77. <view class="line">
  78. <view class="lineLeft">
  79. <span class="linexx">*</span> <span>最多报名人数</span>
  80. </view>
  81. <view class="lineRight">
  82. <input :disabled="isExistGroup" type="number" v-model="number" placeholder="请输入" class="lineRightInput" placeholder-class="inputPlace">
  83. </view>
  84. </view>
  85. <view class="line" ><!-- style="border: none;" -->
  86. <view class="lineLeft">
  87. <span class="linexx">*</span> <span>支付方式</span>
  88. </view>
  89. <view class="lineRight payBox">
  90. <view class="payType" @click="payTypeCL(1)">
  91. <img src="../../static/img/ckn.png" alt="" class="payTypeImg" v-if="payType!=1">
  92. <img src="../../static/img/cky.png" alt="" class="payTypeImg" v-if="payType==1">
  93. <view class="payTypeTxt">在线支付</view>
  94. </view>
  95. <view class="payType" @click="nopayCl" style="padding-left: 30rpx;">
  96. <img src="../../static/img/cky.png" alt="" class="payTypeImg" v-if="payType==2">
  97. <img src="../../static/img/ckn.png" alt="" class="payTypeImg" v-if="payType!=2">
  98. <view class="payTypeTxt">无需支付</view>
  99. </view>
  100. </view>
  101. </view>
  102. <view class="line" v-if="payType==1">
  103. <view class="lineLeft">
  104. <span class="linexx">*</span> <span>支付金额</span>
  105. </view>
  106. <view class="lineRight">
  107. <input :disabled="isExistGroup" type="text" v-model="money" placeholder="请输入" class="lineRightInput" placeholder-class="inputPlace">
  108. </view>
  109. </view>
  110. <view v-if="payType==1">
  111. <view class="line line3">
  112. <view class="lineLeft">
  113. <span>拼团设置</span>
  114. </view>
  115. <view class="lineRight"><switch :disabled="isExistGroup" :checked='groupType' @change="switchgroupType" style="transform:scale(0.8)"/></view>
  116. </view>
  117. <view v-if="groupType">
  118. <view class="line" >
  119. <view class="lineLeft">
  120. <span class="linexx">*</span> <span>拼团人数</span>
  121. </view>
  122. <view class="lineRight">
  123. <input type="number" :disabled="isExistGroup" @blur="blurgroupNumber" v-model="groupNumber" placeholder="可输入大于1的整数" class="lineRightInput" placeholder-class="inputPlace">
  124. </view>
  125. </view>
  126. <view class="line" >
  127. <view class="lineLeft">
  128. <span class="linexx">*</span> <span>拼团有效期</span>
  129. </view>
  130. <view class="lineRight">
  131. <input type="digit" :disabled="isExistGroup" @blur="blurgroupTime" v-model="groupTime" placeholder="可输入0.5至72小时" class="linecInput" placeholder-class="inputPlace">
  132. </view>
  133. <viwe class="lineRight">小时</viwe>
  134. </view>
  135. <view class="line" >
  136. <view class="lineLeft">
  137. <span class="linexx">*</span> <span>拼团价</span>
  138. </view>
  139. <view class="lineRight">
  140. <input type="digit" :disabled="isExistGroup" @blur="blurgroupMoney" v-model="groupMoney" placeholder="需小于支付金额" class="linecInput" placeholder-class="inputPlace">
  141. </view>
  142. <viwe class="lineRight">元</viwe>
  143. </view>
  144. <view class="line line3">
  145. <view class="lineLeft2">
  146. <span class="linexx">*</span><span>拼团超时自动成团</span>
  147. <image @click="zyct" src="../../static/img/icon_help.png" mode="" class="helpIcon"></image>
  148. </view>
  149. <view class="lineRight"><switch :disabled="isExistGroup" :checked='groupOutState' @change="switchgroupOutState" style="transform:scale(0.8)"/></view>
  150. </view>
  151. <view class="line line3">
  152. <view class="lineLeft2">
  153. <span class="linexx">*</span><span>自由参团</span>
  154. <image @click="zdct" src="../../static/img/icon_help.png" mode="" class="helpIcon"></image>
  155. </view>
  156. <view class="lineRight"><switch :disabled="isExistGroup" :checked='groupRestrictions' @change="switchgroupRestrictions" style="transform:scale(0.8)"/></view>
  157. </view>
  158. </view>
  159. </view>
  160. </view>
  161. <view class="kk"></view>
  162. <view class="box">
  163. <view class="title">活动详情</view>
  164. <view class="line">
  165. <view class="lineLeft">
  166. <span>活动说明</span>
  167. </view>
  168. <view class="lineRight">
  169. <textarea maxlength="-1" placeholder-class="inputPlace" v-model="activityContent" placeholder="请输入" class="textsr"/>
  170. </view>
  171. </view>
  172. <view class="line2">
  173. <view class="lineTitle">主图</view>
  174. <view class="lineMS">此图在活动顶部显示,建议宽度750px</view>
  175. <view class="lineImgBOx">
  176. <view class="lineimghz" v-if="img" >
  177. <img src="../../static/img/del.png" alt="" class="lineimgdel" @click="delimgzt" >
  178. <img :src="img" alt="" class="lineimg" @click="previewImage(img)">
  179. </view>
  180. <view class="lineimghz" @click="upimgzt" v-if="!img">
  181. <img src="../../static/img/scimg.png" alt="" class="lineimg">
  182. </view>
  183. </view>
  184. </view>
  185. <view class="line2">
  186. <view class="lineTitle">详情图片</view>
  187. <view class="lineMS">此图在活动底部显示,可用于显示门店照片等,建议宽度750px</view>
  188. <view class="lineImgBOx">
  189. <view class="lineimghz" v-for="(item,index) in imgListArr">
  190. <img src="../../static/img/del.png" alt="" class="lineimgdel" @click="delimg(index)" >
  191. <img :src="item" alt="" class="lineimg" @click="previewImage(item)">
  192. </view>
  193. <view class="lineimghz" @click="upimg">
  194. <img src="../../static/img/scimg.png" alt="" class="lineimg">
  195. </view>
  196. </view>
  197. </view>
  198. <view class="line lineBorderNo">
  199. <view class="lineLeft">
  200. <span>音乐</span>
  201. </view>
  202. <view class="lineRight musicRight" @click="goMusic">
  203. <view class="musicMS">选择/更换音乐</view>
  204. <img src="../../static/img/jt.png" alt="" class="musicJt">
  205. </view>
  206. </view>
  207. <view class="musicBox" v-if="ckMusic">
  208. <view class="musicLine">
  209. <view class="musicLineLeft">
  210. <img src="../../static/img/music.png" alt="" class="musicImg">
  211. <view class="musicName">{{ckMusic.name}}</view>
  212. </view>
  213. <view>
  214. <img src="../../static/img/sanchu.png" alt="" class="musicDel" @click="musicDel">
  215. </view>
  216. </view>
  217. </view>
  218. </view>
  219. <view style="height: 120rpx;"></view>
  220. <view class="preview" @click="preview">预览</view>
  221. <w-compress ref='wCompress' />
  222. <view class="couponBox" v-if="couponShow">
  223. <view class="couponCont">
  224. <view class="couponTopBox">
  225. <view class="couponTop">
  226. <view class="couponTopTxrt">选择券包</view>
  227. <image src="../../static/img/chahao.png" mode="" class="couponClose" @click="couponClose"></image>
  228. </view>
  229. <view class="couponSearchBox">
  230. <image src="../../static/img/icon_search.png" mode="" class="searchImg"></image>
  231. <input v-model="couponname" type="text" placeholder="券包名称" class="topInput" @confirm="inputconfirm">
  232. </view>
  233. </view>
  234. <view class="couponLineBOx">
  235. <view class="couponLine" @click="ckcoupon(item)" v-for="(item,index) in couponPackageList">{{item.name}}</view>
  236. </view>
  237. </view>
  238. </view>
  239. </view>
  240. </template>
  241. <script>
  242. import WCompress from '@/components/w-compress/w-compress.vue'
  243. export default {
  244. components: {
  245. WCompress
  246. },
  247. data() {
  248. return {
  249. id:'', //类型:String 可有字段 备注:新增无编辑有
  250. activityName:'', //类型:String 必有字段 备注:活动名称
  251. startTime:"", //类型:String 必有字段 备注:营业开始时间
  252. endTime:"", //类型:String 必有字段 备注:营业结束时间
  253. number:"", //类型:String 必有字段 备注:报名人数
  254. activityContent:"", //类型:String 必有字段 备注:活动说明
  255. //clWhere:'', //类型:String 必有字段 备注:报名凭证1,2,3,4 1手机号2车牌号3姓名4单位
  256. payType:1, //类型:String 必有字段 备注:1在线支付2无需支付
  257. music:"", //类型:String 必有字段 备注:背景音乐
  258. clState:'', //类型:String 必有字段 备注:1未启用2启用
  259. img:'', //类型:String 必有字段 备注:从首页带进来的图片
  260. imgList:'',//类型:String 必有字段 备注:详情图片多个以逗号分割
  261. datetimerange: '',
  262. shopNames:'',
  263. shopList:'',
  264. clWhereList:[1,],
  265. clWhereString:'1',
  266. imgListArr:[],
  267. money:'',
  268. ckMusic:'',
  269. id:'',
  270. groupNumber:'',
  271. groupType:false,
  272. groupTime:'',
  273. groupMoney:'',
  274. groupOutState:false,
  275. groupRestrictions:false,
  276. isExistGroup:false,
  277. couponname:'',
  278. couponShow:false,
  279. couponPackageList:'',
  280. packageDetailList:'',
  281. couponPackageData:'',
  282. }
  283. },
  284. onLoad(opt) {
  285. this.img=opt.img;
  286. if(opt.id){
  287. this.id=opt.id;
  288. this.getDetails()
  289. }
  290. this.getcouponPackageList()
  291. },
  292. onShow() {
  293. const shopckList = uni.getStorageSync("shopckList");
  294. this.ckMusic=uni.getStorageSync("ckmusic")
  295. if(this.ckMusic){
  296. this.music=this.ckMusic.id
  297. }
  298. var shopNames=[];
  299. var shopList=[];
  300. if(shopckList){
  301. shopckList.forEach(item=>{
  302. shopNames.push(item.shopName)
  303. shopList.push(item.id)
  304. })
  305. this.shopNames=shopNames.join(',')
  306. this.shopList=shopList.join(',')
  307. }
  308. },
  309. methods: {
  310. ckcoupon(item){
  311. this.couponPackageData=item
  312. this.couponShow=false
  313. this.$http('openH5SetTheGuest/couponPackageDetailList', {
  314. couponPackageId:item.id
  315. },'GET').then(res => {
  316. this.packageDetailList=res.data
  317. })
  318. },
  319. inputconfirm(){
  320. this.$http('openH5SetTheGuest/couponPackageList', {
  321. name:this.couponname
  322. },'GET').then(res => {
  323. this.couponPackageList=res.data
  324. })
  325. },
  326. getcouponPackageList(){
  327. this.$http('openH5SetTheGuest/couponPackageList', {
  328. },'GET').then(res => {
  329. this.couponPackageList=res.data
  330. })
  331. },
  332. couponClose(){
  333. this.couponShow=false
  334. },
  335. gocouponShow(){
  336. this.couponShow=true
  337. },
  338. nopayCl(){
  339. if(this.isExistGroup){
  340. return false
  341. }
  342. this.payType=2;
  343. this.groupType=false
  344. },
  345. payTypeCL(){
  346. if(this.isExistGroup){
  347. return false
  348. }
  349. this.payType=1;
  350. },
  351. zdct(){
  352. uni.showModal({
  353. title: '自由参团',
  354. content: '如果开启自由参团,则用户可以在详情页直接参团;如果关闭,则用户只能通过好友分享的链接参与拼团',
  355. showCancel:false,
  356. confirmText:'我知道了',
  357. success: function (res) {
  358. }
  359. });
  360. },
  361. zyct(){
  362. uni.showModal({
  363. title: '拼团超时自动成团',
  364. content: '如果开启:过了拼团有效期或拼团活动结束后未能成团,则自动成团;如果关闭:过了拼团有效期或拼团活动结束后未能成团,则拼团失败,团内用户的支付金额将原路退回。',
  365. showCancel:false,
  366. confirmText:'我知道了',
  367. success: function (res) {
  368. }
  369. });
  370. },
  371. switchgroupType(e){
  372. console.log(e)
  373. this.groupType=e.detail.value
  374. },
  375. switchgroupOutState(e){
  376. this.groupOutState=e.detail.value
  377. },
  378. switchgroupRestrictions(e){
  379. this.groupRestrictions=e.detail.value
  380. },
  381. previewImage(img){
  382. var arr=[]
  383. arr.push(img)
  384. uni.previewImage({
  385. urls: arr,
  386. longPressActions: {
  387. itemList: ['发送给朋友', '保存图片',],
  388. success: function(data) {},
  389. fail: function(err) {}
  390. }
  391. });
  392. },
  393. getDetails(){
  394. uni.showLoading({
  395. title: '加载中'
  396. })
  397. this.$http('openH5SetTheGuest/getActivityDetails', {
  398. id:this.id
  399. },'GET').then(res => {
  400. uni.hideLoading();
  401. var jkdata=res.data.data
  402. this.activityName=jkdata.activityName;
  403. this.activityContent=jkdata.activityContent;
  404. this.money=jkdata.money;
  405. this.number=jkdata.number;
  406. this.clWhereString=jkdata.clWhere;
  407. this.clWhereList=this.clWhereString.split(',');
  408. this.startTime=jkdata.startTime.slice(0,10);
  409. this.endTime=jkdata.endTime.slice(0,10);
  410. this.payType=jkdata.payType;
  411. this.img=res.data.img.img;
  412. this.isExistGroup=res.data.isExistGroup
  413. if(res.data.imgList){
  414. res.data.imgList.forEach(item=>{
  415. this.imgListArr.push(item.img)
  416. })
  417. }
  418. var shopNames=[];
  419. var shopList=[];
  420. if(res.data.shopList){
  421. res.data.shopList.forEach(item=>{
  422. item.id=item.shopId
  423. shopNames.push(item.shopName)
  424. shopList.push(item.shopId)
  425. })
  426. this.shopNames=shopNames.join(',')
  427. this.shopList=shopList.join(',')
  428. }
  429. var useshoplist=res.data.shopList
  430. this.ckMusic=res.data.selectedMusic;
  431. if(this.ckMusic){
  432. this.music=this.ckMusic.id;
  433. uni.setStorage({
  434. key: 'ckmusic',
  435. data: this.ckMusic,
  436. success: function () {
  437. }
  438. });
  439. }else{
  440. uni.removeStorageSync('ckmusic');
  441. }
  442. this.groupType=jkdata.groupType==1?true:false;
  443. this.groupNumber=jkdata.groupNumber;
  444. this.groupTime=jkdata.groupTime;
  445. this.groupMoney=jkdata.groupMoney;
  446. this.groupOutState=jkdata.groupOutState;
  447. this.groupRestrictions=jkdata.groupRestrictions;
  448. this.packageDetailList=res.data.couponList
  449. this.couponPackageData={
  450. name:jkdata.couponPackageName,
  451. id:jkdata.couponPackageId
  452. }
  453. //console.log(this.imgListArr)
  454. uni.setStorage({
  455. key: 'shopckList',
  456. data: useshoplist,
  457. success: function () {
  458. }
  459. });
  460. //this.list=res.data
  461. })
  462. },
  463. delimgzt(){
  464. this.img=''
  465. },
  466. upimgzt(){
  467. var that = this;
  468. uni.chooseImage({
  469. sourceType: ['album','camera'],
  470. count:1,
  471. sizeType:['compressed'],
  472. success: (chooseImageRes) => {
  473. const tempFilePaths = chooseImageRes.tempFilePaths;
  474. that.file=tempFilePaths[0];
  475. that.$refs.wCompress.start(that.file, {
  476. pixels: 600000, // 最大分辨率,默认二百万
  477. quality: 0.9, // 压缩质量,默认0.8
  478. type: 'png', // 图片类型,默认jpg
  479. base64: true, // 是否返回base64,默认false,非H5有效
  480. }).then(resxx => {
  481. uni.uploadFile({
  482. url: that.$request.baseUrl+'accompany/SuperCheckSheet/uploadFile', //仅为示例,非真实的接口地址
  483. filePath: resxx,
  484. name: 'file',
  485. formData: {
  486. 'user': 'test'
  487. },
  488. success: (uploadFileRes) => {
  489. that.img=JSON.parse(uploadFileRes.data).data[0]
  490. }
  491. });
  492. }).catch(e => {
  493. })
  494. // uni.uploadFile({
  495. // url: that.$request.baseUrl+'accompany/SuperCheckSheet/uploadFile', //仅为示例,非真实的接口地址
  496. // filePath: tempFilePaths[0],
  497. // name: 'file',
  498. // formData: {
  499. // 'user': 'test'
  500. // },
  501. // success: (uploadFileRes) => {
  502. // console.log(JSON.parse(uploadFileRes.data).data );
  503. // that.img=JSON.parse(uploadFileRes.data).data[0]
  504. // }
  505. // });
  506. }
  507. });
  508. },
  509. blurgroupNumber(){
  510. if(this.groupNumber%1 != 0||this.groupNumber<2){
  511. uni.showToast({
  512. title: '请输入大于1整数',
  513. icon:'none',
  514. duration: 2000
  515. });
  516. }
  517. },
  518. blurgroupTime(){
  519. if(!this.groupTime){
  520. uni.showToast({
  521. title: '请输入拼团有效期',
  522. icon:'none',
  523. duration: 2000
  524. });
  525. }else if(this.groupTime<0.5||this.groupTime>72){
  526. uni.showToast({
  527. title: '有效期为0.5小时至72小时',
  528. icon:'none',
  529. duration: 2000
  530. });
  531. }
  532. },
  533. blurgroupMoney(){
  534. if(this.groupMoney>this.money||this.groupMoney==this.money){
  535. uni.showToast({
  536. title: '拼团价格需小于支付金额',
  537. icon:'none',
  538. duration: 2000
  539. });
  540. }
  541. },
  542. preview(){
  543. /* if(this.isExistGroup){
  544. uni.showToast({
  545. title: '已有用户参与该拼团活动,无法修改报名信息',
  546. icon:'none',
  547. duration: 3000
  548. });
  549. return false
  550. } */
  551. //console.log(this.clWhere)
  552. // if(this.money==0){
  553. // this.money=0
  554. // }
  555. if(this.money==null){
  556. this.money=''
  557. }
  558. if(this.payType==2){
  559. this.money=0;
  560. }
  561. console.log(this.money)
  562. if(this.activityName==''){
  563. uni.showToast({
  564. title: '请输入活动名称',
  565. icon:'none',
  566. duration: 2000
  567. });
  568. return false;
  569. }else if(!this.startTime||!this.endTime){
  570. uni.showToast({
  571. title: '请选择报名时间',
  572. icon:'none',
  573. duration: 2000
  574. });
  575. return false;
  576. }else if(this.shopList==''){
  577. uni.showToast({
  578. title: '请选择活动门店',
  579. icon:'none',
  580. duration: 2000
  581. });
  582. return false;
  583. }else if(this.clWhereString==''){
  584. uni.showToast({
  585. title: '请选择报名凭证',
  586. icon:'none',
  587. duration: 2000
  588. });
  589. return false;
  590. }else if(this.number==''){
  591. uni.showToast({
  592. title: '请输入最多报名人数',
  593. icon:'none',
  594. duration: 2000
  595. });
  596. return false;
  597. }else if(this.money!==0&&this.money==''&&this.payType==1){
  598. uni.showToast({
  599. title: '请输入支付金额',
  600. icon:'none',
  601. duration: 2000
  602. });
  603. return false;
  604. }else if(this.groupType){
  605. if(!this.groupNumber){
  606. uni.showToast({
  607. title: '请输入拼团人数',
  608. icon:'none',
  609. duration: 2000
  610. });
  611. return false;
  612. }else if(this.groupNumber%1 != 0||this.groupNumber<2){
  613. uni.showToast({
  614. title: '请输入大于1整数',
  615. icon:'none',
  616. duration: 2000
  617. });
  618. return false;
  619. }
  620. if(!this.groupTime){
  621. uni.showToast({
  622. title: '请输入拼团有效期',
  623. icon:'none',
  624. duration: 2000
  625. });
  626. return false;
  627. }else if(this.groupTime<0.5||this.groupTime>72){
  628. uni.showToast({
  629. title: '有效期为0.5小时至72小时',
  630. icon:'none',
  631. duration: 2000
  632. });
  633. return false;
  634. }
  635. if(!this.groupMoney){
  636. uni.showToast({
  637. title: '请输入价格',
  638. icon:'none',
  639. duration: 2000
  640. });
  641. return false;
  642. }else if(this.groupMoney>this.money||this.groupMoney==this.money){
  643. uni.showToast({
  644. title: '拼团价格需小于支付金额',
  645. icon:'none',
  646. duration: 2000
  647. });
  648. return false;
  649. }
  650. }
  651. //return false;
  652. var editdata={
  653. id:this.id,
  654. activityName:this.activityName,
  655. startTime:this.startTime+ ' 00:00:00',
  656. endTime:this.endTime+ ' 23:59:59',
  657. number:this.number,
  658. activityContent:this.activityContent,
  659. clWhere:this.clWhereString,
  660. payType:this.payType,
  661. music:this.music,
  662. money:this.money,
  663. shopList:this.shopList,
  664. img:this.img,
  665. imgList:this.imgListArr.join(','),
  666. clState:'',
  667. groupType:this.groupType?1:0,
  668. groupNumber:this.groupNumber,
  669. groupTime:this.groupTime,
  670. groupMoney:this.groupMoney,
  671. groupOutState:this.groupOutState?1:0,
  672. groupRestrictions:this.groupRestrictions?1:0,
  673. couponPackageId:this.couponPackageData.id,
  674. couponPackageName:this.couponPackageData.name
  675. }
  676. console.log(editdata)
  677. //return false;
  678. uni.setStorage({
  679. key: 'editdata',
  680. data: editdata,
  681. success: function () {
  682. uni.navigateTo({
  683. url:'jkDetail?type=1'
  684. })
  685. }
  686. });
  687. },
  688. addShop(){
  689. uni.navigateTo({
  690. url:'ckshop'
  691. })
  692. },
  693. goMusic(){
  694. uni.navigateTo({
  695. url:'ckmusic'
  696. })
  697. },
  698. musicDel(){
  699. this.music='';
  700. this.ckMusic=''
  701. uni.removeStorageSync('ckmusic');
  702. },
  703. bindTimeChangeStart(e){
  704. console.log(e)
  705. this.startTime=e.detail.value;
  706. },
  707. bindTimeChangeendTime(e){
  708. this.endTime=e.detail.value;
  709. },
  710. clWhere(num){
  711. if(this.isExistGroup){
  712. return false
  713. }
  714. console.log(this.clWhereList)
  715. this.clWhereString=this.clWhereList.join(',');
  716. if(this.clWhereString.indexOf(num)!=-1){
  717. // this.clWhereList.remove(num)
  718. let index = this.clWhereList.indexOf(num);
  719. this.clWhereList.splice(index, 1)
  720. //this.remove(num)
  721. }else{
  722. this.clWhereList.push(num)
  723. }
  724. this.clWhereString=this.clWhereList.join(',');
  725. console.log(this.clWhereString)
  726. },
  727. delimg(index){
  728. this.imgListArr.splice(index, 1)
  729. },
  730. upimg(){
  731. var that = this;
  732. uni.chooseImage({
  733. sourceType: ['album','camera'],
  734. count:9,
  735. sizeType:['compressed'],
  736. success: (chooseImageRes) => {
  737. const tempFilePaths = chooseImageRes.tempFilePaths;
  738. that.file=tempFilePaths[0]
  739. that.$refs.wCompress.start(that.file, {
  740. pixels: 600000, // 最大分辨率,默认二百万
  741. quality: 0.9, // 压缩质量,默认0.8
  742. type: 'png', // 图片类型,默认jpg
  743. base64: true, // 是否返回base64,默认false,非H5有效
  744. }).then(resxx => {
  745. uni.uploadFile({
  746. url: that.$request.baseUrl+'accompany/SuperCheckSheet/uploadFile', //仅为示例,非真实的接口地址
  747. filePath: resxx,
  748. name: 'file',
  749. formData: {
  750. 'user': 'test'
  751. },
  752. success: (uploadFileRes) => {
  753. that.imgListArr=that.imgListArr.concat(JSON.parse(uploadFileRes.data).data)
  754. }
  755. });
  756. }).catch(e => {
  757. })
  758. // uni.uploadFile({
  759. // url: that.$request.baseUrl+'accompany/SuperCheckSheet/uploadFile', //仅为示例,非真实的接口地址
  760. // filePath: tempFilePaths[0],
  761. // name: 'file',
  762. // formData: {
  763. // 'user': 'test'
  764. // },
  765. // success: (uploadFileRes) => {
  766. // console.log(JSON.parse(uploadFileRes.data).data );
  767. // that.imgListArr=that.imgListArr.concat(JSON.parse(uploadFileRes.data).data)
  768. // //that.imgArr=that.imgArr.concat(JSON.parse(uploadFileRes.data).data) ;
  769. // //that.imgurl=JSON.parse(uploadFileRes.data).data[0];
  770. // //that.goAddzdy(that.imgurl)
  771. // }
  772. // });
  773. }
  774. });
  775. }
  776. }
  777. }
  778. </script>
  779. <style scoped>
  780. .couponLine{
  781. font-size: 26rpx;color: #333333;
  782. border-bottom: 1px solid #EEEEEE;
  783. line-height: 80rpx;
  784. padding-left: 30rpx;
  785. }
  786. .couponLineBOx{
  787. height: calc(70vh - 200rpx);
  788. overflow-y: auto;
  789. padding-top: 10px;
  790. }
  791. .searchImg{
  792. width: 40rpx;
  793. height: 40rpx;
  794. margin-top: 16rpx;
  795. margin-left: 20rpx;
  796. }
  797. .couponSearchBox{
  798. width: 702rpx;
  799. height: 72rpx;
  800. background: #F4F5F7;
  801. border-radius: 36rpx;
  802. margin-left: 24rpx;
  803. display:flex;
  804. position: relative;
  805. margin-top: 10px;
  806. }
  807. .topInput{
  808. font-size: 28rpx;
  809. height: 72rpx;
  810. line-height: 72rpx;
  811. padding-left: 16rpx;
  812. width: 500rpx;
  813. }
  814. .couponCont{
  815. width: 100vw;
  816. height: 70vh;
  817. background: #ffffff;
  818. margin-top: 30vh;
  819. border-radius: 32rpx 32rpx 0rpx 0rpx;
  820. }
  821. .couponTop{
  822. display: flex;
  823. justify-content: space-between;
  824. padding: 40rpx 24rpx 10rpx 24rpx;
  825. }
  826. .couponTopTxrt{
  827. font-weight: 500;
  828. color: #3C3C3C;
  829. font-size: 30rpx;
  830. line-height: 36rpx;
  831. }
  832. .couponClose{
  833. width: 36rpx;
  834. height: 36rpx;
  835. }
  836. .content{
  837. min-height: 100vh;
  838. background:#F4F5F7;
  839. }
  840. .lineLeft2{
  841. width: 300rpx;color: #666666;display: flex;align-items: center;
  842. }
  843. .helpIcon{
  844. width: 26rpx;height: 26rpx;padding-left: 10rpx;padding-top: 4rpx;
  845. }
  846. .preview{
  847. width: 750rpx;
  848. height: 98rpx;
  849. background: #3F90F7;
  850. line-height: 98rpx;
  851. text-align: center;
  852. color: #ffffff;
  853. font-size: 30rpx;
  854. position: fixed;
  855. left: 0;
  856. bottom: 0;
  857. }
  858. .musicBox{
  859. padding: 0 24rpx;
  860. }
  861. .musicLine{
  862. display: flex;
  863. justify-content: space-between;
  864. margin-bottom:30rpx;
  865. padding:26rpx 24rpx;
  866. background: #F4F5F7;
  867. border-radius: 10rpx;
  868. }
  869. .musicName{
  870. color: #3C3C3C;font-size: 24rpx;
  871. padding-left: 10rpx;
  872. }
  873. .musicLineLeft{
  874. display: flex;
  875. }
  876. .musicDel{
  877. width: 30rpx;
  878. height: 30rpx;
  879. }
  880. .musicImg{
  881. width: 36rpx;
  882. height: 36rpx;
  883. }
  884. .line2{
  885. padding: 30rpx 24rpx;
  886. border-bottom: 1px solid #EEEEEE;
  887. }
  888. .musicJt{
  889. width: 28rpx;
  890. height: 28rpx;
  891. margin-top: 8rpx;
  892. }
  893. .musicRight{
  894. display: flex;
  895. justify-content: space-between;
  896. width: 500rpx;
  897. }
  898. .musicMS{
  899. color: #CCCCCC;
  900. }
  901. .lineimgdel{
  902. width: 37rpx;
  903. height: 37rpx;
  904. position: absolute;
  905. top: -18rpx;
  906. right: -18rpx;
  907. }
  908. .lineimghz{
  909. margin-right: 24rpx;
  910. position: relative;
  911. margin-top: 24rpx;
  912. }
  913. .lineimg{
  914. width: 150rpx;
  915. height: 150rpx;
  916. }
  917. .lineTitle{
  918. color: #666666;font-size: 28rpx;
  919. }
  920. .lineMS{
  921. color: #999999;font-size: 24rpx;padding-top: 10rpx;
  922. }
  923. .lineImgBOx{
  924. display: flex;
  925. flex-wrap: wrap;
  926. }
  927. .payBox{
  928. display: flex;
  929. }
  930. .payTypeImg{
  931. width: 36rpx;
  932. height: 36rpx;
  933. }
  934. .payType{
  935. display: flex;
  936. line-height: 36rpx;
  937. }
  938. .payTypeTxt{
  939. padding-left: 10rpx;
  940. color: #3C3C3C;
  941. }
  942. .line{
  943. display: flex;
  944. font-size: 28rpx;
  945. padding: 30rpx 24rpx;
  946. border-bottom: 1px solid #EEEEEE;
  947. }
  948. .linecoupon{
  949. justify-content: space-between;
  950. }
  951. .linexx{
  952. color: #FF3B30;
  953. }
  954. .dateView{
  955. color:#3C3C3C ;
  956. }
  957. .lineLeft{
  958. width: 200rpx;
  959. color: #666666;
  960. }
  961. .clWhereBox{
  962. display: flex;
  963. }
  964. .clWhereLine{
  965. width: 100rpx;
  966. height: 52rpx;
  967. background: #F4F5F7;
  968. border-radius: 10rpx;
  969. text-align: center;
  970. color: #3C3C3C;
  971. line-height: 52rpx;
  972. font-size: 24rpx;
  973. margin-right: 24rpx;
  974. }
  975. .clWhereBox .clWhereActive{
  976. background: #EAF3FF;
  977. border: 2rpx solid #3F90F7;
  978. height: 48rpx;
  979. color: #3F90F7;
  980. height: 48rpx;
  981. line-height: 48rpx;
  982. width: 96rpx;
  983. }
  984. .timelineRight{
  985. display: flex;
  986. }
  987. .textsr{
  988. width: 500rpx;
  989. height: 180rpx;
  990. }
  991. .shopListNo{
  992. width: 400rpx;
  993. white-space:nowrap;
  994. overflow:hidden;
  995. text-overflow:ellipsis;
  996. color: #CCCCCC;
  997. }
  998. .shopListY{
  999. width: 400rpx;
  1000. white-space:nowrap;
  1001. overflow:hidden;
  1002. text-overflow:ellipsis;
  1003. color: #3C3C3C;
  1004. }
  1005. .addshop{
  1006. color: #3F90F7;
  1007. padding-left: 10rpx;
  1008. }
  1009. .shopckBox{
  1010. display: flex;
  1011. }
  1012. .timeHx{
  1013. color: #CCCCCC;
  1014. padding: 0 30rpx;
  1015. }
  1016. .lineRightInput{
  1017. font-size: 28rpx;
  1018. color:#3C3C3C ;
  1019. width: 500rpx;
  1020. }
  1021. .linecInput{
  1022. font-size: 28rpx;
  1023. color:#3C3C3C ;
  1024. width: 400rpx;
  1025. }
  1026. .lineRight{
  1027. color:#3C3C3C ;
  1028. }
  1029. .inputPlace{
  1030. color: #CCCCCC;
  1031. }
  1032. .dateViewno{
  1033. color: #CCCCCC;
  1034. }
  1035. .box{
  1036. background: #ffffff;
  1037. padding-bottom: 30rpx;
  1038. }
  1039. .kk{
  1040. background:#F4F5F7;
  1041. height: 20rpx;
  1042. }
  1043. .title{
  1044. padding-left: 24rpx;
  1045. padding-top: 30rpx;
  1046. color: #333333;
  1047. font-size: 32rpx;
  1048. line-height: 45rpx;
  1049. font-weight: 500;
  1050. }
  1051. .lineBorderNo{
  1052. border-bottom: none !important;
  1053. }
  1054. .line3{
  1055. display: flex;justify-content: space-between;
  1056. padding: 16rpx 24rpx;
  1057. }
  1058. .line3 .lineLeft{
  1059. display: flex;align-items: center;
  1060. }
  1061. .linecouponCont{
  1062. display: flex;
  1063. justify-content: space-between;
  1064. padding: 15rpx 24rpx;
  1065. }
  1066. .linecouponContLeft{
  1067. display: flex;
  1068. }
  1069. .couponType{
  1070. color: #FFA511;
  1071. border: 1px solid #FFA511;
  1072. border-radius: 4rpx;
  1073. font-size: 18rpx;
  1074. line-height: 26rpx;
  1075. padding: 0 8rpx;
  1076. height: 26rpx;
  1077. margin-top: 5rpx;
  1078. }
  1079. .couponName{
  1080. font-size: 26rpx;line-height: 38rpx;color: #3C3C3C;
  1081. padding-left: 20rpx;
  1082. }
  1083. .couponNum{
  1084. font-size: 26rpx;line-height: 38rpx;color: #999999;
  1085. }
  1086. .couponBox{
  1087. width: 100vw;
  1088. height: 100vh;
  1089. background: rgba(0, 0, 0, 0.5);
  1090. position: fixed;
  1091. top: 0;
  1092. left: 0;
  1093. }
  1094. </style>