eadit.vue 31 KB

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