app-diy-page.vue 51 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010
  1. <template>
  2. <view class="app-diy-page" v-bind:class="mp_link_top ? 'mp_link_top' : ''">
  3. <view class="nav-bar dir-left-nowrap" v-bind:class="mp_link_top ? 'mp_link_top' : ''" v-if="newData.show_navs == 1">
  4. <block v-for="(nav, index) in newData.navs" :key="index">
  5. <view class="nav-bar-one cross-center box-grow-0"
  6. v-bind:class="nav_active === index ? 'active' : ''"
  7. :style="{'color': nav_active === index ? theme.color : ''}"
  8. v-on:click='changeNav(index)'
  9. >
  10. {{nav.name}}
  11. </view>
  12. </block>
  13. </view>
  14. <view class="diy-template">
  15. <block v-for="(item, index) in newData.navs" :key="index">
  16. <template v-if="nav_active === index">
  17. <block v-for="(temp, temp_index) in item.template.data" :key="temp_index">
  18. <template v-if="temp.id === 'background'">
  19. <view
  20. class="app-diy-bg"
  21. :style="[
  22. {'background-color':`${temp.data.backgroundColor}`,
  23. 'background-image': temp.data.backgroundPicUrl ? `url(${temp.data.backgroundPicUrl})` : `none`,
  24. 'background-size':`${temp.data.backgroundWidth + '% ' + temp.data.backgroundHeight + '%'}`,
  25. 'background-position':`${transLabelBackgroundPosition(temp.data.position)}`,
  26. 'background-repeat':`${transLabelBackgroundRepeat(temp.data.mode)}`}
  27. ]"
  28. ></view>
  29. </template>
  30. <!--搜索-->
  31. <template v-else-if="temp.id === 'search'">
  32. <app-search-for v-bind:value="temp.data"></app-search-for>
  33. </template>
  34. <!--轮播图-->
  35. <template v-else-if="temp.id === 'banner'">
  36. <template v-if="temp.data.banners.length > 0">
  37. <view :style="{height: temp.data.height + 'rpx'}" v-if="temp.data.effect == 1 || !temp.data.effect">
  38. <app-swiper
  39. :list="temp.data.banners"
  40. :autoplay="temp.data.autoplay === 0 ? true : false"
  41. name="pic_url"
  42. :effect3d="temp.data.style === 2 ? true : false"
  43. :height="temp.data.height"
  44. :effect3dPreviousMargin="50"
  45. :imgMode="temp.data.fill === 0 ? 'aspectFit' : 'scaleToFill'"
  46. :interval="temp.data.interval ? temp.data.interval : 3000"
  47. :duration="temp.data.duration ? temp.data.duration : 500"
  48. :mode="temp.data.mode"
  49. ></app-swiper>
  50. </view>
  51. <view :style="{height: temp.data.height + 'rpx'}" v-if="temp.data.effect == 2">
  52. <u-swiper
  53. :list="temp.data.banners"
  54. name="pic_url"
  55. :height="temp.data.height"
  56. :interval="temp.data.interval ? temp.data.interval : 3000"
  57. :duration="temp.data.duration ? temp.data.duration : 500"
  58. :mode="temp.data.mode"
  59. :imgMode="temp.data.fill === 0 ? 'aspectFit' : 'scaleToFill'"
  60. :autoplay="temp.data.autoplay === 0 ? true : false"
  61. >
  62. </u-swiper>
  63. </view>
  64. </template>
  65. </template>
  66. <!-- 普通商品列表 -->
  67. <template v-else-if="temp.id === 'goods'">
  68. <view
  69. :style="[
  70. {'background-color':`${temp.data.backgroundColor}`,
  71. 'background-image': temp.data.backgroundPicUrl ? `url(${temp.data.backgroundPicUrl})` : `none`,
  72. 'background-size':`${temp.data.backgroundWidth + '% ' + temp.data.backgroundHeight + '%'}`,
  73. 'background-position':`${transLabelBackgroundPosition(temp.data.position)}`,
  74. 'background-repeat':`${transLabelBackgroundRepeat(temp.data.mode)}`}
  75. ]">
  76. <template v-if="temp.data.catPosition === 'top'">
  77. <u-ordinary-list
  78. v-bind:theme="theme"
  79. v-bind:show-cat="temp.data.showCat"
  80. v-bind:cat-list="temp.data.catList"
  81. v-bind:cat-style="temp.data.catStyle"
  82. v-bind:list="temp.data.list"
  83. v-bind:list-style="temp.data.listStyle"
  84. v-bind:goods-style="temp.data.goodsStyle"
  85. v-bind:goods-tag-pic-url="temp.data.goodsTagPicUrl"
  86. v-bind:goods-cover-proportion="temp.data.goodsCoverProportion"
  87. v-bind:show-goods-tag="temp.data.showGoodsTag"
  88. v-bind:show-goods-name="temp.data.showGoodsName"
  89. v-bind:show-goods-price="temp.data.showGoodsPrice"
  90. v-bind:show-buy-btn="temp.data.showBuyBtn"
  91. v-bind:buy-btn="temp.data.buyBtn"
  92. v-bind:buy-btn-style="temp.data.buyBtnStyle"
  93. v-bind:buy-btn-text="temp.data.buyBtnText"
  94. v-bind:button-color="temp.data.buttonColor"
  95. v-bind:text-style="temp.data.textStyle"
  96. v-bind:is-under-line-price="temp.data.isUnderLinePrice"
  97. v-bind:fill="temp.data.fill"
  98. v-bind:isDIY="true"
  99. v-bind:tag-color="temp.data.tagColor"
  100. v-bind:cat-selected-color="temp.data.catSelectedColor"
  101. v-bind:cat-unselected-color="temp.data.catUnselectedColor"
  102. v-bind:cat-bg-color="temp.data.catBgColor"
  103. v-on:buyProduct="buyProduct"
  104. >
  105. </u-ordinary-list>
  106. </template>
  107. <template v-else>
  108. <app-recommended-product-list
  109. v-bind:show-cat="temp.data.showCat"
  110. v-bind:show-buy-btn="temp.data.showBuyBtn"
  111. v-bind:cat-style="temp.data.catStyle"
  112. v-bind:cat-list="temp.data.catList"
  113. v-bind:list="temp.data.list" :list-style="temp.data.listStyle"
  114. v-bind:goods-cover-proportion="temp.data.goodsCoverProportion"
  115. v-bind:fill="temp.data.fill" :goods-style="temp.data.goodsStyle"
  116. v-bind:show-goods-name="temp.data.showGoodsName"
  117. v-bind:show-goods-price="temp.data.showGoodsPrice"
  118. v-bind:buy-btn="temp.data.buyBtn" :sign="temp.id"
  119. v-bind:buy-btn-style="temp.data.buyBtnStyle"
  120. v-bind:buy-btn-text="temp.data.buyBtnText"
  121. v-bind:show-goods-tag="temp.data.showGoodsTag"
  122. v-bind:customize-goods-tag="temp.data.customizeGoodsTag"
  123. v-bind:goods-tag-pic-url="temp.data.goodsTagPicUrl"
  124. v-bind:button-color="temp.data.buttonColor"
  125. v-bind:is-under-line-price="temp.data.isUnderLinePrice"
  126. v-bind:theme="theme"
  127. v-bind:cat-position="temp.data.catPosition"
  128. v-on:buyProduct="buyProduct"
  129. v-bind:tag-color="temp.data.tagColor"
  130. v-bind:cat-selected-color="temp.data.catSelectedColor"
  131. v-bind:cat-unselected-color="temp.data.catUnselectedColor"
  132. v-bind:cat-bg-color="temp.data.catBgColor"
  133. ></app-recommended-product-list>
  134. </template>
  135. </view>
  136. </template>
  137. <!-- 插件商品列表 -->
  138. <template v-else-if="['miaosha', 'flash-sale'].indexOf(temp.id) !== -1 && temp.data.addGoodsType == 0">
  139. <app-diy-m-goods-list
  140. v-bind:mTitle="temp.data.mTitle"
  141. v-bind:mColor="temp.data.mColor"
  142. v-bind:mBgType="temp.data.mBgType"
  143. v-bind:mBgColor="temp.data.mBgColor"
  144. v-bind:mBgGradientColor="temp.data.mBgGradientColor"
  145. v-bind:mTimeColor="temp.data.mTimeColor"
  146. v-bind:mTimeBgColor="temp.data.mTimeBgColor"
  147. v-bind:mGoodsBgColor="temp.data.mGoodsBgColor"
  148. v-bind:showGoodsName="temp.data.showGoodsName"
  149. v-bind:showGoodsPrice="temp.data.showGoodsPrice"
  150. v-bind:showGoodsTag="temp.data.showGoodsTag"
  151. v-bind:customizeGoodsTag="temp.data.customizeGoodsTag"
  152. v-bind:goodsTagPicUrl="temp.data.goodsTagPicUrl"
  153. v-bind:isUnderLinePrice="temp.data.isUnderLinePrice"
  154. v-bind:backgroundColor="temp.data.backgroundColor"
  155. v-bind:showProgressBar="temp.data.showProgressBar"
  156. v-bind:mData="temp.data.mData"
  157. v-bind:sign="temp.id"
  158. v-bind:theme="theme"
  159. ></app-diy-m-goods-list>
  160. </template>
  161. <template v-else-if="temp.id === 'pintuan'
  162. || temp.id === 'miaosha'
  163. || temp.id === 'advance'
  164. || temp.id === 'booking'
  165. || temp.id === 'bargain'
  166. || temp.id === 'pick'
  167. || temp.id === 'lottery'
  168. || temp.id === 'integral-mall'
  169. || temp.id === 'gift'
  170. || temp.id === 'exchange'
  171. || temp.id === 'composition'
  172. || temp.id === 'flash-sale'
  173. || temp.id === 'step'
  174. || temp.id === 'wholesale'">
  175. <view :style="[
  176. {'background-color':`${temp.data.backgroundColor}`,
  177. 'background-image': temp.data.backgroundPicUrl ? `url(${temp.data.backgroundPicUrl})` : `none`,
  178. 'background-size':`${temp.data.backgroundWidth + '% ' + temp.data.backgroundHeight + '%'}`,
  179. 'background-position':`${transLabelBackgroundPosition(temp.data.position)}`,
  180. 'background-repeat':`${transLabelBackgroundRepeat(temp.data.mode)}`}]"
  181. >
  182. <template v-if="temp.id === 'integral-mall' && temp.data.showCoupon">
  183. <app-exclusive-coupon
  184. v-bind:none-color="true"
  185. v-bind:list="temp.data.coupon_list"
  186. v-bind:sign="temp.id"
  187. v-bind:text-color="temp.data.couponColor"
  188. v-bind:show-top="false"
  189. v-bind:coupon_req="coupon_req"
  190. v-bind:unclaimed-bg="temp.data.couponPicUrl"
  191. ></app-exclusive-coupon>
  192. </template>
  193. <app-diy-goods-list
  194. v-bind:show-buy-btn="temp.data.showBuyBtn"
  195. v-bind:list="temp.data.list"
  196. v-bind:list-style="temp.data.listStyle"
  197. v-bind:goods-cover-proportion="temp.data.goodsCoverProportion"
  198. v-bind:fill="temp.data.fill"
  199. v-bind:goods-style="temp.data.goodsStyle"
  200. v-bind:show-goods-name="temp.data.showGoodsName"
  201. v-bind:text-style="temp.data.textStyle"
  202. v-bind:sign="temp.id"
  203. v-bind:button-color="temp.data.buttonColor"
  204. v-bind:buy-btn-style="temp.data.buyBtnStyle"
  205. v-bind:buy-btn-text="temp.data.buyBtnText"
  206. v-bind:show-goods-tag="temp.data.showGoodsTag"
  207. v-bind:page-hide="pageHide"
  208. v-bind:show-progress-bar="temp.data.showProgressBar"
  209. v-bind:customize-goods-tag="temp.data.customizeGoodsTag"
  210. v-bind:is-under-line-price="temp.data.isUnderLinePrice"
  211. v-bind:goods-tag-pic-url="temp.data.goodsTagPicUrl"
  212. v-bind:theme="theme"
  213. ></app-diy-goods-list>
  214. </view>
  215. </template>
  216. <template v-else-if="temp.id === 'rubik'">
  217. <view style="position: relative">
  218. <app-image-ad
  219. v-bind:image-style="temp.data.style"
  220. v-bind:list="temp.data.list"
  221. v-bind:height="temp.data.height"
  222. ></app-image-ad>
  223. <block v-for="(hotspot, hotspot_index) in temp.data.hotspot" v-bind:key="hotspot_index">
  224. <app-hotspot v-if="temp.data.a_height != '50.00'" v-bind:hotspot="rubikHotspot(hotspot)"></app-hotspot>
  225. </block>
  226. </view>
  227. </template>
  228. <template v-else-if="temp.id === 'notice'">
  229. <u-announcement
  230. v-bind:bgColor="temp.data.background"
  231. v-bind:btn-color="temp.data.btnColor"
  232. v-bind:btn-height="temp.data.btnHeight"
  233. v-bind:btn-radius="`${temp.data.btnRadius}rpx`"
  234. v-bind:btn-text="temp.data.btnText"
  235. v-bind:btn-text-color="temp.data.btnTextColor"
  236. v-bind:btn-width="temp.data.btnWidth"
  237. v-bind:content="temp.data.content"
  238. v-bind:header-url="temp.data.headerUrl"
  239. v-bind:icon="temp.data.icon"
  240. v-bind:name="temp.data.name"
  241. v-bind:textColor="temp.data.textColor"
  242. ></u-announcement>
  243. </template>
  244. <template v-else-if="temp.id === 'nav'">
  245. <!-- 新数据 -->
  246. <template v-if="temp.data.modeType">
  247. <app-navigation-two-icon
  248. v-bind:mode-type="temp.data.modeType"
  249. v-bind:background="temp.data.backgroundColor"
  250. v-bind:color="temp.data.color"
  251. v-bind:navs="temp.data.navs"
  252. v-bind:columns="temp.data.columns"
  253. v-bind:temp-index="temp_index"
  254. v-bind:nav-type="temp.data.navType"
  255. v-bind:alone-num="temp.data.aloneNum"
  256. v-bind:line-num="temp.data.lineNum"
  257. v-bind:swiper-type="temp.data.swiperType"
  258. v-bind:swiper-color="temp.data.swiperColor"
  259. v-bind:swiper-no-color="temp.data.swiperNoColor"
  260. :bg-type="temp.data.bgType"
  261. :background-pic-url = "temp.data.backgroundPicUrl"
  262. ></app-navigation-two-icon>
  263. </template>
  264. <!-- 老数据 -->
  265. <template v-else>
  266. <view
  267. :style="[
  268. {'background-color':`${temp.data.backgroundColor}`,
  269. 'background-image': temp.data.backgroundPicUrl ? `url(${temp.data.backgroundPicUrl})` : `none`,
  270. 'background-size':`${temp.data.backgroundWidth + '% ' + temp.data.backgroundHeight + '%'}`,
  271. 'background-position':`${transLabelBackgroundPosition(temp.data.position)}`,
  272. 'background-repeat':`${transLabelBackgroundRepeat(temp.data.mode)}`}]"
  273. >
  274. <app-navigation-icon
  275. v-bind:background="''"
  276. v-bind:color="temp.data.color"
  277. v-bind:rows="temp.data.rows"
  278. v-bind:columns="temp.data.columns"
  279. v-bind:scroll="temp.data.scroll"
  280. v-bind:navs="temp.data.navs"
  281. ></app-navigation-icon>
  282. </view>
  283. </template>
  284. </template>
  285. <template v-else-if="temp.id === 'video'">
  286. <app-video
  287. v-bind:pic-url="temp.data.pic_url"
  288. v-bind:url="temp.data.url"
  289. v-bind:has-auto="temp.data.hasAuto"
  290. v-bind:has-cycle="temp.data.hasCycle"
  291. ></app-video>
  292. </template>
  293. <template v-else-if="temp.id === 'link'">
  294. <app-associated-link
  295. v-bind:arrows-switch="temp.data.arrowsSwitch"
  296. v-bind:background="temp.data.background"
  297. v-bind:color="temp.data.color"
  298. v-bind:position="temp.data.position"
  299. v-bind:style-color="temp.data.styleColor"
  300. v-bind:link="Object.assign({}, temp.data.link)"
  301. v-bind:styleNum="temp.data.style"
  302. v-bind:pic-switch="temp.data.picSwitch"
  303. v-bind:pic-url="temp.data.picUrl"
  304. v-bind:font-size="temp.data.fontSize"
  305. v-bind:title="temp.data.title"
  306. ></app-associated-link>
  307. </template>
  308. <template v-else-if="temp.id === 'topic'">
  309. <template v-if="temp.data.style === 'normal'">
  310. <app-special-topic
  311. v-bind:count="temp.data.count"
  312. v-bind:icon="temp.data.icon"
  313. v-bind:logo_1="temp.data.logo_1"
  314. v-bind:logo_2="temp.data.logo_2"
  315. v-bind:topic_list="temp.data.topic_list"
  316. ></app-special-topic>
  317. </template>
  318. <template v-else-if="temp.data.style === 'list'">
  319. <app-special-topic-list
  320. v-bind:cat-show="temp.data.cat_show"
  321. v-bind:list="temp.data.list"
  322. v-bind:theme="theme"
  323. v-bind:topic-list="temp.data.topic_list"
  324. v-bind:tag-color="temp.data.tagColor"
  325. v-bind:cat-selected-color="temp.data.catSelectedColor"
  326. v-bind:cat-unselected-color="temp.data.catUnselectedColor"
  327. v-bind:cat-bg-color="temp.data.catBgColor"
  328. ></app-special-topic-list>
  329. </template>
  330. </template>
  331. <template v-else-if="temp.id === 'store'">
  332. <app-shop
  333. v-bind:list="temp.data.list"
  334. v-bind:nav-pic-url="temp.data.navPicUrl"
  335. v-bind:score-pic-url="temp.data.scorePicUrl"
  336. v-bind:show-name="temp.data.showName"
  337. v-bind:show-score="temp.data.showScore"
  338. v-bind:show-tel="temp.data.showTel"
  339. v-bind:scrollTop="scrollTop"
  340. ></app-shop>
  341. </template>
  342. <template v-else-if="temp.id === 'copyright'">
  343. <app-copyright
  344. v-bind:background-color="temp.data.backgroundColor"
  345. v-bind:text="temp.data.text"
  346. v-bind:pic-url="temp.data.picUrl"
  347. v-bind:link="temp.data.link"
  348. ></app-copyright>
  349. </template>
  350. <template v-else-if="temp.id === 'user-info'">
  351. <app-user-center
  352. v-bind:top-pic-url="temp.data.backgroundPicUrl"
  353. v-bind:member-pic-url="userCenter.member_pic_url"
  354. v-bind:top-style="temp.data.style"
  355. ></app-user-center>
  356. </template>
  357. <template v-else-if="temp.id === 'user-order'">
  358. <app-my-order
  359. v-bind:order_bar="temp.data.navs"
  360. v-bind:background-color="temp.data.backgroundColor"
  361. v-bind:theme="theme"
  362. ></app-my-order>
  363. </template>
  364. <!-- 优惠券 -->
  365. <template v-else-if="temp.id === 'coupon'">
  366. <app-exclusive-coupon-two
  367. background="#FFFFFF"
  368. v-bind:list="temp.data.coupon_list"
  369. v-bind:receive-bg="temp.data.receiveBg"
  370. v-bind:text-color="temp.data.textColor"
  371. v-bind:unclaimed-bg="temp.data.unclaimedBg"
  372. v-bind:coupon_req="coupon_req"
  373. v-bind:coupon-bg="temp.data.couponBg ? temp.data.couponBg : `#D9BC8B`"
  374. v-bind:coupon-bg-type="temp.data.couponBgType"
  375. v-bind:add-type="temp.data.addType"
  376. v-bind:page_id="page_id"
  377. v-bind:template_id="Number.parseInt(item.template_id)"
  378. v-bind:d-index="[nav_active,temp_index]"
  379. v-bind:m-index="dIndex"
  380. v-bind:d-type="dType"
  381. ></app-exclusive-coupon-two>
  382. </template>
  383. <template v-else-if="temp.id === 'timer'">
  384. <app-diy-timer
  385. v-bind:pic-url="temp.data.picUrl"
  386. v-bind:start-date-time="temp.data.startDateTime"
  387. v-bind:end-date-time="temp.data.endDateTime"
  388. v-bind:page-hide="pageHide"
  389. v-bind:bg-pic-url="temp.data.bgPicUrl"
  390. v-bind:link="temp.data.link"
  391. ></app-diy-timer>
  392. </template>
  393. <template v-else-if="temp.id === 'mch'">
  394. <view :style="[
  395. {'background-color':`${temp.data.backgroundColor}`,
  396. 'background-image': temp.data.backgroundPicUrl ? `url(${temp.data.backgroundPicUrl})` : `none`,
  397. 'background-size':`${temp.data.backgroundWidth + '% ' + temp.data.backgroundHeight + '%'}`,
  398. 'background-position':`${transLabelBackgroundPosition(temp.data.position)}`,
  399. 'background-repeat':`${transLabelBackgroundRepeat(temp.data.mode)}`}]"
  400. >
  401. <app-goods-shop
  402. v-bind:card-style="temp.data.cardStyle"
  403. v-bind:background-color="temp.data.backgroundColor"
  404. type="diy"
  405. v-bind:theme="theme"
  406. v-bind:mch_list="temp.data.list"
  407. v-bind:coupon_req="coupon_req"
  408. v-bind:is_required="is_required"
  409. v-bind:show-goods="temp.data.showGoods"
  410. ></app-goods-shop>
  411. </view>
  412. </template>
  413. <template v-else-if="temp.id === 'empty'">
  414. <app-empty
  415. v-bind:height="temp.data.height"
  416. v-bind:background-color="temp.data.background"
  417. ></app-empty>
  418. </template>
  419. <template v-else-if="temp.id === 'ad'">
  420. <app-ad
  421. v-bind:unit-id="temp.data.id"
  422. v-bind:type="temp.data.type"
  423. v-bind:coupon-url="coupon_url"
  424. v-bind:video-url="temp.data.video_url"
  425. v-bind:pic-url="temp.data.pic_url"
  426. v-bind:coupon-params="item | getObje"
  427. ></app-ad>
  428. </template>
  429. <template v-else-if="temp.id === 'modal'">
  430. <app-popup-ad
  431. v-bind:opened="temp.data.opened"
  432. v-bind:times="temp.data.times"
  433. v-bind:list="temp.data.list"
  434. v-bind:multiple="true"
  435. v-bind:is_storage="is_storage"
  436. v-bind:mark="homePages.id + '-' + homePages.navs[nav_active].id + '-' + temp_index"
  437. ></app-popup-ad>
  438. </template>
  439. <template v-else-if="temp.id === 'quick-nav' && temp.data.navSwitch == 1">
  440. <app-quick-navigation
  441. v-bind:value="temp.data"
  442. v-bind:use-mall-config="temp.data.useMallConfig"
  443. ></app-quick-navigation>
  444. </template>
  445. <!-- #ifdef MP-WEIXIN -->
  446. <template v-else-if="temp.id === 'mp-link'">
  447. <view v-bind:class="temp.data.position === 'top' ? `mp-link-top` : ``"
  448. v-bind:style="[{'top': hiddenHeight(temp.data.position)}]">
  449. <official-account
  450. v-on:load="mpLink(temp.data.position)"
  451. v-on:error="mpLinkError"
  452. ></official-account>
  453. </view>
  454. </template>
  455. <!-- #endif -->
  456. <!-- #ifdef H5 -->
  457. <template v-if="temp.id === 'mp-link' && isWechat">
  458. <view class="bd-attention">
  459. <view class="bd-content">
  460. <view class="dir-left-nowrap main-between cross-center">
  461. <view class="dir-left-nowrap cross-center">
  462. <image class="bd-logo" :src="userInfo && userInfo.wechat_logo"></image>
  463. <view class="bd-name">{{userInfo && userInfo.wechat_name}}</view>
  464. </view>
  465. <view class="bd-btn" @click="openAttention">去关注</view>
  466. </view>
  467. </view>
  468. </view>
  469. </template>
  470. <!-- #endif -->
  471. <!-- #ifndef MP-TOUTIAO -->
  472. <template v-else-if="temp.id === 'map'">
  473. <app-map
  474. v-bind:background-pic-url="temp.data.backgroundPicUrl"
  475. v-bind:height="temp.data.height"
  476. v-bind:latitude="temp.data.latitude"
  477. v-bind:longitude="temp.data.longitude"
  478. v-bind:margin-top="temp.data.marginTop"
  479. v-bind:margin-top-color="temp.data.marginTopColor"
  480. v-bind:padding-x="temp.data.paddingX"
  481. v-bind:padding-y="temp.data.paddingY"
  482. ></app-map>
  483. </template>
  484. <!-- #endif -->
  485. <template v-else-if="temp.id === 'check-in'">
  486. <app-check-in
  487. v-bind:background-pic-url="temp.data.backgroundPicUrl"
  488. v-bind:hotspot="temp.data.hotspot"
  489. v-bind:show-text="temp.data.showText"
  490. v-bind:text-color="temp.data.textColor"
  491. v-bind:text-position="temp.data.textPosition"
  492. ></app-check-in>
  493. </template>
  494. <template v-else-if="temp.id === 'image-text'">
  495. <view style="padding: 0 24rpx;">
  496. <app-rich v-bind:content='temp.data.content'></app-rich>
  497. </view>
  498. </template>
  499. <template v-else-if="temp.id === 'form'">
  500. <app-diy-form
  501. v-bind:title="temp.name"
  502. v-bind:list="temp.data.formDialog"
  503. v-bind:item-padding-x="temp.data.inputPadding"
  504. v-bind:item-margin-y="temp.data.marginBottom"
  505. v-bind:item-height="temp.data.height"
  506. v-bind:show-item-border="false"
  507. v-bind:label-position="transLabelPosition(temp.data.style)"
  508. v-bind:label-color="temp.data.inputLabel"
  509. label-text-align="left"
  510. v-bind:show-input-border="true"
  511. v-bind:input-background="temp.data.inputBackground"
  512. v-bind:input-border-color="temp.data.inputBorder"
  513. v-bind:input-text-color="temp.data.inputText"
  514. v-bind:input-placeholder-color="temp.data.inputTip"
  515. v-bind:input-radius="temp.data.radius"
  516. v-bind:show-submit="true"
  517. v-bind:submit-url="diyFormSubmitUrl"
  518. v-bind:submit-btn-text="temp.data.borderContent"
  519. v-bind:submit-btn-height="temp.data.buttonHeight"
  520. v-bind:submit-btn-padding="temp.data.buttonPadding"
  521. v-bind:submit-btn-margin="temp.data.buttonMargin"
  522. v-bind:submit-btn-radius="temp.data.buttonRadius"
  523. v-bind:submit-btn-background="temp.data.borderBackground"
  524. v-bind:submit-btn-border-color="temp.data.borderBorder"
  525. v-bind:submit-btn-text-color="temp.data.borderText"
  526. v-bind:background-color="temp.data.backgroundColor"
  527. v-bind:background-image="temp.data.backgroundPicUrl"
  528. v-bind:background-width="temp.data.backgroundWidth"
  529. v-bind:background-height="temp.data.backgroundHeight"
  530. v-bind:background-position="transLabelBackgroundPosition(temp.data.position)"
  531. v-bind:background-repeat="transLabelBackgroundRepeat(temp.data.mode)"
  532. v-bind:margin-top="temp.data.marginTop"
  533. v-bind:margin-color="temp.data.marginColor"
  534. v-bind:padding-top="temp.data.padding"
  535. v-bind:padding-bottom="temp.data.padding"
  536. v-bind:select-box-color="temp.data.selectBoxColor"
  537. ></app-diy-form>
  538. </template>
  539. <!--超级会员卡组件-->
  540. <template v-else-if="temp.id === 'vip-card'">
  541. <view class="vip-card"
  542. :style="[
  543. {'background-color':`${temp.data.background}`}]">
  544. <app-vip-card
  545. v-bind:value="temp.data" top="0"
  546. v-bind:background="temp.data.background"
  547. ></app-vip-card>
  548. </view>
  549. </template>
  550. <!--直播组件-->
  551. <!-- #ifdef MP-WEIXIN -->
  552. <template v-else-if="temp.id === 'live'">
  553. <app-live v-bind:value="temp.data"></app-live>
  554. </template>
  555. <!-- #endif -->
  556. <template v-else-if="temp.id === 'module' && is_module">
  557. <app-module
  558. v-bind:tab-type="temp.data.tabType"
  559. v-bind:tab-color="temp.data.tabColor"
  560. v-bind:text-color="temp.data.textColor"
  561. v-bind:tab-background="temp.data.tabBackground"
  562. v-bind:list="temp.data.list"
  563. v-bind:d-index="[index, temp_index]"
  564. v-bind:theme="theme"
  565. v-bind:page-hide="pageHide"
  566. v-bind:home-pages="homePages"
  567. v-bind:is_storage="is_storage"
  568. v-bind:page_id="page_id"
  569. v-bind:is_required="is_required"
  570. v-bind:coupon_req="coupon_req"
  571. @buyProduct="buyProduct"
  572. ></app-module>
  573. </template>
  574. <template v-else-if="temp.id === 'access_limit'">
  575. <view style="background:#FFFFFF;width: 100vw;padding-top: 26%"
  576. :style="{height: 'calc(100vh - ' + hiddenHeight('top') + ' - ' + bottomHeight + ')'}"
  577. class="dir-top-nowrap cross-center">
  578. <image :src="diyImg.access_limit" style="height: 240rpx;width:240rpx;display: block"/>
  579. <view style="color:#999999;font-size: 26rpx;margin-top: 20rpx">该页面暂无权限访问</view>
  580. </view>
  581. </template>
  582. </block>
  583. </template>
  584. </block>
  585. </view>
  586. </view>
  587. </template>
  588. <script>
  589. import {mapGetters, mapState} from 'vuex';
  590. import appSearchFor from '../../page-component/app-search-for/app-search-for.vue';
  591. import appSwiper from '../../page-component/app-swiper/app-swiper.vue';
  592. import uSwiper from '../../page-component/app-swiper/swiper.vue';
  593. import uAnnouncement from '../../page-component/u-announcement/u-announcement.vue';
  594. import appNavigationIcon from '../../page-component/app-navigation-icon/app-navigation-icon.vue';
  595. import appNavigationTwoIcon from '../../page-component/app-navigation-icon/app-navigation-two-icon.vue';
  596. import appVideo from '../../page-component/app-video/app-video.vue';
  597. import appAssociatedLink from '../../page-component/app-associated-link/app-associated-link.vue';
  598. import appSpecialTopic from '../../page-component/app-special-topic/app-special-topic-normal.vue';
  599. import appSpecialTopicList from '../../page-component/app-special-topic/app-special-topic-list.vue';
  600. import appImageAd from '../../page-component/app-image-ad/app-image-ad.vue';
  601. import appHotspot from '../../basic-component/app-hotspot/app-hotspot.vue';
  602. import appShop from '../../page-component/app-shop/app-shop.vue';
  603. import appCopyright from '../../page-component/app-copyright/app-copyright.vue';
  604. import appUserCenter from '../../page-component/app-user-center-top/app-user-center-top.vue';
  605. import appMyOrder from '../../page-component/app-my-order/app-my-order.vue';
  606. import appRecommendedProductList from '../../page-component/app-recommended-product/app-recommended-product-list.vue';
  607. import appExclusiveCoupon from '../../page-component/app-exclusive-coupon/app-exclusive-coupon.vue';
  608. import appExclusiveCouponTwo from '../../page-component/app-exclusive-coupon/app-exclusive-coupon-two.vue';
  609. import appDiyTimer from '../../page-component/app-diy-timer/app-diy-timer.vue';
  610. import appGoodsShop from '../../page-component/app-good-shop-recommendation/app-good-shop-recommendation.vue';
  611. import appEmpty from '../../basic-component/app-empty/app-empty.vue';
  612. import appPopupAd from '../../page-component/app-popup-ad/app-popup-ad.vue';
  613. import appQuickNavigation from '../../page-component/app-quick-navigation/app-quick-navigation.vue';
  614. import appCheckIn from '../../page-component/app-check-in/app-check-in.vue';
  615. import appRich from '../../basic-component/app-rich/parse.vue';
  616. import appReservation from "../../page-component/app-reservation/app-reservation.vue";
  617. import appDiyGoodsList from "../../page-component/app-diy-goods-list/app-diy-goods-list.vue";
  618. import appDiyForm from "../../page-component/app-diy-form/app-diy-form.vue";
  619. import appVipCard from "../../page-component/app-vip-card/app-vip-card.vue";
  620. import appAd from "../../page-component/app-ad/app-ad.vue";
  621. import appModule from "../../page-component/index/app-module.vue";
  622. import uOrdinaryList from '../u-goods-list/u-ordinary-list.vue';
  623. import appDiyMGoodsList from '../../page-component/app-diy-goods-list/app-diy-m-goods-list.vue';
  624. // #ifdef MP-WEIXIN
  625. import appLive from "../../page-component/app-live/app-live.vue";
  626. // #endif
  627. // #ifndef MP-TOUTIAO
  628. import appMap from "../../page-component/app-map/app-map.vue";
  629. // #endif
  630. export default {
  631. name: "app-diy-page",
  632. components: {
  633. 'app-search-for': appSearchFor,
  634. 'app-swiper': appSwiper,
  635. uAnnouncement,
  636. 'app-navigation-icon': appNavigationIcon,
  637. 'app-navigation-two-icon': appNavigationTwoIcon,
  638. 'app-video': appVideo,
  639. 'app-associated-link': appAssociatedLink,
  640. 'app-special-topic': appSpecialTopic,
  641. 'app-special-topic-list': appSpecialTopicList,
  642. 'app-image-ad': appImageAd,
  643. 'app-hotspot': appHotspot,
  644. 'app-shop': appShop,
  645. 'app-copyright': appCopyright,
  646. 'app-user-center': appUserCenter,
  647. 'app-my-order': appMyOrder,
  648. 'app-recommended-product-list': appRecommendedProductList,
  649. 'app-exclusive-coupon': appExclusiveCoupon,
  650. appExclusiveCouponTwo,
  651. 'app-diy-timer': appDiyTimer,
  652. 'app-goods-shop': appGoodsShop,
  653. 'app-empty': appEmpty,
  654. 'app-popup-ad': appPopupAd,
  655. 'app-quick-navigation': appQuickNavigation,
  656. 'app-check-in': appCheckIn,
  657. 'app-rich': appRich,
  658. 'app-reservation': appReservation,
  659. 'app-diy-goods-list': appDiyGoodsList,
  660. 'app-diy-form': appDiyForm,
  661. 'app-vip-card': appVipCard,
  662. appDiyMGoodsList,
  663. // 普通商品列表
  664. uOrdinaryList,
  665. // #ifndef MP-TOUTIAO
  666. appMap,
  667. // #endif
  668. appAd,
  669. appModule,
  670. // #ifdef MP-WEIXIN
  671. appLive,
  672. // #endif
  673. uSwiper
  674. },
  675. props: {
  676. dIndex: {
  677. type: Array,
  678. default() {
  679. return [0, 0];
  680. }
  681. },
  682. dType: String, //module 模块
  683. homePages: {
  684. type: Object,
  685. default() {
  686. return {
  687. navs: []
  688. };
  689. }
  690. },
  691. scrollTop: {
  692. type: Number,
  693. default() {
  694. return 0;
  695. }
  696. },
  697. is_storage: Boolean,
  698. pageHide: Boolean,
  699. theme: Object,
  700. coupon_req: Boolean,
  701. is_required: Boolean,
  702. page_id: Number,
  703. is_module: {
  704. type: Boolean,
  705. default() {
  706. return true;
  707. }
  708. }
  709. },
  710. computed: {
  711. hiddenHeight() {
  712. return (type) => {
  713. // #ifdef MP-WEIXIN || MP-BAIDU || MP-TOUTIAO
  714. if(type === 'top'){
  715. let barHeight = this.systemInfo.statusBarHeight + this.mBarHeight;
  716. return barHeight + 'px';
  717. }
  718. // #endif
  719. return 0 + 'px';
  720. }
  721. },
  722. newData() {
  723. if (this.homePages) {
  724. if (this.homePages.title) {
  725. uni.setNavigationBarTitle({
  726. title: this.homePages.title,
  727. });
  728. }
  729. return this.homePages;
  730. } else {
  731. return {
  732. navs: [],
  733. }
  734. }
  735. },
  736. ...mapState({
  737. tabBarNavs: state => state.mallConfig.navbar.navs,
  738. systemInfo: state => state.gConfig.systemInfo,
  739. userCenter: state => state.mallConfig.user_center,
  740. mBarHeight: state => state.gConfig.mBarHeight,
  741. diyImg: state => state.mallConfig.__wxapp_img.diy,
  742. }),
  743. ...mapGetters({
  744. userInfo: 'user/info',
  745. }),
  746. ...mapGetters('iPhoneX', {
  747. BotHeight: 'getBotHeight',
  748. getEmpty: 'getEmpty',
  749. }),
  750. bottomHeight() {
  751. let s = this.tabBarNavs.find(item => {
  752. return item.url.indexOf('/pages/index/index') !== -1 && item.url.indexOf(`page_id=${this.page_id}`) !== -1
  753. })
  754. if (s) {
  755. return uni.upx2px(this.BotHeight) + 'px';
  756. } else {
  757. return 0 + 'px';
  758. }
  759. },
  760. diyFormSubmitUrl() {
  761. return this.$api.diy.page_store;
  762. },
  763. // #ifdef H5
  764. isWechat: function() {
  765. return this.$jwx.isWechat();
  766. },
  767. // #endif
  768. },
  769. data() {
  770. return {
  771. nav_active: 0,
  772. mp_link_top: false,
  773. coupon_url: this.$api.diy.receive,
  774. coupon_params: {}
  775. };
  776. },
  777. filters: {
  778. getObje(data) {
  779. if (!data) return;
  780. return {
  781. template_id: data.template_id
  782. }
  783. }
  784. },
  785. methods: {
  786. changeNav(index) {
  787. this.nav_active = index;
  788. this.mp_link_top = false;
  789. },
  790. rubikHotspot(hotspot) {
  791. if (hotspot && hotspot.link) {
  792. hotspot.link.url = hotspot.link.value;
  793. hotspot.link.openType = hotspot.link.open_type;
  794. }
  795. return hotspot;
  796. },
  797. mpLink(position) {
  798. if (position === 'top') {
  799. this.mp_link_top = true;
  800. }
  801. },
  802. transLabelPosition(val) {
  803. val = Number(val);
  804. switch (val) {
  805. case 3:
  806. return 'top';
  807. case 2:
  808. return 'inset';
  809. default:
  810. return 'left';
  811. }
  812. },
  813. transLabelBackgroundPosition(val) {
  814. val = Number(val);
  815. switch (val) {
  816. case 1:
  817. return 'left top';
  818. case 2:
  819. return 'center top';
  820. case 3:
  821. return 'right top';
  822. case 4:
  823. return 'left center';
  824. case 5:
  825. return 'center center';
  826. case 6:
  827. return 'right center';
  828. case 7:
  829. return 'left bottom';
  830. case 8:
  831. return 'center bottom';
  832. case 9:
  833. return 'right bottom';
  834. default:
  835. return 'center';
  836. }
  837. },
  838. transLabelBackgroundRepeat(val) {
  839. val = Number(val);
  840. switch (val) {
  841. case 1:
  842. return 'no-repeat';
  843. case 2:
  844. return 'repeat-x';
  845. case 3:
  846. return 'repeat-y';
  847. case 4:
  848. return 'repeat';
  849. default:
  850. return 'no-repeat';
  851. }
  852. },
  853. mpLinkError() {
  854. this.mp_link_top = false;
  855. },
  856. buyProduct(data) {
  857. this.$emit('buyProduct', data);
  858. },
  859. // #ifdef H5
  860. openAttention() {
  861. this.$store.dispatch('user/showAttention', true);
  862. this.$store.dispatch('user/showAttentionTwo', true);
  863. },
  864. // #endif
  865. }
  866. }
  867. </script>
  868. <style scoped lang="scss">
  869. .app-diy-bg {
  870. position: fixed;
  871. top: 0;
  872. left: 0;
  873. width: 100%;
  874. height: 100%;
  875. z-index: -1;
  876. }
  877. .vip-card {
  878. padding: 0 #{24rpx};
  879. }
  880. //#ifdef MP-ALIPAY
  881. .app-diy-page /deep/ .app-diy-page {
  882. position: static !important;
  883. z-index: auto !important;
  884. }
  885. //#endif
  886. .app-diy-page {
  887. width: 100%;
  888. height: 100%;
  889. .nav-bar {
  890. position: fixed;
  891. left: 0;
  892. top: 0;
  893. z-index: 1500;
  894. background-color: #ffffff;
  895. width: 100%;
  896. height: #{44px};
  897. padding: 0 #{30rpx};
  898. overflow-x: auto;
  899. border-bottom: #{1rpx} solid #e2e2e2;
  900. .nav-bar-one {
  901. width: auto;
  902. margin-right: #{30rpx};
  903. padding: 0 #{15rpx};
  904. &.active {
  905. border-bottom: #{4rpx} solid;
  906. }
  907. }
  908. &.mp_link_top {
  909. top: #{84px};
  910. }
  911. &.mp_link_top ~ .diy-template {
  912. margin-top: #{44px + 84px};
  913. }
  914. & ~ .diy-template {
  915. margin-top: #{44px};
  916. }
  917. }
  918. .mp-link-top {
  919. position: fixed;
  920. top: 0;
  921. left: 0;
  922. z-index: 1500;
  923. width: 100%;
  924. }
  925. &.mp_link_top {
  926. margin-top: #{168rpx};
  927. }
  928. }
  929. /* #ifdef H5 */
  930. .bd-attention {
  931. width: 100%;
  932. background-color: #ffffff;
  933. padding: 5upx 10upx 24upx 10upx;
  934. .bd-content {
  935. padding: 0 10upx 0 6upx;
  936. margin-top: 15upx;
  937. }
  938. .bd-logo {
  939. width:70upx;
  940. height: 70upx;
  941. margin-right: 15upx;
  942. }
  943. .bd-name {
  944. font-size: 28upx;
  945. color: #353535;
  946. }
  947. .bd-btn {
  948. width:110upx;
  949. height: 50upx;
  950. line-height: 50upx;
  951. font-size: 22upx;
  952. border: 1upx solid #009400;
  953. color: #009400;
  954. border-radius: 5upx;
  955. text-align: center;
  956. transform: rotateZ(360deg);
  957. }
  958. }
  959. /* #endif */
  960. </style>