diff --git a/www/js/shop.js b/www/js/shop.js index 463dd9e..89b5204 100644 --- a/www/js/shop.js +++ b/www/js/shop.js @@ -74,8 +74,8 @@ function buycoins(productId) { }); }) .then(function () { - loadstorefront(); - showShopMessage("Thanks for your purchase!", true); + showShopMessage("Thanks for your purchase!", false); + refreshcoins(); }) .catch(function (err) { console.log("Error: " + err.message); @@ -157,9 +157,6 @@ function setcoinhtmlfromiap(coinsjson) { + ""; }); $('#coin-list').html(coinsHtml); - /* - [{ productId: 'com.yourapp.prod1', 'title': '...', description: '...', price: '...' }, ...] - */ }) .catch(function (err) { console.log(err.message); @@ -187,4 +184,12 @@ function loadstorefront() { }); loadinventory(); // Make sure purchases stay in sync // Put it last in case it fails, so it doesn't crash stuff badly +} + +function refreshcoins() { + $.getJSON(mkApiUrl('shopitems'), function (data) { + if (data.status == 'OK') { + $('#coinbalance').text(data.balance); + } + }); } \ No newline at end of file diff --git a/www/screens/home.html b/www/screens/home.html index 9752ee9..0f46cc5 100644 --- a/www/screens/home.html +++ b/www/screens/home.html @@ -15,122 +15,151 @@ See the License for the specific language governing permissions and limitations under the License. --> -
-
- -

- Acquiring Location... -
-
-

-
-
-
- -
-

GPS location inaccurate. -
-
- Waiting for better accuracy...

-
- - - -
-

-
-
-
-
-

Life

- -
- -
-
- Menu -
-
- Scan Code -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
-
-
-
-
-
- -
-
-
-
- - - - + + + + \ No newline at end of file