memeber.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355
  1. <template>
  2. <app-layout>
  3. <view class="search">
  4. <view @click='beSearch' v-if="!toSearch" class="main-center search-content cross-center">
  5. <image src="/static/image/icon/icon-search.png"></image>
  6. <text>搜索</text>
  7. </view>
  8. <view v-else class="dir-left-nowrap cross-center search-area">
  9. <view class="search-input">
  10. <image src='/static/image/icon/icon-search.png'></image>
  11. <input focus class="box-grow-1 t-small search-content" @confirm='goSearch' confirm-type='search' v-model='keyword' :placeholder="'请输入'+setting.form.members?setting.form.members:'队员'+'昵称搜索'"></input>
  12. </view>
  13. <view class="cancel" @click="cancelSeacrch">
  14. <view>取消</view>
  15. </view>
  16. </view>
  17. </view>
  18. <view @click="toggle" class='main-center cross-center sort'>
  19. <text>{{setting.form && setting.form.offer_text?setting.form.offer_text :'贡献分红金额'}}</text>
  20. <image v-if="order_by == 'bonus_price desc'" src='./../image/shop-price-less.png'></image>
  21. <image v-if="order_by == 'bonus_price'" src='./../image/shop-price-plus.png'></image>
  22. </view>
  23. <view class="placeholder"></view>
  24. <view class="list" v-if="list && list.length > 0">
  25. <view @click="toOrder(item.nickname)" v-for="item in list" :key="item.id">
  26. <view class="main-between cross-center item">
  27. <view class='item-info dir-left-nowrap'>
  28. <image class='avatar' :src='item.avatar'></image>
  29. <view>
  30. <view class="item-nickname">{{item.nickname}}</view>
  31. <view>
  32. <text class='info-label'>{{setting.form && setting.form.offer_text?setting.form.offer_text :'贡献分红金额'}}</text>
  33. <text style='font-family:DIN'>¥{{item.bonus_price}}</text>
  34. </view>
  35. </view>
  36. </view>
  37. <view>
  38. <text>订单</text>
  39. <image class="arrow-right" src='/static/image/icon/arrow-right.png'></image>
  40. </view>
  41. </view>
  42. </view>
  43. </view>
  44. <view class='no-tip' v-if="list && list.length == 0">
  45. <image src="/static/image/user-default-avatar.png"></image>
  46. <span>暂无队员</span>
  47. </view>
  48. </app-layout>
  49. </template>
  50. <script>
  51. import appRichText from "../../../components/basic-component/app-rich/parse.vue";
  52. export default {
  53. data() {
  54. return {
  55. order_by: 'bonus_price desc',
  56. captain_id: null,
  57. keyword: '',
  58. page: 2,
  59. setting: '',
  60. more_list: false,
  61. toSearch: false,
  62. list: []
  63. }
  64. },
  65. components: {
  66. "app-rich-text": appRichText
  67. },
  68. methods: {
  69. toOrder(nickname) {
  70. uni.navigateTo({
  71. url: '/plugins/bonus/order/order?nickname=' + nickname
  72. });
  73. },
  74. cancelSeacrch() {
  75. this.keyword = '';
  76. this.toSearch = !this.toSearch;
  77. this.page = 2;
  78. this.getList();
  79. },
  80. beSearch() {
  81. this.toSearch = !this.toSearch;
  82. this.page = 2;
  83. },
  84. goSearch() {
  85. uni.showLoading({
  86. mask: true,
  87. title: '加载中...'
  88. });
  89. this.getList();
  90. },
  91. toggle() {
  92. if (this.order_by == 'bonus_price desc') {
  93. this.order_by = 'bonus_price'
  94. } else if (this.order_by == 'bonus_price') {
  95. this.order_by = 'bonus_price desc'
  96. }
  97. this.list = [];
  98. this.page = 2;
  99. this.getList();
  100. },
  101. getSetting() {
  102. let that = this;
  103. that.$request({
  104. url: that.$api.bonus.setting,
  105. }).then(response=>{
  106. that.getList();
  107. if(response.code == 0) {
  108. that.setting = response.data.list;
  109. if (that.setting.form && that.setting.form.members) {
  110. uni.setNavigationBarTitle({
  111. title: that.setting.form.members,
  112. })
  113. } else {
  114. uni.setNavigationBarTitle({
  115. title: '队员',
  116. })
  117. }
  118. }else {
  119. uni.showToast({
  120. title: response.msg,
  121. icon: 'none',
  122. duration: 1000
  123. });
  124. }
  125. }).catch(response => {
  126. });
  127. },
  128. getList() {
  129. let that = this;
  130. that.$request({
  131. url: that.$api.bonus.team,
  132. data: {
  133. keyword: that.keyword,
  134. keyword_1: 1,
  135. order_by: that.order_by,
  136. },
  137. method: 'post'
  138. }).then(response=>{
  139. that.$hideLoading();
  140. uni.hideLoading();
  141. if(response.code == 0) {
  142. that.list = response.data.list;
  143. }else {
  144. uni.showToast({
  145. title: response.msg,
  146. icon: 'none',
  147. duration: 1000
  148. });
  149. }
  150. }).catch(response => {
  151. that.$hideLoading();
  152. uni.hideLoading();
  153. });
  154. },
  155. getMore() {
  156. let that = this;
  157. that.$request({
  158. url: that.$api.bonus.team,
  159. data: {
  160. keyword: that.keyword,
  161. keyword_1: 1,
  162. order_by: that.order_by,
  163. page: that.page
  164. }
  165. }).then(response=>{
  166. that.$hideLoading();
  167. if(response.code == 0) {
  168. that.list = that.list.concat(response.data.list);
  169. that.page++;
  170. }else {
  171. uni.showToast({
  172. title: response.msg,
  173. icon: 'none',
  174. duration: 1000
  175. });
  176. }
  177. }).catch(response => {
  178. that.$hideLoading();
  179. });
  180. },
  181. },
  182. onLoad() { this.$commonLoad.onload();
  183. let that = this;
  184. that.$showLoading({
  185. type: 'global',
  186. text: '加载中...'
  187. });
  188. that.getSetting();
  189. },
  190. onReachBottom() {
  191. this.getMore();
  192. }
  193. }
  194. </script>
  195. <style scoped lang="scss">
  196. .no-tip {
  197. position: fixed;
  198. top: #{400rpx};
  199. left: 0;
  200. right: 0;
  201. margin: 0 auto;
  202. color: #666666;
  203. font-size: #{24rpx};
  204. width: #{240rpx};
  205. text-align: center;
  206. image {
  207. height: #{240rpx};
  208. width: #{240rpx};
  209. margin-bottom: #{20rpx};
  210. }
  211. }
  212. .search {
  213. height: #{88rpx};
  214. padding: #{16rpx} #{26rpx};
  215. background-color: #efeff4;
  216. position: fixed;
  217. top: 0;
  218. left: 0;
  219. right: 0;
  220. z-index: 10;
  221. }
  222. .search input {
  223. padding: 0 #{30rpx};
  224. }
  225. .search-content {
  226. background-color: #fff;
  227. height: #{56rpx};
  228. border-radius: #{28rpx};
  229. }
  230. .search-content image {
  231. height:#{24rpx};
  232. width:#{24rpx};
  233. }
  234. .search-content text {
  235. color:#b2b2b2;
  236. font-size:#{24rpx};
  237. margin:0 #{5rpx};
  238. }
  239. .search-area {
  240. height: #{56rpx};
  241. }
  242. .placeholder {
  243. height: #{192rpx};
  244. }
  245. .sort {
  246. height: #{80rpx};
  247. background-color: #fff;
  248. position: fixed;
  249. top: #{88rpx};
  250. left: 0;
  251. right: 0;
  252. z-index: 10;
  253. font-size: #{28rpx};
  254. color: #666;
  255. }
  256. .sort image {
  257. height: #{26rpx};
  258. width: #{16rpx};
  259. margin-left: #{16rpx};
  260. }
  261. .item {
  262. width: #{702rpx};
  263. margin: #{24rpx};
  264. margin-top: 0;
  265. background-color: #fff;
  266. border-radius: #{16rpx};
  267. padding: #{24rpx};
  268. font-size: #{24rpx};
  269. color: #999;
  270. }
  271. .item .avatar {
  272. height: #{80rpx};
  273. width: #{80rpx};
  274. margin-right: #{24rpx};
  275. border-radius: #{5rpx};
  276. }
  277. .item-info {
  278. font-size: #{28rpx};
  279. color: #353535;
  280. }
  281. .item-info .item-nickname {
  282. margin-bottom: #{4rpx};
  283. }
  284. .info-label {
  285. height: #{36rpx};
  286. padding: 0 #{10rpx};
  287. text-align: center;
  288. line-height: #{36rpx};
  289. font-size: #{24rpx};
  290. color: #999;
  291. background-color: #efeff4;
  292. display: inline-block;
  293. }
  294. .search-input {
  295. height: #{56rpx};
  296. position: relative;
  297. width: #{620rpx};
  298. }
  299. .search-input image {
  300. height: #{22rpx};
  301. width: #{22rpx};
  302. position: absolute;
  303. top: #{17rpx};
  304. left: #{28rpx};
  305. z-index: 10;
  306. }
  307. .search-input input {
  308. padding-left: #{66rpx};
  309. background-color: #fff;
  310. border-radius: #{32rpx};
  311. height: #{56rpx};
  312. font-size: #{26rpx};
  313. color: #353535;
  314. }
  315. .cancel view {
  316. margin-left: #{16rpx};
  317. font-size: #{28rpx};
  318. color: #00c203;
  319. }
  320. .arrow-right {
  321. height:#{20rpx};
  322. width:#{12rpx};
  323. margin-left:#{12rpx};
  324. }
  325. </style>