list.vue 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434
  1. <template>
  2. <view class="container">
  3. <view class="list">
  4. <view class="item" v-for="(item,index) in list" :key="index">
  5. <view class="content" style="border-bottom: 1rpx solid #f1f1f1;">
  6. <view class="box-pack-between flex-y-center">
  7. <view class="cell flex flex-y-center">
  8. <view class="title">缴纳费用:</view>
  9. <view class="desc" style="color:#FEAF44">
  10. ¥{{item.money}}
  11. </view>
  12. </view>
  13. <view class="flex-y-center ft26">
  14. <text style="margin-right: 15rpx;">状态</text>
  15. <switch :checked="item.status==1?true:false" @change.stop="onTypeChange" :data-index="index"
  16. color="#247EFF" class="type-btn" />
  17. </view>
  18. </view>
  19. <view class="" @click="orderDetail(item.id)">
  20. <view class="box-pack-between">
  21. <view class="cell flex flex-y-center">
  22. <view class="title">等级:</view>
  23. <view class="desc">{{item.shared_level}}级</view>
  24. </view>
  25. <view class="cell flex flex-y-center">
  26. <view class="title">等级名称:</view>
  27. <view class="desc">{{item.name}}</view>
  28. </view>
  29. </view>
  30. <view class="box-pack-between">
  31. <view class="cell flex flex-y-center">
  32. <view class="title">赠送积分:</view>
  33. <view class="desc">{{item.integral}}</view>
  34. </view>
  35. <view class="cell flex flex-y-center">
  36. <view class="title">赠送余额:</view>
  37. <view class="desc">{{item.balance}}</view>
  38. </view>
  39. </view>
  40. <view class="cell flex flex-y-center" v-if="item.type!=3">
  41. <view class="title">礼盒数量:</view>
  42. <view class="desc">
  43. {{item.gift}}
  44. </view>
  45. </view>
  46. <view class="cell flex flex-y-center" v-if="item.type!=3">
  47. <view class="title">直接佣金比例(%):</view>
  48. <view class="desc">
  49. {{item.direct_commission}}
  50. </view>
  51. </view>
  52. <view class="cell flex flex-y-center">
  53. <view class="title">间接佣金比例(%) :</view>
  54. <view class="desc">{{item.indirect_commission}}</view>
  55. </view>
  56. </view>
  57. <view class="goods_list flex" v-for="(items,index) of item.goods_list" :key='index'>
  58. <view class="goods_list-title flex-grow-1 box-pack-between">
  59. <view class="">
  60. {{items.name}} ×{{items.num}}
  61. </view>
  62. <view class="goods_list-price">
  63. ¥{{items.total_price}}
  64. </view>
  65. </view>
  66. </view>
  67. </view>
  68. </view>
  69. <view class="no-more">
  70. ---没有更多了---
  71. </view>
  72. </view>
  73. <view class="footer-bar">
  74. <view class="content flex flex-center">
  75. <navigator url="./addPartner" class="btn">+添加合伙人等级</navigator>
  76. </view>
  77. </view>
  78. </view>
  79. </template>
  80. <script>
  81. export default {
  82. components: {},
  83. data() {
  84. return {
  85. URL: getApp().globalData.URL,
  86. store_id: "",
  87. list: [],
  88. page: 1,
  89. is_bottom: false,
  90. }
  91. },
  92. onLoad(options) {
  93. this.store_id = uni.getStorageSync("store_id");
  94. this.getData(1);
  95. },
  96. onReachBottom() {
  97. if (!this.is_bottom) {
  98. this.getData(this.page + 1)
  99. }
  100. },
  101. methods: {
  102. onTypeChange(e) {
  103. console.log(e)
  104. let a = e.detail.value ? 1 : 0;
  105. this.checked(a, e.currentTarget.dataset.index);
  106. },
  107. checked(a, index) {
  108. this.request({
  109. url: 'smdcshop/shared_level_status',
  110. data: {
  111. is_show: a,
  112. id: this.list[index].id,
  113. },
  114. }).then(res => {
  115. if (res.code == "200") {
  116. uni.showToast({
  117. title: "修改成功",
  118. icon: "none",
  119. })
  120. }
  121. }).catch((res) => {
  122. uni.showToast({
  123. title: res.message,
  124. icon: "none",
  125. })
  126. this.$nextTick(() => {
  127. this.list[index].state = 2
  128. })
  129. });
  130. },
  131. //详情
  132. orderDetail(id){
  133. uni.navigateTo({
  134. url:'./orderDetail?id='+id
  135. })
  136. },
  137. getData(page) {
  138. if (page == 1) {
  139. this.list = []
  140. this.page = 1
  141. this.is_bottom = false
  142. }
  143. this.request({
  144. url: 'smdcshop/shared_level_index',
  145. data: {
  146. admin_id: uni.getStorageSync("admin_id"),
  147. page,
  148. limit: 10,
  149. }
  150. }).then(res => {
  151. if (res.code == 200 && res.data.length) {
  152. this.list = this.list.concat(res.data)
  153. this.page = page
  154. } else {
  155. this.is_bottom = true
  156. }
  157. })
  158. }
  159. },
  160. }
  161. </script>
  162. <style lang="scss">
  163. .type-btn {
  164. zoom: 0.7;
  165. margin-right: 25rpx;
  166. }
  167. .search-content {
  168. padding: 20rpx 0;
  169. background: #FFFFFF;
  170. font-size: 28rpx;
  171. .search {
  172. width: 80%;
  173. border: 1rpx solid #F1F1F1;
  174. margin-right: 15rpx;
  175. padding: 10rpx;
  176. border-radius: 4rpx;
  177. icon {
  178. margin-right: 15rpx;
  179. }
  180. }
  181. }
  182. .model {
  183. width: 100%;
  184. z-index: 10;
  185. background: #FFFFFF;
  186. padding-bottom: 20rpx;
  187. .model-date {
  188. width: 100%;
  189. padding: 20rpx 80rpx;
  190. border-bottom: 1rpx solid #F1F1F1;
  191. .model-item {
  192. width: 352rpx;
  193. text-align: center;
  194. font-size: 28rpx;
  195. color: #999;
  196. position: relative;
  197. padding: 10rpx 0;
  198. text-align: center;
  199. border-radius: 8rpx;
  200. border: 1rpx solid #999;
  201. }
  202. // .act {
  203. // color: #FFFFFF;
  204. // background: #FFBE2C;
  205. // border: 1rpx solid #FFBE2C;
  206. // }
  207. }
  208. .model-btn {
  209. border-radius: 8rpx;
  210. box-shadow: 0px 0px 8rpx 0px rgba(51, 135, 255, 0.20);
  211. margin: 0 auto;
  212. margin-top: 20rpx;
  213. text-align: center;
  214. width: 41%;
  215. height: 80rpx;
  216. border-radius: none;
  217. }
  218. .model-btn-close {
  219. border: 1rpx solid #F1F1F1;
  220. color: #000;
  221. }
  222. .model-btn-success {
  223. color: #FFFFFF;
  224. background: linear-gradient(315deg, #3387ff 2%, #569bff 99%);
  225. }
  226. }
  227. page {
  228. background-color: #F4F5F7;
  229. }
  230. .showpay .active {
  231. color: red
  232. }
  233. .header-hg100 {
  234. height: 100rpx;
  235. position: fixed;
  236. top: 0;
  237. width: 100%;
  238. z-index: 999;
  239. background: #fff;
  240. }
  241. .list {
  242. // padding: 110rpx 25rpx 0;
  243. padding: 25rpx 25rpx 0;
  244. }
  245. .list .item {
  246. background-color: #fff;
  247. border-radius: 8rpx;
  248. overflow: hidden;
  249. padding: 0 25rpx;
  250. margin-bottom: 30rpx;
  251. box-shadow: 0rpx 6rpx 10rpx 0rpx rgba(213, 213, 213, 0.04);
  252. }
  253. .list .item .top {
  254. padding: 20rpx 0;
  255. border-bottom: 1rpx solid #f5f5f5;
  256. }
  257. .list .item .top .pay-info {
  258. flex: none;
  259. }
  260. .list .item .top .pay-type-icon {
  261. display: block;
  262. width: 28rpx;
  263. height: 28rpx;
  264. flex: none;
  265. margin-right: 8rpx;
  266. border-radius: 100px;
  267. }
  268. .list .item .top .pay-status {
  269. font-size: 28rpx;
  270. color: #464646;
  271. }
  272. .list .item .content {
  273. padding: 20rpx 0;
  274. }
  275. .list .content .cell {
  276. margin-bottom: 16rpx;
  277. font-size: 26rpx;
  278. color: #99A0AD;
  279. }
  280. .list .content .cell:last-child {
  281. margin-bottom: 0;
  282. }
  283. .list .content .cell .title {
  284. color: #99A0AD;
  285. }
  286. .list .content .cell .desc {
  287. color: #666;
  288. }
  289. .header-text {
  290. text-align: center;
  291. }
  292. .box-li {
  293. background-color: #fff;
  294. text-align: center;
  295. border-bottom: 1rpx solid #f1f1f1;
  296. height: 80rpx;
  297. line-height: 80rpx;
  298. font-size: 26rpx;
  299. }
  300. .goods_list {
  301. font-size: 28rpx;
  302. }
  303. .goods_list-title {
  304. padding: 20rpx 0;
  305. }
  306. .goods_list-price {
  307. font-size: 26rpx;
  308. color: red;
  309. }
  310. .goods_list-num {
  311. font-size: 26rpx;
  312. }
  313. .d3 {
  314. width: 0;
  315. height: 0;
  316. border-width: 12rpx;
  317. border-style: solid;
  318. border-color: #000 transparent transparent transparent;
  319. margin-top: 14rpx;
  320. }
  321. .avatar-img {
  322. width: 80rpx;
  323. height: 80rpx;
  324. margin-right: 20rpx;
  325. border-radius: 100px;
  326. }
  327. .avatar-title {
  328. font-size: 26rpx;
  329. }
  330. .footer-bar {
  331. height: 160rpx;
  332. /*兼容 IOS<11.2*/
  333. padding-bottom: constant(safe-area-inset-bottom);
  334. /*兼容 IOS>11.2*/
  335. padding-bottom: env(safe-area-inset-bottom);
  336. box-sizing: content-box;
  337. }
  338. .footer-bar .content {
  339. width: 100%;
  340. height: 160rpx;
  341. background-color: #fff;
  342. position: fixed;
  343. left: 0;
  344. bottom: 0;
  345. z-index: 100;
  346. /*兼容 IOS<11.2*/
  347. padding-bottom: constant(safe-area-inset-bottom);
  348. /*兼容 IOS>11.2*/
  349. padding-bottom: env(safe-area-inset-bottom);
  350. box-sizing: content-box;
  351. box-shadow: 0 -5rpx 10rpx #eee;
  352. }
  353. .footer-bar .content .btn {
  354. width: 700rpx;
  355. height: 100rpx;
  356. background: linear-gradient(315deg, #3387ff 2%, #569bff 99%);
  357. border-radius: 8rpx;
  358. box-shadow: 0rpx 0rpx 8rpx 0rpx rgba(51, 135, 255, 0.20);
  359. text-align: center;
  360. line-height: 100rpx;
  361. font-size: 36rpx;
  362. font-weight: 500;
  363. color: #fff;
  364. }
  365. .footer-bar .content .detail-btn {
  366. width: 50%;
  367. height: 40rpx;
  368. }
  369. .footer-bar .content .detail-btn .btn-icon {
  370. flex: none;
  371. display: block;
  372. width: 32rpx;
  373. height: 32rpx;
  374. margin-right: 8rpx;
  375. }
  376. </style>