eadit.vue 30 KB

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