cangp.vue 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425
  1. <template>
  2. <view class="container">
  3. <view class="top">
  4. <!-- <image class="top-bg" src="../../static/img/top-bg.png" mode=""></image> -->
  5. <view class="top-main flex">
  6. <view class="search-box flex" @click="clickSearch()">
  7. <image class="search" src="../../static/icon/search-h.png" mode=""></image>
  8. <view class="search-font">输入关键词搜索</view>
  9. </view>
  10. </view>
  11. <!-- <swiper class="carousel" autoplay="true" duration="400" interval="5000" @change="swiperChange">
  12. <swiper-item v-for="(item, index) in carouselList" :key="index" class="carousel-item" @click="bannerNavToUrl(item)">
  13. <image :src="item.pic" />
  14. </swiper-item>
  15. </swiper> -->
  16. </view>
  17. <view class="box">
  18. <view class="box-title">
  19. <view class="left">
  20. 艺绘
  21. </view>
  22. <view class="right" @click="navTo('/pages/index/cangp')">
  23. 查看更多 >
  24. </view>
  25. </view>
  26. <view class="box-content" v-for="(item,index) in list" @click="buy(item)">
  27. <view class="img" >
  28. <image :src="item.image" mode=""></image>
  29. </view>
  30. <view class="content-title">
  31. <view class="title">
  32. {{item.store_name}}
  33. </view>
  34. <view class="text">
  35. 黑道研究会 发行
  36. </view>
  37. <view class="text">
  38. 发行数量: {{item.stock}}份
  39. </view>
  40. </view>
  41. </view>
  42. <!-- <view class="box-content">
  43. <view class="img">
  44. <image src="../../static/index/nvwang.png" mode=""></image>
  45. </view>
  46. <view class="content-title">
  47. <view class="">
  48. 黑道女王
  49. </view>
  50. <view class="text">
  51. 黑道研究会 发行
  52. </view>
  53. <view class="text">
  54. 发行数量: 14521
  55. </view>
  56. </view>
  57. </view> -->
  58. </view>
  59. <view class="btm" style="height: 44px;"></view>
  60. <!-- 客服 -->
  61. <!-- <uni-popup ref="popupkf" type="center">
  62. <view class="popup-box">
  63. <view class="img"><image src="../../static/img/img009.png" mode=""></image></view>
  64. <view class="mian">
  65. <view class="delivery">
  66. <view class="title">已经为您定制专属客服</view>
  67. <image src="../../static/img/img010.png" mode=""></image>
  68. </view>
  69. <view class="nocancel">客服VX:{{ text }}</view>
  70. <view class="comfirm-box">
  71. <view class="cancel" @click="kfClose()">取消</view>
  72. <view class="comfirm" @click="comfirm(text)">复制微信</view>
  73. </view>
  74. </view>
  75. </view>
  76. </uni-popup> -->
  77. </view>
  78. </template>
  79. <script>
  80. import {
  81. getBargainList,
  82. getProducts
  83. } from '@/api/product.js';
  84. // import {mapState} from 'vuex'
  85. import {loadIndexs} from '@/api/index.js'
  86. import { mapState, mapMutations } from 'vuex';
  87. // #ifdef H5
  88. import { weixindata, shareLoad } from '@/utils/wxAuthorized';
  89. // #endif
  90. export default {
  91. data() {
  92. return {
  93. isSc:2,
  94. text: '',
  95. checkid: 0,
  96. titleNViewBackground: '',
  97. longitude: 0, //经度
  98. latitude: 0, //纬度
  99. swiperCurrent: 0,
  100. swiperLength: 0,
  101. carouselList: [], //轮播列表
  102. bastList: [], //会员礼包
  103. integralList: [], //兑换专区
  104. list:[],//卡片信息
  105. page: 1,
  106. limit: 10,
  107. loadType: 'more',
  108. text: [],
  109. article: []
  110. };
  111. },
  112. computed: {
  113. ...mapState(['loginInterceptor', 'baseURL']),
  114. ...mapState('user', ['hasLogin', 'userInfo'])
  115. },
  116. onLoad: function(option) {
  117. if(this.hasLogin){
  118. this.loadIndex()
  119. this.getProduct()
  120. }
  121. },
  122. onShow: function() {
  123. },
  124. // onReachBottom() {
  125. // this.getproducts();
  126. // },
  127. methods: {
  128. ...mapMutations(['setLat', 'setLon']),
  129. loadIndex(){
  130. let obj = this
  131. loadIndexs().then(res=>{
  132. // console.log(res,'res');
  133. obj.carouselList = res.data.banner
  134. // console.log(res,'res');
  135. // obj.list = res.data.info.fastList
  136. })
  137. },
  138. getProduct(){
  139. let obj = this
  140. getProducts().then(res=>{
  141. // obj.carouselList = res.data.banner
  142. // console.log(res,'res');
  143. obj.list = res.data
  144. })
  145. },
  146. buy(item){
  147. console.log(item,'res');
  148. uni.navigateTo({
  149. url:'/pages/product/product?id='+item.id+'&isSc='+this.isSc
  150. })
  151. }
  152. ,
  153. navTo(url){
  154. uni.switchTab({
  155. url
  156. })
  157. },
  158. // 點擊搜索框
  159. clickSearch() {
  160. uni.navigateTo({
  161. // url: '/pages/product/search'
  162. });
  163. },
  164. swiperChange(){
  165. uni.navigateTo({
  166. url: '/pages/product/search'
  167. });
  168. }
  169. }
  170. };
  171. </script>
  172. <style lang="scss">
  173. page{
  174. width: 750rpx;
  175. height: 100%;
  176. background: #111111;
  177. }
  178. .top {
  179. position: relative;
  180. width: 100%;
  181. // height: 360rpx;
  182. .top-bg {
  183. position: absolute;
  184. top: 0;
  185. left: 0;
  186. right: 0;
  187. width: 100%;
  188. height: 100%;
  189. }
  190. .top-main {
  191. position: relative;
  192. z-index: 2;
  193. padding: 30rpx;
  194. .search-box {
  195. justify-content: center;
  196. width: 698rpx;
  197. height: 60rpx;
  198. background: #191919;
  199. // box-shadow: 0px 10rpx 20rpx 0px rgba(4, 114, 69, 0.22);
  200. border-radius: 30rpx;
  201. .search {
  202. width: 34rpx;
  203. height: 34rpx;
  204. }
  205. .search-font {
  206. margin-left: 14rpx;
  207. font-size: 28rpx;
  208. font-family: PingFang SC;
  209. font-weight: 500;
  210. color: #a4a4a4;
  211. }
  212. }
  213. }
  214. }
  215. .box{
  216. margin: 0 30rpx;
  217. .box-title{
  218. display: flex;
  219. justify-content: space-between;
  220. .left{
  221. font-size: 38rpx;
  222. font-family: PingFang SC;
  223. font-weight: bold;
  224. color: #FFFFFF;
  225. line-height: 120rpx;
  226. }
  227. .right{
  228. font-size: 24rpx;
  229. font-family: PingFang SC;
  230. font-weight: 500;
  231. color: #FFFFFF;
  232. line-height: 120rpx;
  233. }
  234. }
  235. .box-content{
  236. width: 690rpx;
  237. height: 915rpx;
  238. margin: 50rpx 0;
  239. .img{
  240. width: 690rpx;
  241. height: 690rpx;
  242. image{
  243. width: 100%;
  244. height: 100%;
  245. }
  246. }
  247. .content-title{
  248. margin-top: -10rpx;
  249. padding: 30rpx 20rpx ;
  250. border-bottom-left-radius: 10rpx;
  251. border-bottom-right-radius: 10rpx;
  252. border: 2rpx solid #533A6A;
  253. // box-shadow: 0px 0px 20rpx 0px rgba(79,59,103,0.0600);
  254. .title{
  255. font-size: 39rpx;
  256. font-weight: bold;
  257. color: #FFFFFF;
  258. margin-bottom: 20rpx;
  259. }
  260. .text{
  261. margin: 10rpx 0;
  262. color: #FFFFFF;
  263. font-size: 28rpx;
  264. }
  265. }
  266. }
  267. }
  268. .popup-box {
  269. width: 522rpx;
  270. height: 605rpx;
  271. background-color: #ffffff;
  272. border-radius: 20rpx;
  273. position: relative;
  274. .img {
  275. position: relative;
  276. top: -56rpx;
  277. left: 0;
  278. width: 522rpx;
  279. height: 132rpx;
  280. display: flex;
  281. justify-content: center;
  282. image {
  283. border-radius: 20rpx 20rpx 0 0;
  284. width: 450rpx;
  285. height: 132rpx;
  286. }
  287. }
  288. .mian {
  289. margin-top: -44rpx;
  290. display: flex;
  291. flex-direction: column;
  292. align-items: center;
  293. // padding: 32rpx 32rpx;
  294. background-color: #ffffff;
  295. border-radius: 0 0 20rpx 20rpx;
  296. text-align: center;
  297. .delivery {
  298. font-size: 40rpx;
  299. color: #333333;
  300. display: flex;
  301. align-items: center;
  302. flex-direction: column;
  303. .title {
  304. }
  305. image {
  306. margin-top: 48rpx;
  307. width: 172rpx;
  308. height: 160rpx;
  309. }
  310. }
  311. .nocancel {
  312. font-size: 32rpx;
  313. color: #333333;
  314. margin-top: 14rpx;
  315. }
  316. .comfirm-box {
  317. margin-top: 52rpx;
  318. display: flex;
  319. // margin-bottom: 32rpx;
  320. // justify-content: space-around;
  321. .cancel {
  322. display: flex;
  323. align-items: center;
  324. justify-content: center;
  325. width: 197rpx;
  326. height: 74rpx;
  327. border: 1px solid #dcc786;
  328. border-radius: 38rpx;
  329. font-size: 32rpx;
  330. color: #605128;
  331. }
  332. .comfirm {
  333. margin-left: 32rpx;
  334. display: flex;
  335. align-items: center;
  336. justify-content: center;
  337. width: 197rpx;
  338. height: 74rpx;
  339. background: linear-gradient(-90deg, #d1ba77 0%, #f7e8ad 100%);
  340. border-radius: 38px;
  341. font-size: 32rpx;
  342. color: #605128;
  343. }
  344. }
  345. }
  346. }
  347. .tongz {
  348. width: 690rpx;
  349. height: 70rpx;
  350. margin: 32rpx auto 0;
  351. padding: 18rpx 30rpx 18rpx 24rpx;
  352. align-items: center;
  353. position: relative;
  354. .tongz-bg {
  355. position: absolute;
  356. top: 0;
  357. right: 0;
  358. left: 0;
  359. width: 690rpx;
  360. height: 70rpx;
  361. image {
  362. width: 100%;
  363. height: 100%;
  364. }
  365. }
  366. .tongz-left {
  367. width: 640rpx;
  368. .image-left {
  369. width: 28rpx;
  370. height: 34rpx;
  371. }
  372. .tongz-font {
  373. margin-left: 22rpx;
  374. font-size: 28rpx;
  375. font-family: Source Han Sans CN;
  376. font-weight: 400;
  377. color: #0f253a;
  378. }
  379. }
  380. .tongz-right {
  381. position: relative;
  382. z-index: 11;
  383. width: 12rpx;
  384. height: 26rpx;
  385. image {
  386. width: 100%;
  387. height: 100%;
  388. }
  389. }
  390. }
  391. </style>