activity.vue 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380
  1. <template>
  2. <view class="uni-main">
  3. <view class="sticky-nav">
  4. <view class="nav-box">
  5. <u-icon name="arrow-left" color="#000" size="48" @click="navBack()"></u-icon>
  6. <text class="title">寺院活动</text>
  7. <u-icon class="right-icon" name="zhuanfa" color="#000" size="48" @click="showMenu()"></u-icon>
  8. </view>
  9. </view>
  10. <view class="uni-header_title">
  11. <text v-text="info.title"></text>
  12. </view>
  13. <view class="uni-banner">
  14. <image class="uin-banner_thumb" :src="info.thumb" width="100" height="120"></image>
  15. </view>
  16. <view class="uni-info">
  17. <view class="uni-text uni-info_time">
  18. 时间: <text class="time" v-text="info.publish_at"></text>
  19. </view>
  20. <view class="uni-text uni-info_price">
  21. <view>费用:<text class="price" v-text="info.price?'¥'+info.price: '免费'"></text></view>
  22. </view>
  23. </view>
  24. <view class="uni-content">
  25. <view class="header">
  26. <text class="info_text">活动详情</text>
  27. </view>
  28. <view class="content" v-html="info.content">
  29. </view>
  30. </view>
  31. <view class="uni-buy">
  32. <view class="uni-buy_btn" @click="showPopup=true">
  33. <text v-text="info.type==1? '我要代订': (info.type==2?'我要助印': '我要供奉')"></text>
  34. </view>
  35. </view>
  36. <view class="specs-box">
  37. <view v-show="showPopup" @touchmove.stop.prevent="stopSlide">
  38. <!-- 遮罩层 -->
  39. <view class="mask" @click="modalCancel"></view>
  40. <!-- 内容区 -->
  41. <view class="tip">
  42. <view class="main">
  43. <view class="count">
  44. 随喜:<text class="input-box"><input class="tip-input" type="text" placeholder="8-3000" disabled="true"/>券</text>
  45. </view>
  46. <view class="options">
  47. <text :class="'option'+(v.value==selectOptionData.value? ' active' : '')" v-for="(v,k) in quanArr" v-text="v.name" @click="selectOption(v)"></text>
  48. </view>
  49. </view>
  50. <view class="bottom">
  51. <view class="btn cancel" @click="modalCancel()">取消</view>
  52. <view class="btn confirm" @click="modalConfirm()">确定</view>
  53. </view>
  54. </view>
  55. </view>
  56. </view>
  57. </view>
  58. </template>
  59. <script>
  60. export default {
  61. data() {
  62. return {
  63. showPopup: false,
  64. phone: '12345678',
  65. autoplay: true,
  66. adAutoplay: true,
  67. interval: 2000,
  68. adInterval: 4000,
  69. duration: 1000,
  70. adDuration: 500,
  71. info: {
  72. id: 1,
  73. type: 1,
  74. thumb: '../../static/shop/1.jpg',
  75. title: '深圳线下心经交流会',
  76. price: 10.5,
  77. description: '描述',
  78. publish_at: '06月1日-07月30日',
  79. content: '活动详情',
  80. join_num: 10,
  81. },
  82. selectOptionData: {name: '',value: ''},
  83. quanArr: [
  84. {name: '8券', value: '8'},
  85. {name: '28券', value: '28'},
  86. {name: '58券', value: '58'},
  87. {name: '68券', value: '68'},
  88. {name: '168券', value: '168'},
  89. {name: '268券', value: '268'},
  90. ],
  91. activityList: [{
  92. id: 1,
  93. thumb: '../../static/index/shiyuan/sjmn.jpg',
  94. title: "深圳线下祈福交流活动",
  95. description: "般若智慧、慈悲宽容",
  96. join_count: "5",
  97. publish_at: "5月20-6月10日",
  98. price: 0,
  99. type: 1,
  100. },
  101. {
  102. id: 2,
  103. thumb: '../../static/index/gongdeng/wen_shu.jpg',
  104. title: "弘扬佛法,助印经书",
  105. description: "粉丝地方",
  106. join_count: "24",
  107. publish_at: "5月24-6月16日",
  108. price: 50.00,
  109. type: 1,
  110. },
  111. {
  112. id: 3,
  113. thumb: '../../static/index/gongdeng/guanyin.jpg',
  114. title: "观世音菩萨",
  115. description: "救苦救难",
  116. join_count: "10",
  117. publish_at: "5月21-6月20日",
  118. price: 100.00,
  119. type: 1,
  120. },
  121. {
  122. id: 4,
  123. thumb: '../../static/index/gongdeng/caishenye.jpg',
  124. title: "财神爷",
  125. description: "财运亨通",
  126. join_count: "300",
  127. publish_at: "5月20-6月18日",
  128. price: 0.00,
  129. type: 3,
  130. },
  131. {
  132. id: 5,
  133. thumb: '../../static/index/gongdeng/qianshouguanyin.jpg',
  134. title: "千手观音",
  135. description: "守护生肖:鼠",
  136. join_count: "1200",
  137. publish_at: "5月10-6月11日",
  138. price: 80.00,
  139. type: 2,
  140. }
  141. ],
  142. }
  143. },
  144. onLoad(option){
  145. let _uni = this
  146. let id = option.id
  147. _uni.activityList.forEach((item,key) => {
  148. if(item.id == id){
  149. _uni.info = item
  150. }
  151. })
  152. },
  153. methods: {
  154. navBack(){
  155. uni.navigateBack({
  156. delta: 1
  157. });
  158. },
  159. showMenu(){
  160. },
  161. modalCancel(){
  162. this.showPopup = false;
  163. },
  164. modalConfirm(){
  165. if(this.selectOptionData.value <= 0){
  166. uni.showToast({
  167. title: '请先选择随喜券数',
  168. icon: 'none'
  169. })
  170. return false;
  171. }
  172. },
  173. selectOption(data){
  174. this.selectOptionData = data
  175. },
  176. stopSlide() {
  177. return;
  178. }
  179. },
  180. }
  181. </script>
  182. <style lang="less" scoped>
  183. .uni-main {
  184. width: 100%;
  185. height: 100%;
  186. background-color: #fff;
  187. font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  188. }
  189. .sticky-nav {
  190. position: sticky;
  191. width: 100%;
  192. top: 0;
  193. z-index: 1;
  194. border-bottom: 1rpx solid rgb(229,229,229);
  195. }
  196. .nav-box {
  197. width: 100%;
  198. padding-top: 50rpx;
  199. display: flex;
  200. align-items: center;
  201. background: #fff;
  202. height: 100rpx;
  203. padding-bottom: 50rpx;
  204. /deep/.u-icon{
  205. margin-left: 20rpx!important;
  206. }
  207. .title {
  208. font-size: 38rpx;
  209. color: #000;
  210. width: 100%;
  211. text-align: center;
  212. }
  213. .right-icon {
  214. float: right;
  215. margin-right: 20rpx;
  216. }
  217. }
  218. .uni-header_title {
  219. padding: 10rpx 0rpx;
  220. text-align: center;
  221. font-size: 36rpx;
  222. }
  223. .uni-banner .uin-banner_thumb {
  224. width: 80%;
  225. height: 300rpx;
  226. margin: 0 auto;
  227. display: block;
  228. }
  229. .uni-info .uni-text {
  230. font-size: 32rpx;
  231. margin-bottom: 10rpx;
  232. padding: 0rpx 10rpx;
  233. }
  234. .uni-info .uni-info_time {
  235. padding-top: 20rpx;
  236. }
  237. .uni-info .uni-info_price {
  238. padding-bottom: 20rpx;
  239. border-bottom: 8rpx solid #f1f1f1;
  240. }
  241. .uni-info .uni-info_price .price {
  242. color: #ff7a55;
  243. }
  244. .uni-info .uni-info_stock .kefu {
  245. float: right;
  246. margin-right: 10rpx;
  247. }
  248. .uni-content .header {
  249. padding: 20rpx 10px;
  250. font-size: 36rpx;
  251. font-weight: bold;
  252. text-align: center;
  253. color: #ff7a55;
  254. }
  255. .uni-content .content {
  256. border-top: 8rpx solid #f1f1f1;
  257. }
  258. .uni-content .content {
  259. padding: 10rpx;
  260. }
  261. .uni-buy {
  262. text-align: center;
  263. width: 100%;
  264. position: fixed;
  265. bottom: 0;
  266. background-color: #ccad51;
  267. }
  268. .uni-buy .uni-buy_btn {
  269. font-size: 40rpx;
  270. padding: 20rpx 0rpx;
  271. color: #fff;
  272. }
  273. /* 弹窗 */
  274. .mask {
  275. z-index: 99;
  276. background: rgba(0, 0, 0, 0.6);
  277. position: fixed;
  278. bottom: 0;
  279. right: 0;
  280. left: 0;
  281. top: 0;
  282. }
  283. .tip {
  284. z-index: 999;
  285. min-width: 600rpx;
  286. display: flex;
  287. font-size: 36rpx;
  288. text-align: center;
  289. background: #FFFFFF;
  290. align-items: center;
  291. flex-direction: column;
  292. justify-content: center;
  293. border-radius: 8rpx;
  294. position: fixed;
  295. left: 50%;
  296. top: 50%;
  297. transform: translate(-50%, -50%);
  298. }
  299. .tip .main {
  300. padding: 50rpx 35rpx 20rpx;
  301. }
  302. .tip .count {
  303. width: 100%;
  304. text-align: left;
  305. }
  306. .tip .count .input-box {
  307. color: #666;
  308. background-color: #ccc;
  309. padding: 6rpx 10rpx;
  310. font-weight: bold;
  311. border-radius: 4rpx;
  312. }
  313. .tip .count .tip-input {
  314. display: inline-block;
  315. width: 120rpx;
  316. vertical-align: middle;
  317. }
  318. .tip .options {
  319. margin-top: 30rpx;
  320. text-align: center;
  321. }
  322. .tip .options .option {
  323. border-radius: 4rpx;
  324. background-color: #ccc;
  325. padding: 6rpx 10rpx;
  326. width: 26%;
  327. margin: 10rpx 3%;
  328. text-align: center;
  329. font-weight: bold;
  330. color: #666;
  331. display: inline-block;
  332. }
  333. .tip .options .option.active {
  334. background-color: #ccad51;
  335. }
  336. .tip .bottom {
  337. width: 100%;
  338. position: relative;
  339. bottom: 0;
  340. }
  341. .tip .bottom .btn {
  342. width: 50%;
  343. display: inline-block;
  344. border: 1px solid #ccc;
  345. padding: 10rpx 0rpx;
  346. font-weight: bold;
  347. }
  348. .tip .bottom .btn.cancel {
  349. border-bottom-left-radius: 8rpx;
  350. }
  351. .tip .bottom .btn.confirm {
  352. color: red;
  353. border-bottom-right-radius: 8rpx;
  354. }
  355. </style>