bonus.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246
  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.userInfo=this.$store.state.userInfo;
  63. this.ext=this.$common.getExtStoreId();
  64. if(this.userInfo){
  65. this.getList()
  66. }else{
  67. this.$common.automaticlogin().then(val => {
  68. this.userInfo=this.$store.state.userInfo;
  69. this.wxOpenData=this.$store.state.wxOpenData;
  70. this.themeColor = uni.getStorageSync("themeColor");
  71. if(!this.userInfo){
  72. this.authorizShow=true
  73. }
  74. this.getList()
  75. })
  76. }
  77. },
  78. onShow() {
  79. },
  80. methods: {
  81. getList(){
  82. uni.showLoading({
  83. title: '加载中'
  84. })
  85. this.$http('opencarInfoOwner/listBonusPage', {
  86. page:this.page,limit:this.limit,
  87. }, 'GET').then(res => {
  88. uni.hideLoading();
  89. //this.list = res.data.Items
  90. var data=res.data.Items;
  91. this.list=this.list.concat(data);
  92. //console.log('list+=', this.queryShopList);
  93. })
  94. },
  95. decryptPhoneNumber: function(e) {
  96. console.log(e);
  97. this.code=e.detail.code
  98. this.wxPhoneLogin()
  99. this.authorizShow=false;
  100. },
  101. wxPhoneLogin(){
  102. var that=this;
  103. this.$http('miniApp2/sys/wxPhoneLogin', {
  104. appId:this.ext.appId,
  105. unionId:this.ext.unionId,
  106. code:this.code,
  107. openId:this.wxOpenData.openid
  108. },'POST').then(res => {
  109. var data = res.data;
  110. if(data.loginInfo){
  111. this.userInfo=data.loginInfo.openUser;
  112. this.wxOpenData=data.loginInfo;
  113. this.$store.commit('mutationswxOpenData', data)
  114. this.$store.commit('mutationsuserInfo', this.userInfo)
  115. this.list=[]
  116. this.getList()
  117. }
  118. })
  119. },
  120. },
  121. onReachBottom(){
  122. this.page++;
  123. this.getList()
  124. //console.log("shanglas")
  125. },
  126. onPullDownRefresh(){
  127. this.page=1;
  128. this.list=[];
  129. this.getList();
  130. setTimeout(() => {
  131. uni.stopPullDownRefresh(); // 关闭下拉刷新
  132. }, 2000);
  133. }
  134. }
  135. </script>
  136. <style scoped lang="less">
  137. .box {
  138. width: 100vw;
  139. min-height: 100vh;
  140. background: #F4F5F7;
  141. }
  142. .lineContLeftImg{
  143. width: 30rpx;
  144. height: 30rpx;
  145. margin-right: 10rpx;
  146. }
  147. .line{
  148. width: 702rpx;
  149. background: #FFFFFF;
  150. border-radius: 10rpx;
  151. margin-bottom: 20rpx;
  152. margin-left: 24rpx;
  153. }
  154. .linetop{
  155. display: flex;
  156. justify-content: space-between;
  157. font-size: 30rpx;
  158. padding: 20rpx;
  159. padding-bottom: 0;
  160. }
  161. .lineline{
  162. display: flex;
  163. justify-content: space-between;
  164. padding: 20rpx;
  165. font-weight: 400;
  166. color: #999999;
  167. font-size: 24rpx;
  168. line-height: 30rpx;
  169. }
  170. .lineContLeft{
  171. display: flex;
  172. }
  173. .name{
  174. font-weight: 500;
  175. color: #3C3C3C;
  176. }
  177. .amount{
  178. color: #FF0000;font-weight: 500;
  179. }
  180. .authorizBox{
  181. width: 100vw;
  182. height: 100vh;
  183. background: rgba(0, 0, 0, 0.5);
  184. position: fixed;
  185. top: 0;
  186. left: 0;
  187. }
  188. .authorizCont{
  189. margin-top: 30vh;
  190. width: 564rpx;
  191. height: 408rpx;
  192. background: #FFFFFF;
  193. border-radius: 24rpx;
  194. margin-left: 93rpx;
  195. position: relative;
  196. }
  197. .authorizCloseImg{
  198. width: 62rpx;
  199. height: 62rpx;
  200. }
  201. .sqLogoBox{
  202. width: 180rpx;
  203. height: 180rpx;
  204. background: #FFFFFF;
  205. border-radius: 90rpx;
  206. text-align: center;
  207. position: absolute;
  208. top: -50rpx;
  209. left: 192rpx;
  210. }
  211. .authorizName{
  212. color: #333333;
  213. line-height: 42rpx;
  214. font-size: 30rpx;
  215. text-align: center;
  216. padding-top: 58rpx;
  217. }
  218. .authorizMs{
  219. color: #999999;
  220. line-height: 36rpx;
  221. font-size: 26rpx;
  222. width: 452rpx;
  223. padding-top: 24rpx;
  224. text-align: center;
  225. margin-left: 56rpx;
  226. }
  227. .authorizContbutton{
  228. width: 422rpx;
  229. height: 88rpx;
  230. background: #D53533;
  231. border-radius: 44rpx;
  232. line-height: 88rpx;
  233. text-align: center;
  234. font-size:30rpx;
  235. color: #FFFFFF;
  236. margin-top: 62rpx;
  237. margin-left:71rpx;
  238. }
  239. </style>