PageDesign.vue 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292
  1. <template>
  2. <view class="pageDesin-box" v-if="temData.length">
  3. <!-- <view class="address-view" @click="openLocation" :style="{ backgroundColor: temData[0].modelData.topBgColor, color:temData[0].modelData.textColor }">
  4. <text class="ibonfont ibondingweiweizhi"></text>
  5. <text class="address-text">{{ location.address || '请手动定位' }}</text>
  6. <text class="ibonfont ibonjinru"></text>
  7. </view> -->
  8. <!-- <view style="position: relative;z-index: 2;"> -->
  9. <block v-for="(item, index) in temData" :key="index">
  10. <ImgSwiper v-if="item.comName === 'ImgSwiper'" :modelData="item.modelData" />
  11. <SearchC v-if="item.comName === 'SearchC'" :modelData="item.modelData" />
  12. <MagicImg v-if="item.comName === 'MagicImg'" :modelData="item.modelData" />
  13. <Notice v-if="item.comName === 'Notice'" :modelData="item.modelData" :noticeData="item.data" />
  14. <NavBar v-if="item.comName === 'NavBar'" :modelData="item.modelData" />
  15. <view class="flex" v-if="temData[index].comName === 'NavBar' && temData[index+1].comName !== 'NavBar'">
  16. <image src="http://up.liuniukj.com/16921750418414/3bef1eab4692142cfe373956646e6f70/yyzq.png" mode=""
  17. class="banner-ad"
  18. @click="navTo('/pagesT/unit/item')"></image>
  19. <image src="http://up.liuniukj.com/169217504184137/3bef1eab4692142cfe373956646e6f70/lqzx.png" mode=""
  20. class="banner-ad"
  21. @click="navTo('/pagesT/user/GetCoupon')"></image>
  22. </view>
  23. <AdvGroup v-if="item.comName === 'AdvGroup'" :modelData="item.modelData" />
  24. <GoodsGroup v-if="item.comName === 'GoodsGroup'" :modelData="item.modelData" :goodsList="item.data"
  25. :showGoodsPrice="showGoodsPrice" :selAddress="selAddressD" />
  26. <LimitedSeckill v-if="item.comName === 'LimitedSeckill'" :modelData="item.modelData" :goodsList="item.data"
  27. :showGoodsPrice="showGoodsPrice" :selAddress="selAddressD" />
  28. <CouponGroup v-if="item.comName === 'CouponGroup'" :modelData="item.modelData" :couponList="item.data" />
  29. <LineF v-if="item.comName === 'LineF'" :modelData="item.modelData" />
  30. <Blank v-if="item.comName === 'Blank'" :modelData="item.modelData" />
  31. <div v-if="item.comName === 'FloatBth'" class="float-bth" @click="btnEvent(item)" :style="{
  32. backgroundColor: item.modelData.btnStyle === 2 ? item.modelData.bgColor : 'transparent',
  33. borderColor: item.modelData.btnStyle === 2 ? item.modelData.bgColor : '#999999'
  34. }">
  35. <image :src="item.modelData.image" class="float-img" />
  36. </div>
  37. <!-- #ifdef MP-WEIXIN -->
  38. <button v-if="item.comName === 'wxService'" class="float-bth wxService" :style="{
  39. color: item.modelData.color
  40. }" open-type="contact">
  41. <text class="ibonfont ibonkefu"></text>
  42. </button>
  43. <!-- #endif -->
  44. </block>
  45. <!-- <view class="logo-view" v-if="$common.getEnToken() !== '8fa553d53f44e33123e4d0d51a0de634'">
  46. <image src="https://onlineimg.qianniao.vip/QNlogo-i-1.png" mode="aspectFit"></image>
  47. <view class="logo-tip">- 千鸟云商提供技术支持 -</view>
  48. </view> -->
  49. <!-- </view> -->
  50. </view>
  51. </template>
  52. <script>
  53. import SearchC from './components/Search.vue';
  54. import ImgSwiper from './components/Banner.vue';
  55. import MagicImg from './components/MagicImg.vue';
  56. import Notice from './components/Notice.vue';
  57. import NavBar from './components/NavBar.vue';
  58. import GoodsGroup from './components/GoodsGroup.vue';
  59. import LimitedSeckill from './components/LimitedSeckill.vue';
  60. import CouponGroup from './components/CouponGroup.vue';
  61. import LineF from './components/Line.vue';
  62. import Blank from './components/Blank.vue';
  63. import AdvGroup from './components/AdvGroup.vue';
  64. // import NavigationBar from './components/NavigationBar.vue';
  65. export default {
  66. name: 'PageDesign',
  67. components: {
  68. SearchC,
  69. ImgSwiper,
  70. MagicImg,
  71. Notice,
  72. NavBar,
  73. GoodsGroup,
  74. LimitedSeckill,
  75. CouponGroup,
  76. LineF,
  77. Blank,
  78. AdvGroup
  79. // NavigationBar
  80. },
  81. props: {
  82. showGoodsPrice: {
  83. type: [Number, String],
  84. default: ''
  85. },
  86. temData: {
  87. type: Array,
  88. default: () => {
  89. return [];
  90. }
  91. },
  92. pageBack: {
  93. type: Boolean,
  94. default: false
  95. },
  96. isBackIndex: {
  97. type: Boolean,
  98. default: false
  99. },
  100. amapPlugin: {
  101. type: [Object, Function],
  102. default: () => {
  103. return {};
  104. }
  105. },
  106. selAddress: {
  107. type: Object,
  108. default: () => {
  109. return {};
  110. }
  111. }
  112. },
  113. computed: {
  114. style() {
  115. const systemInfo = uni.getSystemInfoSync();
  116. return `padding-top:${systemInfo.statusBarHeight + 50}px`;
  117. },
  118. location() {
  119. return this.$store.state.locationObj;
  120. }
  121. },
  122. data() {
  123. return {
  124. selAddressD: {}
  125. };
  126. },
  127. watch: {
  128. selAddress(val) {
  129. this.selAddressD = val;
  130. }
  131. },
  132. created() {
  133. // console.log(this.$common.getEnToken())
  134. // this.getHome();
  135. },
  136. methods: {
  137. navTo(url) {
  138. // console.log(this.hasLogin)
  139. // return
  140. if (!this.$store.state.hasLogin) {
  141. // #ifdef APP-PLUS
  142. uni.reLaunch({
  143. url: '/pagesT/public/wxLogin'
  144. });
  145. // #endif
  146. // #ifdef MP-WEIXIN
  147. uni.reLaunch({
  148. url: '/pagesT/binding/bindInfo'
  149. });
  150. //#endif
  151. // #ifdef H5
  152. uni.navigateTo({
  153. url: '/pagesT/public/wxLogin?loginType=2'
  154. });
  155. // #endif
  156. } else {
  157. uni.navigateTo({
  158. url
  159. });
  160. }
  161. },
  162. backEvent() {
  163. if (this.isBackIndex) {
  164. this.goPage('/pages/index/index', 'switchTab');
  165. } else {
  166. uni.navigateBack();
  167. }
  168. },
  169. openLocation() {
  170. this.$emit('openLocation');
  171. },
  172. getHome() {
  173. this.$u.api.getHome().then(res => {
  174. uni.stopPullDownRefresh();
  175. this.temData = res.data;
  176. });
  177. },
  178. btnEvent(item) {
  179. if (item.modelData.btnType === 2) {
  180. uni.makePhoneCall({
  181. phoneNumber: item.modelData.phone
  182. });
  183. } else if (item.modelData.btnType === 1) {
  184. this.goPage(item.modelData.url, item.modelData.switchTab);
  185. } else {
  186. uni.pageScrollTo({
  187. scrollTop: 0,
  188. duration: 300
  189. });
  190. }
  191. }
  192. }
  193. };
  194. </script>
  195. <style lang="scss">
  196. .pageDesin-box {
  197. // background-color: #f5f9fc;
  198. // padding-top: calc(44px + var(--status-bar-height));
  199. }
  200. .float-bth {
  201. position: fixed;
  202. bottom: 150upx;
  203. right: 20upx;
  204. width: 80upx;
  205. height: 80upx;
  206. text-align: center;
  207. cursor: pointer;
  208. border-radius: 100%;
  209. border: 1upx solid #999;
  210. box-shadow: 0 6upx 20upx #dcdcdc;
  211. z-index: 99;
  212. .float-img {
  213. width: 40upx;
  214. height: 40upx;
  215. display: inline-block;
  216. margin-top: 20upx;
  217. }
  218. }
  219. .wxService {
  220. padding: 0;
  221. background-color: #ffffff;
  222. border: 0 none;
  223. bottom: 250upx;
  224. line-height: 80upx;
  225. .ibonkefu {
  226. font-size: 46upx;
  227. }
  228. &::after {
  229. border: 0 none;
  230. }
  231. }
  232. .logo-view {
  233. text-align: center;
  234. padding: 10upx 0;
  235. image {
  236. width: 120upx;
  237. height: 20upx;
  238. opacity: 0.7;
  239. }
  240. .logo-tip {
  241. // padding-top: 4upx;
  242. font-size: 18upx;
  243. color: #999;
  244. }
  245. }
  246. .address-view {
  247. padding: 20upx;
  248. font-size: 26upx;
  249. // background-color: #ffffff;
  250. .address-text {
  251. display: inline-block;
  252. vertical-align: middle;
  253. font-weight: bold;
  254. }
  255. .ibonfont {
  256. margin-right: 10upx;
  257. // color: #999;
  258. vertical-align: middle;
  259. }
  260. .ibonjinru {
  261. // color: #333;
  262. font-weight: 300;
  263. font-size: 28upx;
  264. }
  265. }
  266. .banner-ad {
  267. width: 340rpx;
  268. height: 190rpx;
  269. display: block;
  270. margin: 20rpx auto;
  271. }
  272. .flex {
  273. display: flex;
  274. justify-content: space-between;
  275. }
  276. </style>