eadit.vue 37 KB

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