bonus.vue 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242
  1. <template>
  2. <view class="box">
  3. <view style="height: 20rpx;"></view>
  4. <view class="line" v-for="(item,index) in list">
  5. <view class="linetop">
  6. <view class="name">{{item.CustomerName}}</view>
  7. <view class="amount">¥{{item.BonusMoney}}</view>
  8. </view>
  9. <view class="lineCOnt">
  10. <view class="lineline">
  11. <view class="lineContLeft">
  12. <image src="../../static/timg/icon_dianhua.png" mode="" class="lineContLeftImg"></image>
  13. <view class="lineContLeftMs">{{item.MobilePhone}}</view>
  14. </view>
  15. </view>
  16. <view class="lineline">
  17. <view class="lineContLeft">
  18. <image src="../../static/timg/icon_danhao.png" mode="" class="lineContLeftImg"></image>
  19. <view class="lineContLeftMs">{{item.Code}}</view>
  20. </view>
  21. <view class="lineTIme">{{item.BillDate}}</view>
  22. </view>
  23. </view>
  24. </view>
  25. <nodata v-if="list.length==0"></nodata>
  26. <!-- 手机号授权 -->
  27. <view class="authorizBox" v-if="authorizShow" @click="authorizShow=false">
  28. <view class="authorizCont" @click.stop="">
  29. <view class="authorizName">{{wxOpenData.miniAppName}}</view>
  30. <view class="authorizMs">您好,欢迎访问本店,授权手机号登录能获取我们最新的促销活动哦~</view>
  31. <button class="authorizContbutton" type="default" open-type="getPhoneNumber" @getphonenumber="decryptPhoneNumber">授权</button>
  32. </view>
  33. <view style="text-align: center;padding-top: 56rpx;">
  34. <image src="../../../static/timg/icon_guanbi@2x.png" mode="" class="authorizCloseImg"></image>
  35. </view>
  36. </view>
  37. </view>
  38. </template>
  39. <script>
  40. import nodata from '../../components/nodata/nodata.vue'
  41. export default {
  42. components: {
  43. nodata
  44. },
  45. data() {
  46. return {
  47. list:[],
  48. themeColor:'',
  49. userInfo:'',
  50. page:1,
  51. limit:20,
  52. authorizShow:false,
  53. userInfo:'',
  54. ext:'',
  55. wxOpenData:'',
  56. }
  57. },
  58. onLoad(opt) {
  59. this.themeColor = uni.getStorageSync("themeColor");
  60. this.userInfo = uni.getStorageSync("userInfo");
  61. this.userInfo=this.$store.state.userInfo;
  62. this.ext=this.$common.getExtStoreId();
  63. if(this.userInfo){
  64. this.getList()
  65. }else{
  66. this.$common.automaticlogin().then(val => {
  67. this.userInfo=this.$store.state.userInfo;
  68. this.wxOpenData=this.$store.state.wxOpenData;
  69. this.themeColor = uni.getStorageSync("themeColor");
  70. this.getList()
  71. })
  72. }
  73. },
  74. onShow() {
  75. },
  76. methods: {
  77. getList(){
  78. uni.showLoading({
  79. title: '加载中'
  80. })
  81. this.$http('opencarInfoOwner/listBonusPage', {
  82. page:this.page,limit:this.limit,
  83. }, 'GET').then(res => {
  84. uni.hideLoading();
  85. //this.list = res.data.Items
  86. var data=res.data.Items;
  87. this.list=this.list.concat(data);
  88. //console.log('list+=', this.queryShopList);
  89. })
  90. },
  91. decryptPhoneNumber: function(e) {
  92. console.log(e);
  93. this.code=e.detail.code
  94. this.wxPhoneLogin()
  95. this.authorizShow=false;
  96. },
  97. wxPhoneLogin(){
  98. var that=this;
  99. this.$http('miniApp2/sys/wxPhoneLogin', {
  100. appId:this.ext.appId,
  101. unionId:this.ext.unionId,
  102. code:this.code,
  103. openId:this.wxOpenData.openid
  104. },'POST').then(res => {
  105. var data = res.data;
  106. if(data.loginInfo){
  107. this.userInfo=data.loginInfo.openUser;
  108. this.wxOpenData=data.loginInfo;
  109. this.$store.commit('mutationswxOpenData', data.loginInfo)
  110. this.$store.commit('mutationsuserInfo', this.userInfo)
  111. this.list=[]
  112. this.getList()
  113. }
  114. })
  115. },
  116. },
  117. onReachBottom(){
  118. this.page++;
  119. this.getList()
  120. //console.log("shanglas")
  121. },
  122. onPullDownRefresh(){
  123. this.page=1;
  124. this.list=[];
  125. this.getList();
  126. setTimeout(() => {
  127. uni.stopPullDownRefresh(); // 关闭下拉刷新
  128. }, 2000);
  129. }
  130. }
  131. </script>
  132. <style scoped lang="less">
  133. .box {
  134. width: 100vw;
  135. min-height: 100vh;
  136. background: #F4F5F7;
  137. }
  138. .lineContLeftImg{
  139. width: 30rpx;
  140. height: 30rpx;
  141. margin-right: 10rpx;
  142. }
  143. .line{
  144. width: 702rpx;
  145. background: #FFFFFF;
  146. border-radius: 10rpx;
  147. margin-bottom: 20rpx;
  148. margin-left: 24rpx;
  149. }
  150. .linetop{
  151. display: flex;
  152. justify-content: space-between;
  153. font-size: 30rpx;
  154. padding: 20rpx;
  155. padding-bottom: 0;
  156. }
  157. .lineline{
  158. display: flex;
  159. justify-content: space-between;
  160. padding: 20rpx;
  161. font-weight: 400;
  162. color: #999999;
  163. font-size: 24rpx;
  164. line-height: 30rpx;
  165. }
  166. .lineContLeft{
  167. display: flex;
  168. }
  169. .name{
  170. font-weight: 500;
  171. color: #3C3C3C;
  172. }
  173. .amount{
  174. color: #FF0000;font-weight: 500;
  175. }
  176. .authorizBox{
  177. width: 100vw;
  178. height: 100vh;
  179. background: rgba(0, 0, 0, 0.5);
  180. position: fixed;
  181. top: 0;
  182. left: 0;
  183. }
  184. .authorizCont{
  185. margin-top: 30vh;
  186. width: 564rpx;
  187. height: 408rpx;
  188. background: #FFFFFF;
  189. border-radius: 24rpx;
  190. margin-left: 93rpx;
  191. position: relative;
  192. }
  193. .authorizCloseImg{
  194. width: 62rpx;
  195. height: 62rpx;
  196. }
  197. .sqLogoBox{
  198. width: 180rpx;
  199. height: 180rpx;
  200. background: #FFFFFF;
  201. border-radius: 90rpx;
  202. text-align: center;
  203. position: absolute;
  204. top: -50rpx;
  205. left: 192rpx;
  206. }
  207. .authorizName{
  208. color: #333333;
  209. line-height: 42rpx;
  210. font-size: 30rpx;
  211. text-align: center;
  212. padding-top: 58rpx;
  213. }
  214. .authorizMs{
  215. color: #999999;
  216. line-height: 36rpx;
  217. font-size: 26rpx;
  218. width: 452rpx;
  219. padding-top: 24rpx;
  220. text-align: center;
  221. margin-left: 56rpx;
  222. }
  223. .authorizContbutton{
  224. width: 422rpx;
  225. height: 88rpx;
  226. background: #D53533;
  227. border-radius: 44rpx;
  228. line-height: 88rpx;
  229. text-align: center;
  230. font-size:30rpx;
  231. color: #FFFFFF;
  232. margin-top: 62rpx;
  233. margin-left:71rpx;
  234. }
  235. </style>