index.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510
  1. <template>
  2. <view class="supply-hall">
  3. <z-paging ref="paging" v-model="dataList" @query="queryList">
  4. <!-- <template slot="top">
  5. <u-navbar :autoBack="true" bgColor="transparent">
  6. <view
  7. slot="center"
  8. class="supply-hall-search"
  9. style="width: 530rpx; display: flex; justify-content: flex-start"
  10. >
  11. <view class="" style="width: 400rpx">
  12. <u-input
  13. class="header-search"
  14. placeholder="分类,地区,群名称"
  15. prefixIcon="search"
  16. prefixIconStyle="font-size: 22px;color: #909399"
  17. >
  18. <template slot="suffix">
  19. <u-button text="搜索" type="primary"></u-button>
  20. </template>
  21. </u-input>
  22. </view>
  23. </view>
  24. </u-navbar>
  25. <view class="supply-hall-header">
  26. <view :style="{ height: statusBarHeight + 'px' }"></view>
  27. </view>
  28. <view class="supply-hall-screen">
  29. <view class="supply-hall-screen-item" @click="screenClick(1)">
  30. <view class="">
  31. <u--text
  32. :text="screenData.className"
  33. size="28rpx"
  34. :color="screenIndex == 1 ? '#00D36D' : '#666666'"
  35. ></u--text>
  36. </view>
  37. <view class="ml6">
  38. <u-icon
  39. :name="screenIndex == 1 ? 'arrow-up-fill' : 'arrow-down-fill'"
  40. :color="screenIndex == 1 ? '#00D36D' : '#b7b7b7'"
  41. size="20rpx"
  42. ></u-icon>
  43. </view>
  44. </view>
  45. <view class="supply-hall-screen-item" @click="screenClick(2)">
  46. <view class="">
  47. <u--text
  48. :text="screenData.addressName"
  49. size="28rpx"
  50. :color="screenIndex == 2 ? '#00D36D' : '#666666'"
  51. ></u--text>
  52. </view>
  53. <view class="ml6">
  54. <u-icon
  55. :name="screenIndex == 2 ? 'arrow-up-fill' : 'arrow-down-fill'"
  56. :color="screenIndex == 2 ? '#00D36D' : '#b7b7b7'"
  57. size="20rpx"
  58. ></u-icon>
  59. </view>
  60. </view>
  61. <view
  62. class=""
  63. v-show="screenStatus"
  64. style="
  65. background-color: #ffffff;
  66. position: absolute;
  67. top: 70rpx;
  68. z-index: 997;
  69. width: 100%;
  70. "
  71. >
  72. <view class="" v-show="screenIndex == 1">
  73. <classification @select="selectClass"></classification>
  74. </view>
  75. <view class="" v-show="screenIndex == 2">
  76. <gjsSelectCity @select="selectAddress"></gjsSelectCity>
  77. </view>
  78. </view>
  79. </view>
  80. </template> -->
  81. <view class="main">
  82. <view
  83. class="item"
  84. v-for="(item, index) in dataList"
  85. :key="index"
  86. @click="grouoDetail(item)"
  87. >
  88. <view class="left">
  89. <img :src="item.faceUrl" alt="" class="img" />
  90. </view>
  91. <view class="right">
  92. <view class="right_contont">
  93. <view style="width: 80%">
  94. <view class="title">{{ item.name }}</view>
  95. <view class="value">
  96. <view class="gys"> 供应商:{{ item.supplierCount }}人 </view>
  97. <view class="cgs"> 采购商:{{ item.purchaserCount }} 人 </view>
  98. </view>
  99. </view>
  100. <view @click.stop="join(item)">
  101. <u-button
  102. type="primary"
  103. text="加入"
  104. color="linear-gradient( 275deg, #01CF6C 0%, #07E278 100%)"
  105. shape="circle"
  106. ></u-button>
  107. </view>
  108. </view>
  109. <view class="remake"> {{ item.introduction }} </view>
  110. </view>
  111. </view>
  112. </view>
  113. </z-paging>
  114. <u-popup :show="show" @close="show = false" @open="open">
  115. <view style="padding: 15px">
  116. <view style="text-align: right; position: absolute; right: 20rpx">
  117. <image
  118. src="https://directpurchase-oss-dev.oss-cn-chengdu.aliyuncs.com/wx/static/imImges/close.png"
  119. style="width: 40rpx; height: 40rpx"
  120. @click="show = false"
  121. />
  122. </view>
  123. <view class="main">
  124. <view class="item">
  125. <view class="left">
  126. <img :src="itemData.faceUrl" alt="" class="img" />
  127. </view>
  128. <view class="right">
  129. <view class="right_contont">
  130. <view style="width: 80%">
  131. <view class="title">{{ itemData.name }}</view>
  132. </view>
  133. </view>
  134. <view class="remake"> 群ID:{{ itemData.id }} </view>
  135. <view class="remake"> {{ itemData.introduction }} </view>
  136. </view>
  137. </view>
  138. <view class="imgs">
  139. <view class="item_img">
  140. <image
  141. src="https://directpurchase-oss-dev.oss-cn-chengdu.aliyuncs.com/wx/static/imImges/yzkh.png"
  142. class="icon"
  143. />
  144. <view> 优质客户 </view>
  145. </view>
  146. <view class="item_img">
  147. <image
  148. src="https://directpurchase-oss-dev.oss-cn-chengdu.aliyuncs.com/wx/static/imImges/xxgx.png"
  149. class="icon"
  150. />
  151. <view> 信息共享 </view>
  152. </view>
  153. <view class="item_img">
  154. <image
  155. src="https://directpurchase-oss-dev.oss-cn-chengdu.aliyuncs.com/wx/static/imImges/qsmh.png"
  156. class="icon"
  157. />
  158. <view> 轻松卖货 </view>
  159. </view>
  160. </view>
  161. </view>
  162. <view class="popup" style="margin-top: 40rpx">
  163. <u-button
  164. type="primary"
  165. :plain="true"
  166. :text="`${itemData.price}元加入群聊`"
  167. :customStyle="customStyle"
  168. @click="addGroup"
  169. ></u-button>
  170. </view>
  171. </view>
  172. </u-popup>
  173. </view>
  174. </template>
  175. <script>
  176. import gjsSelectCity from "@/components/gjs-selectCity.vue";
  177. import classification from "@/components/classification.vue";
  178. export default {
  179. components: {
  180. gjsSelectCity,
  181. classification,
  182. },
  183. data() {
  184. return {
  185. show: false,
  186. popupShow: false,
  187. statusBarHeight: 0,
  188. bottomStatusHeight: 0,
  189. pullDownStatus: "loading",
  190. screenData: {
  191. className: "分类",
  192. classId: "",
  193. addressName: "发货地",
  194. addressId: "",
  195. },
  196. queryParams: {
  197. pageNumber: 1,
  198. pageSize: 5,
  199. area: "",
  200. category: "",
  201. },
  202. screenIndex: 0,
  203. screenStatus: false,
  204. classList: [],
  205. dataList: [],
  206. itemData: {},
  207. };
  208. },
  209. mounted() {
  210. // #ifndef H5 || APP-PLUS || MP-ALIPAY
  211. const { windowHeight, screenHeight, safeArea, statusBarHeight } = uni.$u.sys(); // 获取页面高度
  212. let menuButtonObject = uni.getMenuButtonBoundingClientRect();
  213. let navHeight =
  214. menuButtonObject.height + (menuButtonObject.top - statusBarHeight) * 2;
  215. this.statusBarHeight = navHeight + statusBarHeight + 4;
  216. let tabBarHeight = windowHeight - safeArea.bottom;
  217. this.bottomStatusHeight = screenHeight - this.statusBarHeight - tabBarHeight;
  218. // #endif
  219. },
  220. onLoad(option) {
  221. console.log("option", option);
  222. },
  223. onReady() {},
  224. methods: {
  225. setData(aaa) {
  226. console.log("12312321", aaa);
  227. },
  228. addGroup() {
  229. let userid = uni.getStorageSync("userId");
  230. let openid = uni.getStorageSync("openid");
  231. if (this.itemData.price == 0) {
  232. let params = {
  233. userId: userid,
  234. ragId: this.itemData.id,
  235. ragStatus: 0,
  236. userType: 1,
  237. };
  238. this.api.addRagUser(params).then((res) => {
  239. if (res.code === 200) {
  240. if (res.msg == "该用户已加入过该群组") {
  241. }
  242. }
  243. });
  244. } else {
  245. let params = {
  246. body: this.itemData.introduction,
  247. attach: 1,
  248. oriMon: this.itemData.price,
  249. payKinds: 0,
  250. payMeth: 2,
  251. ragId: this.itemData.id,
  252. openId: openid,
  253. };
  254. this.api.addImGroupOrder(params).then((res) => {
  255. if (res.code === 200) {
  256. this.show = false;
  257. webUni.webView.navigateTo({
  258. url:
  259. `/subpages/message/pay/index?info=` + encodeURIComponent(res.data.result),
  260. });
  261. }
  262. });
  263. }
  264. },
  265. join(record) {
  266. this.itemData = record;
  267. if (record.isAddGroupStatus == 1) {
  268. //已加群
  269. } else {
  270. this.show = true;
  271. }
  272. },
  273. queryList(pageNumber, pageSize) {
  274. this.queryParams.pageNumber = pageNumber;
  275. this.queryParams.pageSize = pageSize;
  276. let dataList = [];
  277. this.$refs.paging.complete(dataList);
  278. this.api
  279. .getAllGroups(this.queryParams)
  280. .then((res) => {
  281. if (res.code === 200) {
  282. console.log("123213", res);
  283. this.$refs.paging.complete(res.data.content);
  284. }
  285. })
  286. .catch((res) => {
  287. this.$refs.paging.complete(false);
  288. });
  289. },
  290. grouoDetail(record) {
  291. uni.navigateTo({
  292. url: "/pages/group/data?info=" + JSON.stringify(record),
  293. });
  294. },
  295. // 筛选点击事件
  296. screenClick(i) {
  297. this.screenIndex = i;
  298. if (this.screenStatus) {
  299. this.screenIndex = "";
  300. this.screenStatus = false;
  301. } else {
  302. this.screenStatus = true;
  303. }
  304. },
  305. // 发货地返回值
  306. selectAddress(i) {
  307. this.screenData.addressName = i.name;
  308. this.screenData.addressId = i.cityId;
  309. this.screenStatus = false;
  310. this.ajax.page = 1;
  311. this.ajax.load = true;
  312. this.getList();
  313. },
  314. // 分类返回值
  315. selectClass(i) {
  316. this.screenData.className = i.className;
  317. this.screenData.classId = i.id;
  318. this.screenStatus = false;
  319. this.ajax.page = 1;
  320. this.ajax.load = true;
  321. this.getList();
  322. },
  323. // 筛选清空事件
  324. screenReset() {
  325. this.screenData.lowestPrice = "";
  326. this.screenData.maxPrice = "";
  327. this.screenData.minPurchase = "";
  328. this.screenData.maxPurchase = "";
  329. },
  330. // 筛选确定
  331. screenOk() {
  332. this.ajax.page = 1;
  333. this.ajax.load = true;
  334. this.getList();
  335. this.screenStatus = false;
  336. },
  337. },
  338. };
  339. </script>
  340. <style lang="scss" scoped>
  341. .imgs {
  342. display: flex;
  343. flex-direction: row;
  344. justify-content: space-around;
  345. align-items: center;
  346. margin-top: 10px;
  347. .item_img {
  348. display: flex;
  349. flex-direction: column;
  350. align-items: center;
  351. justify-content: center;
  352. width: 30%;
  353. .icon {
  354. width: 120rpx;
  355. height: 120rpx;
  356. }
  357. }
  358. }
  359. .popup ::v-deep .u-button {
  360. width: 100% !important;
  361. height: 38px !important;
  362. background: linear-gradient(87deg, #28d141 0%, #28ef8c 100%) !important;
  363. border: none !important;
  364. border-radius: 29rpx !important;
  365. font-size: 28rpx !important;
  366. font-weight: bold !important;
  367. margin-top: 30px;
  368. color: white;
  369. }
  370. .main {
  371. .item {
  372. display: flex;
  373. flex-direction: row;
  374. align-items: center;
  375. padding: 10px 20px;
  376. background: white;
  377. .left {
  378. width: 20%;
  379. margin-right: 10px;
  380. .img {
  381. width: 110rpx;
  382. height: 110rpx;
  383. border-radius: 50%;
  384. }
  385. }
  386. .right {
  387. width: 80%;
  388. line-height: 25px;
  389. .remake {
  390. font-weight: 400;
  391. font-size: 28rpx;
  392. color: #999999;
  393. }
  394. .right_contont {
  395. display: flex;
  396. flex-direction: row;
  397. align-items: center;
  398. .gys {
  399. width: 168rpx;
  400. height: 28rpx;
  401. font-weight: 500;
  402. font-size: 24rpx;
  403. color: #ff8b2f;
  404. line-height: 28rpx;
  405. font-style: normal;
  406. }
  407. .cgs {
  408. width: 168rpx;
  409. height: 28rpx;
  410. font-weight: 500;
  411. font-size: 24rpx;
  412. color: #00d36d;
  413. line-height: 28rpx;
  414. font-style: normal;
  415. }
  416. }
  417. .value {
  418. display: flex;
  419. flex-direction: row;
  420. align-items: center;
  421. height: 60rpx;
  422. }
  423. .title {
  424. font-weight: 600;
  425. font-size: 32rpx;
  426. color: #333333;
  427. }
  428. }
  429. }
  430. }
  431. .supply-hall {
  432. width: 750rpx;
  433. height: 100vh;
  434. background-color: white;
  435. overflow: hidden;
  436. &-tabs {
  437. height: 70rpx;
  438. background-color: #ffffff;
  439. border-radius: 0rpx 0rpx 28rpx 28rpx;
  440. display: flex;
  441. justify-content: space-between;
  442. align-items: center;
  443. padding: 0rpx 24rpx;
  444. &-item {
  445. display: flex;
  446. align-items: center;
  447. }
  448. }
  449. &-screen {
  450. height: 70rpx;
  451. background-color: #ffffff;
  452. // border-radius: 0rpx 0rpx 28rpx 28rpx;
  453. display: flex;
  454. align-items: center;
  455. justify-content: space-around;
  456. position: relative;
  457. &-item {
  458. display: flex;
  459. align-items: center;
  460. }
  461. }
  462. }
  463. .ml6 {
  464. margin-left: 6rpx;
  465. }
  466. ::v-deep .supply-hall-search .u-input.data-v-113bc24f {
  467. background-color: #fff !important;
  468. box-sizing: border-box !important;
  469. border-radius: 33rpx !important;
  470. height: 64rpx !important;
  471. padding-right: 2rpx !important;
  472. }
  473. ::v-deep .popup-item .u-input.data-v-113bc24f {
  474. background-color: #fff !important;
  475. box-sizing: border-box !important;
  476. border-radius: 33rpx !important;
  477. height: 64rpx !important;
  478. padding-right: 2rpx !important;
  479. width: 200rpx !important;
  480. }
  481. ::v-deep .u-button--primary.data-v-2bf0e569 {
  482. width: 110rpx !important;
  483. height: 56rpx !important;
  484. background: linear-gradient(87deg, #28d141 0%, #28ef8c 100%) !important;
  485. border: none !important;
  486. border-radius: 29rpx !important;
  487. font-size: 28rpx !important;
  488. font-weight: bold !important;
  489. }
  490. </style>