data.vue 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288
  1. <template>
  2. <view class="supply-hall">
  3. <u-navbar :autoBack="true" bgColor="transparent"> 群资料 </u-navbar>
  4. <view class="supply-hall-header">
  5. <view :style="{ height: statusBarHeight + 'px' }"></view>
  6. </view>
  7. <view>
  8. <view class="main">
  9. <view class="item">
  10. <view class="left">
  11. <img :src="info.faceUrl" alt="" class="img" />
  12. </view>
  13. <view class="right">
  14. <view class="right_contont">
  15. <view style="width: 80%">
  16. <view class="title">{{ info.name ? info.name : "" }}</view>
  17. <view class="value">群号: {{ info.groupId ? info.groupId : "" }}</view>
  18. </view>
  19. <view class="right_button">
  20. <image
  21. :src="getStaticFilePath('/static/imImges/ewm.png')"
  22. style="width: 40rpx; height: 40rpx"
  23. />
  24. </view>
  25. </view>
  26. <view class="remake"> {{ info.introduction ? info.introduction : "" }} </view>
  27. </view>
  28. </view>
  29. </view>
  30. <view class="contont">
  31. <view class="header">
  32. <text>成员概况</text>
  33. <text>共 {{ info.dealerCount + info.nowSupplierCounts }}人</text>
  34. </view>
  35. <view class="schedule">
  36. <view>
  37. <view class="header title">
  38. <text> 供应商人数</text>
  39. <text>剩{{ info.supplierCount - info.nowSupplierCounts }}人满员</text>
  40. </view>
  41. <view>
  42. <u-line-progress
  43. :percentage="info.nowSupplierCounts"
  44. activeColor="#00C868"
  45. ></u-line-progress>
  46. </view>
  47. </view>
  48. <view>
  49. <view class="header title">
  50. <text>司机人数</text>
  51. <text>剩10人满员</text>
  52. </view>
  53. <view>
  54. <u-line-progress :percentage="30" activeColor="#FFE000"></u-line-progress>
  55. </view>
  56. </view>
  57. <view>
  58. <view class="header title">
  59. <text> 采购商人数</text>
  60. <text>剩{{ info.purchaserCount - info.nowPurchaserCounts }}人满员</text>
  61. </view>
  62. <view>
  63. <u-line-progress
  64. :percentage="info.nowPurchaserCounts"
  65. activeColor="#00EBFF"
  66. ></u-line-progress>
  67. </view>
  68. </view>
  69. </view>
  70. </view>
  71. <view class="xian"> </view>
  72. <view class="announcement">
  73. <view class="header">
  74. <text>群公告</text>
  75. </view>
  76. <view style="padding: 20px">
  77. {{ info.introduction ? info.introduction : "" }}
  78. </view>
  79. </view>
  80. </view>
  81. <view class="popup">
  82. <u-button
  83. type="primary"
  84. :plain="true"
  85. :text="`${info.price}元加入群聊`"
  86. @click="addGroup"
  87. ></u-button>
  88. </view>
  89. </view>
  90. </template>
  91. <script>
  92. import gjsSelectCity from "@/components/gjs-selectCity.vue";
  93. import classification from "@/components/classification.vue";
  94. import * as MsgApi from "@/api/message/index.js";
  95. export default {
  96. components: {
  97. gjsSelectCity,
  98. classification,
  99. },
  100. data() {
  101. return {
  102. show: false,
  103. popupShow: false,
  104. statusBarHeight: 0,
  105. bottomStatusHeight: 0,
  106. groupInfo: {},
  107. info: {},
  108. };
  109. },
  110. mounted() {
  111. // #ifndef H5 || APP-PLUS || MP-ALIPAY
  112. const { windowHeight, screenHeight, safeArea, statusBarHeight } = uni.$u.sys(); // 获取页面高度
  113. let menuButtonObject = uni.getMenuButtonBoundingClientRect();
  114. let navHeight =
  115. menuButtonObject.height + (menuButtonObject.top - statusBarHeight) * 2;
  116. this.statusBarHeight = navHeight + statusBarHeight + 4;
  117. let tabBarHeight = windowHeight - safeArea.bottom;
  118. this.bottomStatusHeight = screenHeight - this.statusBarHeight - tabBarHeight;
  119. // #endif
  120. },
  121. onLoad(option) {
  122. console.log(option);
  123. this.groupInfo = JSON.parse(option.info);
  124. this.getGroupInfo();
  125. },
  126. computed: {},
  127. onReady() {},
  128. methods: {
  129. async getGroupInfo() {
  130. let params = {
  131. groupId: this.groupInfo.groupId,
  132. userId: uni.getStorageSync("userid"),
  133. };
  134. const res = await MsgApi.default.getGroupByGroupId(params);
  135. console.log("1231231", res);
  136. if (res.code == 200) {
  137. this.info = res.data;
  138. }
  139. },
  140. addGroup() {
  141. let userid = uni.getStorageSync("userId");
  142. let openid = uni.getStorageSync("openid");
  143. if (this.groupInfo.price == 0) {
  144. let params = {
  145. userId: userid,
  146. ragId: this.groupInfo.id,
  147. ragStatus: 0,
  148. userType: 1,
  149. };
  150. this.api.addRagUser(params).then((res) => {
  151. if (res.code === 200) {
  152. if (res.msg == "该用户已加入过该群组") {
  153. }
  154. }
  155. });
  156. } else {
  157. let params = {
  158. body: this.groupInfo.introduction,
  159. attach: 1,
  160. oriMon: this.groupInfo.price,
  161. payKinds: 0,
  162. payMeth: 2,
  163. ragId: this.groupInfo.id,
  164. openId: openid,
  165. };
  166. this.api.addImGroupOrder(params).then((res) => {
  167. if (res.code === 200) {
  168. this.show = false;
  169. webUni.webView.navigateTo({
  170. url:
  171. `/subpages/message/pay/index?info=` + encodeURIComponent(res.data.result),
  172. });
  173. }
  174. });
  175. }
  176. },
  177. },
  178. };
  179. </script>
  180. <style lang="scss" scoped>
  181. .supply-hall {
  182. background: #f4f4f4;
  183. height: 100%;
  184. }
  185. .xian {
  186. background: #f4f4f4;
  187. height: 10px;
  188. width: 100%;
  189. }
  190. .main {
  191. border-bottom: 1px solid #f4f4f4;
  192. background: white;
  193. .item {
  194. display: flex;
  195. flex-direction: row;
  196. align-items: center;
  197. padding: 10px 20px;
  198. background: white;
  199. .left {
  200. width: 20%;
  201. margin-right: 10px;
  202. .img {
  203. width: 110rpx;
  204. height: 110rpx;
  205. border-radius: 50%;
  206. }
  207. }
  208. .right {
  209. width: 80%;
  210. line-height: 25px;
  211. .remake {
  212. font-weight: 400;
  213. font-size: 28rpx;
  214. color: #999999;
  215. }
  216. .right_contont {
  217. display: flex;
  218. flex-direction: row;
  219. align-items: flex-start;
  220. justify-content: space-between;
  221. }
  222. .value {
  223. font-weight: 500;
  224. font-size: 28rpx;
  225. color: #999999;
  226. }
  227. .title {
  228. font-weight: 600;
  229. font-size: 32rpx;
  230. color: #333333;
  231. }
  232. }
  233. }
  234. }
  235. .announcement {
  236. padding: 10px;
  237. height: 350rpx;
  238. background: white;
  239. .header {
  240. display: flex;
  241. justify-content: space-between;
  242. width: 100%;
  243. }
  244. }
  245. .contont {
  246. padding: 10px;
  247. height: 350rpx;
  248. background: white;
  249. .header {
  250. display: flex;
  251. justify-content: space-between;
  252. width: 100%;
  253. }
  254. .schedule {
  255. height: 100px;
  256. width: 100%;
  257. line-height: 40px;
  258. .title {
  259. font-weight: 500;
  260. font-size: 24rpx;
  261. color: #999999;
  262. }
  263. }
  264. }
  265. .popup {
  266. position: fixed;
  267. width: 96%;
  268. bottom: 20px;
  269. left: 2%;
  270. }
  271. .popup ::v-deep .u-button--primary.data-v-2bf0e569 {
  272. width: 100% !important;
  273. height: 38px !important;
  274. background: linear-gradient(87deg, #28d141 0%, #28ef8c 100%) !important;
  275. border: none !important;
  276. border-radius: 29rpx !important;
  277. font-size: 28rpx !important;
  278. font-weight: bold !important;
  279. margin-top: 30px;
  280. color: white;
  281. }
  282. </style>